|
ObjectivelyMVC
Object oriented MVC framework for SDL3 and GNU C
|
An Image packed into an ImageAtlas. More...
#include <AtlasImage.h>
Public Member Functions | |
| Class * | _AtlasImage (void) |
| AtlasImage * | initWithImage (AtlasImage *self, ImageAtlas *atlas, Image *image) |
| Initializes this AtlasImage with the given Image's surface. | |
| SDL_FRect | texcoords (const AtlasImage *self) |
| Resolves this AtlasImage's normalized texture coordinates within the atlas Texture. | |
Public Member Functions inherited from Image | |
| 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) |
Data Fields | |
| ImageAtlas * | atlas |
The ImageAtlas this AtlasImage belongs to, or NULL once that atlas has been released, after which this AtlasImage draws nothing. | |
| Image | image |
| The superclass. | |
| SDL_Rect | rect |
| This AtlasImage's rectangle within the atlas sheet, in texels. | |
Data Fields inherited from Image | |
| Object | object |
| The superclass. | |
| float | scale |
Pixels of surface per point: 1 for raster images, the requested scale for SVG. | |
| SDL_Surface * | surface |
| The backing surface. | |
| const char * | type |
| The image type, inferred if instantiated with a Resource. | |
Protected Attributes | |
| AtlasImageInterface * | interface [0] |
| The interface type. | |
Protected Attributes inherited from Image | |
| ImageInterface * | interface [0] |
| The interface type. | |
An Image packed into an ImageAtlas.
An AtlasImage keeps its source surface, so Image::size and anything else that reads surface behave as for a standalone Image. What it adds is where those pixels landed in the atlas sheet, so that a View drawing it samples the atlas Texture rather than a Texture of its own, and consecutive draws from the same atlas merge into one call.
Definition at line 41 of file AtlasImage.h.
| Class * _AtlasImage | ( | void | ) |
Definition at line 84 of file AtlasImage.c.
| AtlasImage * initWithImage | ( | AtlasImage * | self, |
| ImageAtlas * | atlas, | ||
| Image * | image | ||
| ) |
Initializes this AtlasImage with the given Image's surface.
| self | The AtlasImage. |
| atlas | The ImageAtlas. |
| image | The Image. |
NULL on error. Definition at line 32 of file AtlasImage.c.
| SDL_FRect texcoords | ( | const AtlasImage * | self | ) |
Resolves this AtlasImage's normalized texture coordinates within the atlas Texture.
| self | The AtlasImage. |
Definition at line 52 of file AtlasImage.c.
| ImageAtlas* AtlasImage::atlas |
The ImageAtlas this AtlasImage belongs to, or NULL once that atlas has been released, after which this AtlasImage draws nothing.
Definition at line 59 of file AtlasImage.h.
| Image AtlasImage::image |
The superclass.
Definition at line 46 of file AtlasImage.h.
|
protected |
The interface type.
Definition at line 52 of file AtlasImage.h.
| SDL_Rect AtlasImage::rect |
This AtlasImage's rectangle within the atlas sheet, in texels.
Definition at line 66 of file AtlasImage.h.