Menu

[r760]: / trunk / documentation / lispbuilder-sdl-image.html  Maximize  Restore  History

Download this file

746 lines (593 with data), 26.6 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=iso-8859-1" />
<title>LISPBUILDER-SDL-IMAGE - </title>
<style type="text/css">
body {
margin: 10px 20px 20px 220px;
padding: 0px;
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: small;
text-align: justify;
max-width: 50em;
background-color: white;
}
a, a:visited {
text-decoration: none;
color: maroon;
}
/* index */
div.index {
position: fixed;
top: 0px;
left: 0px;
width: 180px;
height: 100%;
margin: 0px;
padding: 5px;
font-size: 12px;
background-color: #DCDCDC;
border-right: thin black solid;
}
div.index ol {
color: navy;
margin: 0px;
padding-left: 0px;
}
div.index ol li {
list-style: none;
}
div.index ol li:before {
display: marker;
content: counter(heading1) ". ";
counter-increment: heading1;
}
div.index ol ol {
padding-left: 10px;
font-size: 10px;
list-style: none;
counter-reset: heading2;
}
div.index ol ol li:before {
display: marker;
content: counter(heading1)"." counter(heading2)" ";
counter-increment: heading2;
}
/* heading styles */
body > h1 {
margin-top: 0px;
}
h1 {
margin-top: 40px;
margin-bottom: 0px;
color: #4682B4;
}
h1:before {
display: marker;
content: counter(chapter) ". ";
counter-increment: chapter;
counter-reset: section1;
}
h1 + p {
margin-top: 5px;
}
h2 {
margin-top: 20px;
color: #000000;
margin-bottom: 0px;
}
h2:before {
display: marker;
content: counter(chapter) "." counter(section1) " ";
counter-increment: section1;
}
h2 + p {
margin-top: 0px;
}
h3 {
margin-top: 20px;
color: #000000;
margin-bottom: 0px;
}
h3:before {
display: marker;
content: counter(chapter) "." counter(section1) "." counter(section2) " ";
counter-increment: section2;
}
h3 + p {
margin-top: 0px;
}
h4 {
margin-top: 20px;
color: #000000;
margin-bottom: 0px;
}
h4:before {
display: marker;
content: counter(chapter) "." counter(section1) "." counter(section2) "." counter(section3) " ";
counter-increment: section3;
}
h4 + p {
margin-top: 0px;
}
/* generated content for images and tables */
img:after {
content: "[" counter(image) "] " attr(title);
counter-increment: image;
display: block;
font-size: 10px;
font-weight: bold;
margin-top: 5px;
margin-bottom: 20px;
color: black;
}
table:after {
content: "Table " counter(table) ": " attr(summary);
counter-increment: table;
display: table-caption;
caption-side: bottom;
font-size: 10px;
font-weight: bold;
margin-top: 5px;
margin-bottom: 20px;
white-space: nowrap;
color: black;
}
/* code for examples, code and pathnames*/
div.example table {
color: black;
}
div.example, div.code, div.path, div.sequence {
margin: 10px 0px;
border: 1px black solid;
padding: 10px;
background-color: #F4F4F4;
counter-reset: image;
color: maroon;
}
div.example:before {
content: "Example " counter(example);
counter-increment: example;
display: block;
}
div.example + p {
margin-bottom: 0px;
}
div.code:before {
content: "Code";
}
div.path:before {
content: "Path";
}
div.sequence:before {
content: "Sequence";
}
p.reference:before {
display: marker;
content: "[" counter(reference) "]";
counter-increment: reference;
font-weight: bold;
margin-right: 5px;
}
div.code:before, div.example:before, div.path:before, div.sequence:before {
font-weight: bold;
font-size: 15px;
margin-bottom: 20px;
color: black;
}
pre {
color: Green;
margin: 0px;
padding: 0px;
}
/* equation counter */
e:after {
content: "[" counter(equation) "]";
counter-increment: equation;
display: block;
float: right;
margin-right: 10px;
}
/* to prevent the CC image from being numbered */
img[alt="Creative Commons License"] {
display: inline;
}
img[alt="Creative Commons License"]:after {
display: none;
}
div#cc {
background-color: #DCDCDC;
border: thin black solid;
padding: 10px;
font-size: 10px;
}
/* Table Design */
/* http://www.duoh.com/csstutorials/csstables/ */
#mytable {
width: 700px;
padding: 0;
margin: 0;
}
caption {
padding: 0 0 5px 0;
width: 700px;
font: italic 11px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
text-align: right;
}
th {
font: bold 11px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
color: #4f6b72;
border-right: 1px solid #C1DAD7;
border-bottom: 1px solid #C1DAD7;
border-top: 1px solid #C1DAD7;
letter-spacing: 2px;
text-transform: uppercase;
text-align: left;
padding: 6px 6px 6px 12px;
background: #CAE8EA url(images/bg_header.jpg) no-repeat;
}
th.nobg {
border-top: 0;
border-left: 0;
border-right: 1px solid #C1DAD7;
background: none;
}
td {
border-right: 1px solid #C1DAD7;
border-bottom: 1px solid #C1DAD7;
background: #fff;
padding: 6px 6px 6px 12px;
color: #4f6b72;
}
td.alt {
background: #F5FAFA;
color: #797268;
}
th.spec {
border-left: 1px solid #C1DAD7;
border-top: 0;
background: #fff url(images/bullet1.gif) no-repeat;
font: bold 10px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
}
th.specalt {
border-left: 1px solid #C1DAD7;
border-top: 0;
background: #f5fafa url(images/bullet2.gif) no-repeat;
font: bold 10px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
color: #797268;
}
</style>
</head>
<!--
(CC) 2003 Luke Crook. Some Rights Reserved.
http://creativecommons.org/licenses/by/1.0
This page is licensed under a Creative Commons License.
Maintained by the Common Lisp Application Builder project at www.lispbuilder.org
The entire styleguide was copied wholesale from http://www.markschenk.com/cssexp/publication/article.xml
(CC) 2003 Mark Schenk. Some Rights Reserved.
http://creativecommons.org/licenses/by/1.0
This page is licensed under a Creative Commons License.
-->
<BODY BGCOLOR=#FFFFFF >
<h1><a name="top" class=none> LISPBUILDER-SDL-IMAGE - </a></h1>
<blockquote>
<br>&nbsp;</br><h2><a name=abstract class=abstract>Abstract</a></h2>
<p>
LISPBUILDER-SDL-IMAGE provides a Lisp wrapper for the
<a href="http://www.libsdl.org/projects/SDL_image/">SDL_Image</a> library.
LISPBUILDER-SDL-IMAGE has a dependency on the LISPBUILDER-SDL package.
LISPBUILDER-SDL-IMAGE is distributed under the
<a href="http://en.wikipedia.org/wiki/MIT_License">MIT-style license</a>.
</p>
<p>
LISPBUILDER-SDL-IMAGE supports the following image formats:
TGA, BMP, PNM, PBM, PGM, PPM, XPM, XCF, PCX , GIF, JPG, TIF, LBM and PNG.
</p>
<p>
<font color=red>Current Version:</font> The current version of LISPBUILDER-SDL-IMAGE is version <a href="#download">0.2</a>.
</p>
<!-- <p> -->
<!-- <font color=red>Download shortcut:</font> <a href="http://www.balooga.com/lispbuilder/lispbuilder-sdl-image.zip">http://www.balooga.com/lispbuilder/lispbuilder-sdl-image.zip</a>. -->
<!-- </p> -->
</blockquote>
<br>&nbsp;</br><h2><a class=none name="packageover">Package Overview</a></h2>
<p>
LISPBUILDER-SDL-IMAGE supports the following image formats:
TGA, BMP, PNM, PBM, PGM, PPM, XPM, XCF, PCX , GIF, JPG, TIF, LBM and PNG.
</p>
<p>
LISPBUILDER-SDL-IMAGE will attempt to automatically load an image by using the
<a href="http://en.wikipedia.org/wiki/Magic_number_(programming)#Magic_numbers_in_files">Magic Number</a>
in the image file. For image formats that have no magic number such as targa (.TGA), the
LISPBUILDER-SDL-IMAGE API allows the image type to be specified as a parameter.
</p>
<p>
Functions and symbols exported from the LISPBUILDER-SDL-IMAGE package are
accessible from the <code>LISPBUILDER-SDL-IMAGE:</code> prefix or the
shorter form <code>SDL-IMAGE:</code> nickname.
</p>
<p>
Note that additional libraries are required to load JPG, PNG and TIFF images:
</p>
<ul>
<li>JPG support requires the JPEG library:</li>
<ul>
<li><a href="http://www.ijg.org/">http://www.ijg.org/</a></li>
</ul>
<li>PNG support requires the PNG library, and the ZLib library:</li>
<ul>
<li><a href="http://www.libpng.org/pub/png/libpng.html">http://www.libpng.org/pub/png/libpng.html</a>, and </li>
<li><a href="http://www.gzip.org/zlib/">http://www.gzip.org/zlib/</a></li>
</ul>
<li>TIFF support requires the TIFF library:</li>
<ul>
<li><a href="ftp://ftp.sgi.com/graphics/tiff/">ftp://ftp.sgi.com/graphics/tiff/</a></li>
</ul>
</ul>
<br>&nbsp;</br><h2><a class=none name="examplesimple">Simple Example</a></h2>
<div class="example">
<p>
This example was created with the following code:
</p>
<p>
<img src="alien.png" width="200" height="167" title="Alien Technology" alt="Alien Technology"/>
</p>
<pre>
(sdl:with-init ()
(sdl:window 320 240)
(sdl:draw-surface (sdl-image:load-image "lisp.tga" :image-type :TGA :force t))
(sdl:with-events ()
(:quit-event () t)
(:video-expose-event (sdl:update-display))))
</pre>
</div>
<div class="index">
<ol>
<li><a href="#top">LISPBUILDER-SDL-IMAGE</a></li>
<ol>
<li><a href="#abstract">Abstract</a></li>
<li><a href="#packageover">Package Overview</a></li>
<li><a href="#examplesimple">Simple Example</a></li>
<li><a href="#compatibility">Compatibility</a></li>
<li><a href="#download">Download</a></li>
<li><a href="#installation">Installation</a></li>
<li><a href="#usage">Usage</a></li>
<li><a href="#examples">Examples</a></li>
<li><a href="#dependency">Dependencies</a></li>
<li><a href="#license">License</a></li>
<li><a href="#dictionar">The LISPBUILDER-SDL-IMAGE dictionary</a></li>
<ol>
<li><a href="#image-p"><code>image-p</code></a>
<li><a href="#image-type-of"><code>image-type-of</code></a>
<li><a href="#load-and-convert-image"><code>load-and-convert-image</code></a>
<li><a href="#load-image"><code>load-image</code></a>
</li>
</ol>
<li><a href="#ack">Acknowledgements</a></li>
</ol>
</div>
<br>&nbsp;</br><h2><a class=none name="compatibility">Compatibility</h2>
<p>
The following table describes the status of the Lisp implementations that have been tested with
LISPBUILDER-SDL-IMAGE:
</p>
<table id="mytable" cellspacing="0" summary="Compatibility">
<tr>
<th><b>Lisp Implementation</b></th>
<th colspan="3"><b>LISPBUILDER-SDL-IMAGE Status</b></th>
<th><b>Comments</b></th>
</tr>
<tr>
<th colspan="1"></th>
<th><b>Win32</b></th>
<th><b>Linux</b></th>
<th><b>MacOS</b></th>
<th></th>
</tr>
<tr>
<th class="spec" scope="row">
<a href="http://clisp.cons.org/">CLISP v2.38</a>
</th>
<td bgcolor="#60c060">Working</td>
<td bgcolor="#60c060">Working</td>
<td bgcolor="#ff6060">No</td>
<td></td>
</tr>
<tr>
<th class="specalt" scope="row">
<a href="http://www.lispworks.com/">Lispworks v4.4.6 Personal</a>
</th>
<td class="alt" bgcolor="#60c060">Working</td>
<td class="alt" bgcolor="#60c060">Working</td>
<td class="alt" bgcolor="#ff6060">No</td>
<td></td>
</tr>
<tr>
<th class="spec" scope="row">
<a href="http://www.franz.com/">Allegro Express 8.0</a>
</th>
<td bgcolor="#ff6060">Unknown</td>
<td bgcolor="#ff6060">Unknown</td>
<td bgcolor="#ff6060">No</td>
<td></td>
</tr>
<tr>
<th class="specalt" scope="row">
<a href="http://openmcl.clozure.com/">OpenMCL</a>
</th>
<td class="alt" bgcolor=blue><font color="#FFFFFF">NA</font></td>
<td class="alt" bgcolor=blue><font color="#FFFFFF">NA</font></td>
<td class="alt" bgcolor="#ff6060">Unknown</td>
<td></td>
</tr>
<tr>
<th class="spec" scope="row">
<a href="http://www.sbcl.org/">SBCL</a>
</th>
<td bgcolor="#60c060">Working</td>
<td bgcolor="#60c060">Working</td>
<td bgcolor="#ff6060">No</td>
<td></td>
</tr>
</table>
<br>&nbsp;</br><h2><a class=none name="download">Download</a></h2>
<ul>
<li><font color=red>Development:</font> Available via anonymous SVN at:
<pre>
svn co https://lispbuilder.svn.sourceforge.net/svnroot/lispbuilder lispbuilder
</pre>
</li>
<li>
<font color=red>Stable:</font> The latest stable versions are available from the
<a href="http://sourceforge.net/project/showfiles.php?group_id=159740">LISPBUILDER-SDL repository on SourceForge.</a>
</li>
<li>
<font color=red>The Edi Weitz 'Starter Pack' Version:</font> The stable version of Lispbuilder,
suitable for the installation of installation LISPBUILDER-SDL-IMAGE using the Lisp Starter Pack from Edi Weitz is can be downloaded from
<a href="http://www.balooga.com/lispbuilder/lispbuilder-sdl-image.zip">http://www.balooga.com/lispbuilder/lispbuilder-sdl-image.zip</a>.
</li>
</ul>
<br>&nbsp;</br><h2><a class=none name="installation">Installation</a></h2>
<p>See <a href="http://lispbuilder.sourceforge.net/index.html#installation">the LISPBUILDER documentation</a>
for installation instructions.
</p>
<br>&nbsp;</br><h2><a class=none name="usage">Using LISPBUILDER-SDL-IMAGE</a></h2>
<p>See <a href="http://lispbuilder.sourceforge.net/index.html#usage">the LISPBUILDER documentation</a>
for Usage instructions.
</p>
<br>&nbsp;</br><h2><a class=none name="examples">Running Examples in LISPBUILDER-SDL-IMAGE-EXAMPLES</a></h2>
<p>Enter the following at the REPL to load the examples in the
LISPBUILDER-SDL-IMAGE-EXAMPLES package:</p>
<pre>
(asdf:operate 'asdf:load-op :lispbuilder-sdl-image-examples)
</pre>
<p>The following examples are contained in the package LISPBUILDER-SDL-IMAGE-EXAMPLES:
</p>
<ul>
<li>(SDL-IMAGE-EXAMPLES:IMAGE-EXAMPLE)</li>
</ul>
<br>&nbsp;</br><h2><a class=none name="dependency">Dependencies</a></h2>
<p>LISPBUILDER-SDL-IMAGE has a dependency on LISPBUILDER-SDL.</p>
<br>&nbsp;</br><h2><a class=none name="license">License</a></h2>
<p>
LISPBUILDER-SDL-IMAGE is distributed under the
<a href="http://en.wikipedia.org/wiki/MIT_License">MIT-style license</a>.
</p>
<br>&nbsp;</br><h2><a class=none name="dictionar">The LISPBUILDER-SDL-IMAGE dictionary</a></h2>
<!-- Entry for IMAGE-P -->
<p><br>[Generic function]<br><a class=none name='image-p'><b>image-p</b> <i>source image-type</i> =&gt; <i>result</i></a>
<blockquote><br>
<p>Returns <code>T</code> if the source <code>SOURCE</code> contains an image of type <code>IMAGE-TYPE</code>. Returns <code>NIL</code> otherwise. Attempts to detect the image type using the <EM>magic number</EM> contained in the image if one is available. <code>NIL</code> is always returned for images of type <code>TGA</code> as a <code>TGA</code> image does not contain a <EM>magic number</EM>. </p><h5>Example </h5>
<pre><code>(RWOPS-P SOURCE :IMAGE-TYPE :BMP)
</code></pre>
</blockquote>
<!-- End of entry for IMAGE-P -->
<!-- Entry for IMAGE-P -->
<p><br>[Method]<br><a class=none><b>image-p</b> <i>(source string) image-type</i> =&gt; <i>result</i></a>
<blockquote><br>
<p>Returns <code>T</code> if the image in the file at location <code>SOURCE</code> is of type <code>IMAGE-TYPE</code>. </p><h5>Parameters </h5>
<ul><li><code>SOURCE</code> is the filename and path of the file on the drive of type <code>STRING</code>. </li>
<li><code>IMAGE-TYPE</code> can be one of <code>:BMP</code>, <code>:GIF</code>, <code>:JPG</code>, <code>:LBM</code>, <code>:PCX</code>, <code>:PNG</code>, <code>:PNM</code>, <code>:TIF</code>, <code>:XCF</code>, <code>:XPM</code> or <code>:XV</code>. </li>
</ul><h5>Examples </h5>
<pre><code>(IMAGE-P &amp;quot;image.bmp&amp;quot; :IMAGE-TYPE :BMP)
</code></pre>
</blockquote>
<!-- End of entry for IMAGE-P -->
<!-- Entry for IMAGE-P -->
<p><br>[Method]<br><a class=none><b>image-p</b> <i>(source rwops) image-type</i> =&gt; <i>result</i></a>
<blockquote><br>
<p>Returns <code>T</code> when the type of image contained in the <code>SDL:RWOPS</code> in the source <code>SOURCE</code> is of the type <code>IMAGE-TYPE</code>. </p><h5>Parameters </h5>
<ul><li><code>SOURCE</code> is of type <code>SDL:RWOPS</code>. </li>
<li><code>IMAGE-TYPE</code> must be one of <code>:BMP</code>, <code>:GIF</code>, <code>:JPG</code>, <code>:LBM</code>, <code>:PCX</code>, <code>:PNG</code>, <code>:PNM</code>, <code>:TIF</code>, <code>:XCF</code>, <code>:XPM</code> or <code>:XV</code>. </li>
</ul>
</blockquote>
<!-- End of entry for IMAGE-P -->
<!-- Entry for IMAGE-TYPE-OF -->
<p><br>[Generic function]<br><a class=none name='image-type-of'><b>image-type-of</b> <i>source</i> =&gt; <i>result</i></a>
<blockquote><br>
<p>Returns the type of image in source <code>SOURCE</code>. Attempts to detect the image type using the <EM>magic number</EM> contained in the image if one is available. </p><h5>Returns </h5>
<ul><li>Returns the image type of <code>SOURCE</code> which may be one of <code>:BMP</code>, <code>:GIF</code>, <code>:JPG</code>, <code>:LBM</code>, <code>:PCX</code>, <code>:PNG</code>, <code>:PNM</code>, <code>:TIF</code>, <code>:XCF</code>, <code>:XPM</code> or <code>:XV</code>, if the image type can be determined. Returns <code>NIL</code> if the image cannot be determined (The <EM>magic number</EM> is not supported or the <EM>magic number</EM> is not found). <code>NIL</code> is always returned for images of type <code>TGA</code> as a <code>TGA</code> image does not contain a <EM>magic number</EM>. </li>
</ul>
</blockquote>
<!-- End of entry for IMAGE-TYPE-OF -->
<!-- Entry for IMAGE-TYPE-OF -->
<p><br>[Method]<br><a class=none><b>image-type-of</b> <i>(source string)</i> =&gt; <i>result</i></a>
<blockquote><br>
<p>Returns the type of image in the file at location <code>SOURCE</code>. </p><h5>Parameters </h5>
<ul><li><code>SOURCE</code> is the filename and path of the file on the drive of type <code>STRING</code>. </li>
</ul><h5>Example </h5>
<pre><code>(IMAGE-TYPE-OF &amp;quot;image.bmp&amp;quot;)
</code></pre>
</blockquote>
<!-- End of entry for IMAGE-TYPE-OF -->
<!-- Entry for IMAGE-TYPE-OF -->
<p><br>[Method]<br><a class=none><b>image-type-of</b> <i>(source rwops)</i> =&gt; <i>result</i></a>
<blockquote><br>
<p>Returns the type of image contained in the <code>SDL:RWOPS</code> in the source <code>SOURCE</code>. </p><h5>Parameters </h5>
<ul><li><code>SOURCE</code> is of type <code>SDL:RWOPS</code>. </li>
</ul><h5>Example </h5>
<pre><code>(IMAGE-TYPE-OF SOURCE)
</code></pre>
</blockquote>
<!-- End of entry for IMAGE-TYPE-OF -->
<!-- Entry for LOAD-AND-CONVERT-IMAGE -->
<p><br>[Function]<br><a class=none name='load-and-convert-image'><b>load-and-convert-image</b> <i>source <tt>&amp;rest</tt> named-pairs <tt>&amp;key</tt> image-type force <tt>&amp;allow-other-keys</tt></i> =&gt; <i>result</i></a>
<blockquote><br>
<p>Loads an image from the filename <code>SOURCE</code> as per <a href="#load-image-*">LOAD-IMAGE-*</a>, converts this image to the current display format using <code>SDL:CONVERT-SURFACE</code>. </p><p>Parameters supported are the same as those for <a href="#load-image">LOAD-IMAGE</a> and <code>SDL:CONVERT-IMAGE</code>. </p>
</blockquote>
<!-- End of entry for LOAD-AND-CONVERT-IMAGE -->
<!-- Entry for LOAD-IMAGE -->
<p><br>[Generic function]<br><a class=none name='load-image'><b>load-image</b> <i>source <tt>&amp;key</tt> image-type force free</i> =&gt; <i>result</i></a>
<blockquote><br>
<p>Creates and returns a new surface from the source <code>SOURCE</code>. </p><p>Unless <code>:FORCE T</code>, the <EM>magic number</EM> will be used to determine the image type contained in the <code>SDL:RWOPS</code> in <code>SOURCE</code>. To load an image when the <EM>magic number</EM> is unavailable (image formats such as <code>TGA</code> do not contain a <EM>magic number</EM><code>), specify the image type using the </code>KEY<code>word </code>IMAGE-TYPE<code>. If the *magic number* is available and does not match </code>IMAGE-TYPE<code>, then </code>IMAGE-TYPE<code> is ignored. To load an image as </code>IMAGE-TYPE<code> when the *magic number* is available (effectively ignoring the *magic number*), specify </code>:FORCE T<code>. It is probably best to avoid using </code>:FORCE T` unless you know what you are doing. </p><h5>Returns </h5>
<ul><li>Returns a new <code>SDL:SURFACE</code>, or <code>NIL</code> if <code>SOURCE</code> does not contain a valid image or the image type cannot be determined. All non-magicable image formats, such as <code>TGA</code>, must be specified using <code>iMAGE-TYPE</code>. To load a TGA image, for example, use <code>:IMAGE-TYPE :TGA</code></li>
</ul><h5>Example </h5>
<ul><li>To load a <code>BMP</code> image using the <EM>magic number</EM></li>
(CREATE-IMAGE-FROM-RWOPS SOURCE)
<li>To load a <code>TGA</code> image </li>
(CREATE-IMAGE-FROM-RWOPS SOURCE :IMAGE-TYPE :TGA)
<li>To load a <code>BMP</code> image as <code>TGA</code></li>
(CREATE-IMAGE-FROM-RWOPS SOURCE :IMAGE-TYPE :TGA :FORCE T)
</ul>
</blockquote>
<!-- End of entry for LOAD-IMAGE -->
<!-- Entry for LOAD-IMAGE -->
<p><br>[Method]<br><a class=none><b>load-image</b> <i>(source string) <tt>&amp;key</tt> image-type force free</i> =&gt; <i>result</i></a>
<blockquote><br>
<p>Creates and returns a new surface from the image in the file at the location <code>SOURCE</code>. </p><h5>Parameters </h5>
<ul><li><code>SOURCE</code> is the filename and path of the file on the drive of type <code>STRING</code>. </li>
<li><code>IMAGE-TYPE</code> when specified type may be one of <code>NIL</code>, <code>:BMP</code>, <code>:GIF</code>, <code>:JPG</code>, <code>:LBM</code>, <code>:PCX</code>, <code>:PNG</code>, <code>:PNM</code>, <code>:TGA</code>, <code>:TIF</code>, <code>:XCF</code>, <code>:XPM</code> or <code>:XV</code>. </li>
<li><code>FORCE</code> when <code>T</code> will force an image to be loaded as <code>IMAGE-TYPE</code>, ignoring any <EM>magic number</EM> when present in <code>SOURCE</code>. </li>
<li><code>FREE</code> is only used when <code>SOURCE</code> is <code>SDL:RWOPS</code>. </li>
</ul><h5>Example </h5>
<ul><li>To load a <code>BMP</code> image using the <EM>magic number</EM></li>
(LOAD-IMAGE &amp;quot;image.bmp&amp;quot;)
(LOAD-IMAGE &amp;quot;image.tga&amp;quot; :IMAGE-TYPE :TGA)
(LOAD-IMAGE &amp;quot;image.bmp&amp;quot; :IMAGE-TYPE :BMP :FORCE T)
</ul>
</blockquote>
<!-- End of entry for LOAD-IMAGE -->
<!-- Entry for LOAD-IMAGE -->
<p><br>[Method]<br><a class=none><b>load-image</b> <i>(source rwops) <tt>&amp;key</tt> image-type force free</i> =&gt; <i>result</i></a>
<blockquote><br>
<p>Creates and returns a new surface from the image contained in the <code>SDL:RWOPS</code> structure in the source <code>SOURCE</code>. </p><h5>Parameters </h5>
<ul><li><code>SOURCE</code> is of type <code>SDL:RWOPS</code>. </li>
<li><code>IMAGE-TYPE</code> when specified type may be one of <code>NIL</code>, <code>:BMP</code>, <code>:GIF</code>, <code>:JPG</code>, <code>:LBM</code>, <code>:PCX</code>, <code>:PNG</code>, <code>:PNM</code>, <code>:TGA</code>, <code>:TIF</code>, <code>:XCF</code>, <code>:XPM</code> or <code>:XV</code>. </li>
<li><code>FORCE</code> when <code>T</code> will force an image to be loaded as <code>IMAGE-TYPE</code>, ignoring any <EM>magic number</EM> when present in <code>SOURCE</code>. </li>
<li><code>FREE</code> when <code>T</code> will automatically free the <code>SDL:RWOPS</code> in <code>SOURCE</code>. </li>
</ul>
</blockquote>
<!-- End of entry for LOAD-IMAGE -->
<br>&nbsp;<br><h3><a class=none name="ack">Acknowledgements</a></h3>
<ul>
<li>
Documentation prepared using Edi Weitz's
<a href="http://weitz.de/documentation-template/">DOCUMENTATION-TEMPLATE</a>.
</li>
</ul>
<p>
<a href="index.html">BACK</a>
</p>
</body>
</html>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.