|
| Class * | _Image (void) |
| | The Image archetype.
|
| |
| Image * | imageWithBytes (const uint8_t *bytes, size_t length) |
| | Instantiates an Image with the specified bytes.
|
| |
| Image * | imageWithData (const Data *data) |
| | Instantiates an Image with the specified Data.
|
| |
| Image * | imageWithResource (const Resource *resource) |
| | Instantiates an Image with the specified Resource.
|
| |
| Image * | imageWithResourceName (const char *name) |
| | Instantiates an Image with the specified Resource name.
|
| |
| Image * | imageWithSurface (SDL_Surface *surface) |
| | Instantiates an Image with the specified surface.
|
| |
| Image * | imageWithSVG (const uint8_t *bytes, size_t length, float scale) |
| | Instantiates an Image by rasterizing the specified SVG.
|
| |
| Image * | initWithBytes (Image *self, const uint8_t *bytes, size_t length) |
| | Initializes this Image with the specified bytes.
|
| |
| Image * | initWithData (Image *self, const Data *data) |
| | Initializes this Image with the specified Data.
|
| |
| Image * | initWithResource (Image *self, const Resource *resource) |
| | Initializes this Image with the specified Resource.
|
| |
| Image * | initWithResourceName (Image *self, const char *name) |
| | Initializes this Image, loading the Resource by the given name.
|
| |
| Image * | initWithSurface (Image *self, SDL_Surface *surface) |
| | Initializes this Image with the given surface.
|
| |
| Image * | initWithSVG (Image *self, const uint8_t *bytes, size_t length, float scale) |
| | Initializes this Image by rasterizing the specified SVG at its intrinsic size times scale.
|
| |
| Image * | initWithSVGSize (Image *self, const uint8_t *bytes, size_t length, SDL_Size points) |
| | Initializes this Image by rasterizing the specified SVG at points times the pixel density, so that Image::size reports points.
|
| |
| SDL_Size | size (const Image *self) |
| |
Image loading.
Raster formats load at their native size. SVG, recognized by type or by sniffing, rasterizes at its intrinsic size times a scale, so that a vector asset drawn into a frame of its intrinsic size stays sharp at any pixel density; Image::size reports points.
Definition at line 41 of file Image.h.
| Image * initWithResourceName |
( |
Image * |
self, |
|
|
const char * |
name |
|
) |
| |
Initializes this Image, loading the Resource by the given name.
An @ decoration is interpreted, and where it sits says what it is. Trailing the whole name, heart.svg@24x24 rasterizes a vector at that size in points; it is a request rather than part of any file's name, so heart.svg is what loads. Inside the name, before the extension, heart@2x.png declares that a raster carries that many pixels per point, following Apple's convention, and names the file to load. An undecorated raster prefers the variant matching the pixel density where one exists, so heart.png loads heart@2x.png on a 2x display; an undecorated vector simply rasterizes at the pixel density.
- Parameters
-
| self | The Image. |
| name | The Resource name. |
| pixelDensity | Pixels per point, e.g. the window's pixel density. |
- Returns
- The initialized Image, or
NULL on error.