/usr/lib/perl5/pods/SDL/Image.pod is in libsdl-perl 2.540-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | =pod
=head1 NAME
SDL::Image - Bindings for the SDL_Image library
=head1 DESCRIPTION
SDL::Image allows you to load many different format of images into memory as an SDL::Surface.
=head1 CATEGORY
Image
=head1 SUPPORTED FORMATS
The following types are supported:
=over
=item TGA
TrueVision Targa (MUST have .tga)
=item BMP
Windows Bitmap(.bmp)
=item PNM
Portable Anymap (.pnm)
.pbm = Portable BitMap (mono)
.pgm = Portable GreyMap (256 greys)
.ppm = Portable PixMap (full color)
=item XPM
X11 Pixmap (.xpm) can be #included directly in code
This is NOT the same as XBM(X11 Bitmap) format, which is for monocolor images.
=item XCF
GIMP native (.xcf) (XCF = eXperimental Computing Facility?)
This format is always changing, and since there's no library supplied by the GIMP project to load XCF, the loader may frequently fail to load much
of any image from an XCF file. It's better to load this in GIMP and convert to a better supported image format.
=item PCX
ZSoft IBM PC Paintbrush (.pcx)
=item GIF
CompuServe Graphics Interchange Format (.gif)
=item JPG
Joint Photographic Experts Group JFIF format (.jpg or .jpeg)
=item TIF
Tagged Image File Format (.tif or .tiff)
=item LBM
Interleaved Bitmap (.lbm or .iff) FORM : ILBM or PBM(packed bitmap), HAM6, HAM8, and 24bit types are not supported.
=item PNG
Portable Network Graphics (.png)
=item XV
=item ICO
=item CUR
=back
=head1 LOADING METHODS
=head2 load
my $surface = SDL::Image::load( $file );
$file Image file name to load a surface from.
Load file for use as an image in a new L<SDL::Surface>. This actually calls L<SDL::Image::load_typed_rw|SDL::Image/"load_typed_rw">, with the
file extension used as the type string. This can load all supported image files, including TGA as long as the filename ends with ".tga". It is
best to call this outside of event loops, and rather keep the loaded images around until you are really done with them, as disk speed and image
conversion to a surface is not that speedy.
B<Note>: If the image format loader requires initialization, it will attempt to do that the first time it is needed if you have not already called
L<SDL::Image::init|SDL::Image/"init"> to load support for your image format.
B<Note>: If the image format supports a transparent pixel, L<SDL::Image> will set the colorkey for the surface. You can enable RLE acceleration on
the surface afterwards by calling:
L<SDL::Video::set_color_key|SDL::Video/"set_color_key">
my $image = SDL::Image::load( $some_png_file );
SDL::Video::set_color_key($image, SDL_RLEACCEL, $image->format->colorkey);
=head3 Return
An image as a L<SDL::Surface>. NULL is returned on errors, such as no support built for the image, or a file reading error. Use
L<SDL::get_error|SDL/"get_error"> to get cause of error.
=head2 load_typed_rw
SDL::Image::load_typed_rw($src, $freesrc, $type);
=over
=item src
The source L<SDL::RWops> as a pointer. The image is loaded from this.
=item freesrc
A non-zero value mean is will automatically close/free the src for you. Since SDL Perl cannot handle the memory inside this function you would most
likely want 1 here.
=item type
A string that indicates which format type to interpret the image as.
Here is a list of the currently recognized strings (case is not important):
=over
=item "BMP"
=item "CUR"
=item "GIF"
=item "ICO"
=item "JPG"
=item "LBM"
=item "PCX"
=item "PNG"
=item "PNM"
=item "TGA"
=item "TIF"
=item "XCF"
=item "XPM"
=item "XV"
=back
=back
Load src for use as a surface. This can load all supported image formats. This method does not guarantee that the format specified by type is the
format of the loaded image, except in the case when TGA format is specified (or any other non-magicable format in the future). Using SDL_RWops is
not covered here, but they enable you to load from almost any source.
B<Note>: If the image format loader requires initialization, it will attempt to do that the first time it is needed if you have not already called
L<SDL::Image::init|SDL::Image/"init"> to load support for your image format.
B<Note>: If the image format supports a transparent pixel, L<SDL::Image> will set the colorkey for the surface. You can enable RLE acceleration on
the surface afterwards by calling: L<SDL::Video::set_color_key|SDL::Video/"set_color_key">
=head3 Transparency
use SDL;
use SDL::RWOps;
use SDL::Image;
my $file2 = SDL::RWOps->new_file("test/data/menu.png", "rb");
my $image = SDL::Image::load_typed_rw($file2, 1, "PNG");
SDL::Video::set_color_key($image, SDL_RLEACCEL, $image->format->colorkey);
=head3 Return
The image as a new L<SDL::Surface>. NULL is returned on errors.
=head2 is_[TYPE]
Test for valid, supported image files:
=over
=item is_ICO
=item is_CUR
=item is_PNG
=item is_BMP
=item is_GIF
=item is_JPG
=item is_LBM
=item is_PCX
=item is_PNM
=item is_TIF
=item is_XCF
=item is_XPM
=item is_XV
=back
These functions take a L<SDL::RWOps> as a parameter.
=head3 Return
1 if the image is a valid [TYPE] and the [TYPE] format support is compiled into SDL_image. 0 is returned otherwise.
=head3 Example
use SDL::RWOps;
use SDL::Image;
my $file = SDL::RWOps->new_file("file", "rb");
print "Image is BMP" if ( SDL::is_BMP );
=head2 load_[TYPE]_rw
Specific loader for known formats:
=over
=item load_ICO_rw
=item load_CUR_rw
=item load_PNG_rw
=item load_BMP_rw
=item load_GIF_rw
=item load_JPG_rw
=item load_LBM_rw
=item load_PCX_rw
=item load_PNM_rw
=item load_TIF_rw
=item load_XCF_rw
=item load_XPM_rw
=item load_XV_rw
=back
These functions take a L<SDL::RWop> as a parameter
=head3 Return
The image as a new L<SDL::Surface>. NULL is returned on errors, like if the [TYPE] is not supported, or a read error.
=head3 Example
use SDL;
use SDL::RWOps;
use SDL::Image;
my $file = SDL::RWOps->new_file("file.png", "rb");
my $image = SDL::Image::load_PNG_rw($file);
die SDL::get_error if (!$image);
=head2 read_XPM_from_array
my $picture = SDL::Image::read_XPM_from_array(\@XPM, $width);
This functions takes the reference of an array in the valid @XPM format. Also the $width of the XPM image.
=head3 Return
The image as a new L<SDL::Surface>. NULL is returned on errors, like if XPM is not supported, or a read error.
=head3 Example
my @XPM= (
'30 30 9 1',
' c #FFFFFF',
'. c #EFEFEF',
'+ c #CFCFCF',
'@ c #9F9F9F',
'# c #808080',
'$ c #505050',
'% c #202020',
'& c #000000',
'* c #303030',
' ',
' ',
' ',
' ',
' ',
' ',
' ',
' ',
' ',
' .+@##@+. ',
' .@$%&&%$@. ',
' .@*&&&&&&*@. ',
' +$&&&&&&&&$+ ',
' @%&&&&&&&&%@ ',
' #&&&&&&&&&&# ',
' #&&&&&&&&&&# ',
' @%&&&&&&&&%@ ',
' +$&&&&&&&&$+ ',
' .@*&&&&&&*@. ',
' .@$%&&%$@. ',
' .+@##@+. ',
' ',
' ',
' ',
' ',
' ',
' ',
' ',
' ',
' ',);
my $picture = SDL::Image::read_XPM_from_array(\@XPM, 30);
=head1 MISC METHODS
=head2 linked_version
Provides the version of linked sdl_image library.
=head3 Return
Returns a L<SDL::Version> object
=head3 Example
my $version = SDL::Image::linked_version();
print $version->major.' '.$version->minor.' '.$version->patch;
=head2 init
B<For version SDL_image 1.2.10 and up>
=head3 Flags
bitwise OR'd set of image formats to support by loading a library now. The values you may OR together to pass in are:
=over
=item IMG_INIT_JPG
=item IMG_INIT_PNG
=item IMG_INIT_TIF
=back
Initialize by loading support as indicated by the flags, or at least return success if support is already loaded. You may call this multiple times,
which will actually require you to call IMG_Quit just once to clean up. You may call this function with a 0 to retrieve whether support was built-in
or not loaded yet.
B<Note>: to load JPG, PNG, and/or TIF images you can call IMG_Init with the right IMG_INIT_* flags OR'd together before you program gets busy, to
prevent a later hiccup while it loads the library, and to check that you do have the support that you need before you try and use it.
B<Note>: No initialization is needed nor performed when using the SDL::Image::is_JPG, SDL::Image::is_PNG, and SDL::Image::is_TIF functions.
B<Note>: this function does not always set the error string, so do not depend on SDL::Image::get_error being meaningful all the time.
=head3 Return
A bitmask of all the currently inited image loaders.
=head3 Example
use SDL::Image;
my $flags = IMG_INIT_JPG | IMG_INIT_PNG | IMG_INIT_JPG;
my $inited = SDL::Image::init($flags);
=head2 quit
B<For version SDL_image 1.2.10 and up>
This function cleans up all dynamically loaded library handles, freeing memory. If support is required again it will be initialized again, either
by L<SDL::Image::init|SDL::Image/"init"> or loading an image with dynamic support required. You may call this function when
L<SDL::Image::load|SDL::Image/"load"> functions are no longer needed for the JPG, PNG, and TIF image formats. You only need to call this function
once, no matter how many times L<SDL::Image::init|SDL::Image/"init"> was called.
=head3 Example
use SDL::Image;
SDL::Image::init(IMG_INIT_JPG); #loads JPG support
SDL::Image::load("file.png"); #loads PNG support
SDL::Image::quit(); #unloads everything
=head2 set_error
Same as L<SDL::set_error|SDL/"set_error">
=head2 get_error
Same as L<SDL::get_error|SDL/"get_error">
=head1 SEE ALSO
L<SDL>, L<SDL::Surface>, L<SDL::Video>, L<SDL::RWOps>
=head1 AUTHORS
See L<SDL/AUTHORS>.
=cut
|