24#define _Class _AtlasImage
26#pragma mark - AtlasImage
36 assert(
image->surface);
42 self->
rect = (SDL_Rect) { 0, 0, 0, 0 };
56 return (SDL_FRect) { 0.f, 0.f, 0.f, 0.f };
59 const float w = (float) sheet->
surface->w, h = (
float) sheet->
surface->h;
69#pragma mark - Class lifecycle
76 ((AtlasImageInterface *) clazz->interface)->initWithImage =
initWithImage;
77 ((AtlasImageInterface *) clazz->interface)->texcoords =
texcoords;
89 clazz = _initialize(&(
const ClassDef) {
93 .interfaceSize =
sizeof(AtlasImageInterface),
static AtlasImage * initWithImage(AtlasImage *self, ImageAtlas *atlas, Image *image)
Class * _AtlasImage(void)
static SDL_FRect texcoords(const AtlasImage *self)
static void initialize(Class *clazz)
An Image packed into an ImageAtlas.
Packs many Images into one sheet, backed by one Texture.
An Image packed into an ImageAtlas.
SDL_Rect rect
This AtlasImage's rectangle within the atlas sheet, in texels.
Image image
The superclass.
ImageAtlas * atlas
The ImageAtlas this AtlasImage belongs to, or NULL once that atlas has been released,...
Packs many Images into one sheet, backed by one Texture.
Image * image
The compiled sheet, or NULL until ImageAtlas::compile.
float scale
Pixels of surface per point: 1 for raster images, the requested scale for SVG.
Image * initWithSurface(Image *self, SDL_Surface *surface)
Initializes this Image with the given surface.
SDL_Surface * surface
The backing surface.