24#define _Class _AtlasImage
26#pragma mark - AtlasImage
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;
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.
static Image * initWithSurface(Image *self, SDL_Surface *surface)
Packs many Images into one sheet, backed by one Texture.
static Image * image(Theme *self, const char *name, float pixelDensity)
An Image packed into an ImageAtlas.
SDL_FRect texcoords(const AtlasImage *self)
Resolves this AtlasImage's normalized texture coordinates within the atlas Texture.
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.
SDL_Surface * surface
The backing surface.