8#include "TinyGPU/Vector.h"
15
16
17
18
19
20template <
typename RGB_T =
RGB565,
typename SurfaceT =
Surface<RGB_T>>
24
25
26
27
28
35 const ISurface<RGB_T>*
sprite =
nullptr;
41 const ISurface<RGB_T>& sourceSprite, RGB_T transparentColor,
52 return transformedSprite
53 ?
static_cast<
const ISurface<RGB_T>&>(*transformedSprite)
60 framebuffer.copySprite(x, y, originalPixels);
67 if (!transformedSprite) {
69 std::make_unique<SurfaceT>(maxWidth, maxHeight, fontRef);
70 transformedSprite->begin();
77 if (!transformedSprite) {
79 maxWidth = newSprite.width();
80 maxHeight = newSprite.height();
82 std::make_unique<SurfaceT>(maxWidth, maxHeight, newSprite.font());
83 transformedSprite->begin();
86 size_t copyWidth = std::min(maxWidth, newSprite.width());
87 size_t copyHeight = std::min(maxHeight, newSprite.height());
88 for (size_t y = 0; y < copyHeight; ++y) {
89 for (size_t x = 0; x < copyWidth; ++x) {
90 transformedSprite->setPixel(x, y, newSprite.getPixel(x, y));
94 for (size_t y = copyHeight; y < maxHeight; ++y) {
95 for (size_t x = 0; x < maxWidth; ++x) {
96 transformedSprite->setPixel(x, y, RGB_T(0));
99 for (size_t y = 0; y < copyHeight; ++y) {
100 for (size_t x = copyWidth; x < maxWidth; ++x) {
101 transformedSprite->setPixel(x, y, RGB_T(0));
119 RGB_T invisibleColor = RGB_T(0)) {
120 TinyGPULogger.log(TinyGPULoggerClass::INFO,
"Adding sprite at (%zu, %zu)",
122 auto info = std::make_unique<SpriteInfo>(x, y, sprite, invisibleColor,
125 info->saveOriginalPixels(surface_);
126 surface_.drawSprite(x, y, info->currentSprite(), invisibleColor);
128 sprites_.push_back(std::move(info));
129 return *sprites_.back();
134 const ISurface<RGB_T>& sprite,
135 RGB_T invisibleColor = RGB_T(0)) {
136 TinyGPULogger.log(TinyGPULoggerClass::INFO,
137 "Adding sprite at (%zu, %zu) with max size (%zu, %zu)", x,
139 auto info = std::make_unique<SpriteInfo>(x, y, sprite, invisibleColor,
141 info->setMaxSize(maxX, maxY);
142 info->saveOriginalPixels(surface_);
143 surface_.drawSprite(x, y, info->currentSprite(), invisibleColor);
144 sprites_.push_back(std::move(info));
145 return *sprites_.back();
151 spriteInfo.x
, spriteInfo.y
);
154 if (it != sprites_.end()) {
161 TinyGPULogger.log(TinyGPULoggerClass::INFO,
162 "Moving sprite from (%zu, %zu) to (%zu, %zu)",
163 spriteInfo.x, spriteInfo.y, newX, newY);
164 if (spriteInfo.x == newX && spriteInfo.y == newY) {
168 const Rect oldBounds{spriteInfo.x, spriteInfo.y,
169 spriteInfo.currentSprite().width(),
170 spriteInfo.currentSprite().height()};
171 const Rect newBounds{newX, newY, spriteInfo.currentSprite().width(),
172 spriteInfo.currentSprite().height()};
176 Surface<RGB_T> movedBackground =
181 spriteInfo.originalPixels = std::move(movedBackground);
182 surface_.drawSprite(spriteInfo.x, spriteInfo.y, spriteInfo.currentSprite(),
183 spriteInfo.invisibleColor);
189 "Scaling sprite at (%zu, %zu) by %.2f", spriteInfo.x
,
190 spriteInfo.y
, scale
);
199 "Rotating sprite at (%zu, %zu) by %.2f degrees",
200 spriteInfo.x
, spriteInfo.y
, angleDegrees
);
207 void setPixel(size_t x, size_t y, RGB_T color)
override {
208 surface_.setPixel(x, y, color);
211 RGB_T
getPixel(size_t x, size_t y)
const override {
212 return surface_.getPixel(x, y);
215 bool resize(size_t w, size_t h)
override {
return surface_.resize(w, h); }
229 void drawLine(size_t x0, size_t y0, size_t x1, size_t y1, RGB_T color) {
230 surface_.drawLine(x0, y0, x1, y1, color);
233 void drawRect(size_t x, size_t y, size_t w, size_t h, RGB_T color) {
234 surface_.drawRect(x, y, w, h, color);
237 void fillRect(size_t x, size_t y, size_t w, size_t h, RGB_T color) {
238 surface_.fillRect(x, y, w, h, color);
242 surface_.drawCircle(x, y, r, color);
246 surface_.fillCircle(x, y, r, color);
249 void drawSprite(size_t x, size_t y,
const ISurface<RGB_T>& sprite,
250 RGB_T invisibleColor = RGB_T()) {
251 surface_.drawSprite(x, y, sprite, invisibleColor);
255 RGB_T clearColor = RGB_T()) {
256 surface_.clearSprite(x, y, sprite, clearColor);
259 void copySprite(size_t x, size_t y,
const ISurface<RGB_T>& sprite) {
260 surface_.copySprite(x, y, sprite);
263 void drawText(int16_t x, int16_t y,
const char* text, RGB_T foreground,
264 RGB_T background = RGB_T(),
bool opaque =
false,
265 uint8_t scale = 1, uint8_t spacing = 1,
266 uint8_t lineSpacing = 1) {
267 surface_.drawText(x, y, text, foreground, background, opaque, scale,
268 spacing, lineSpacing);
274 return surface_.isInBounds(x, y);
278 surface_.setPixelClipped(x, y, color);
282 surface_.drawHorizontalLineClipped(x0, x1, y, color);
291 bool setData(uint8_t *data, size_t dataSize) {
293 if (dataSize > surface_.size()) {
296 std::memcpy(
const_cast<uint8_t*>(surface_.data()), data, dataSize);
316 const size_t overlapX = std::max(first.x, second.x);
317 const size_t overlapY = std::max(first.y, second.y);
318 const size_t firstRight = first.x + first.width;
319 const size_t firstBottom = first.y + first.height;
320 const size_t secondRight = second.x + second.width;
321 const size_t secondBottom = second.y + second.height;
322 const size_t overlapRight = std::min(firstRight, secondRight);
323 const size_t overlapBottom = std::min(firstBottom, secondBottom);
325 if (overlapX >= overlapRight || overlapY >= overlapBottom) {
329 return {overlapX, overlapY, overlapRight - overlapX,
330 overlapBottom - overlapY};
335 return rect.width == 0 || rect.height == 0;
341 Surface<RGB_T>&& transformedSprite) {
342 const Rect oldBounds{spriteInfo.x, spriteInfo.y,
343 spriteInfo.currentSprite().width(),
344 spriteInfo.currentSprite().height()};
345 const size_t anchoredX = centeredCoordinate(spriteInfo.x, oldBounds.width,
346 transformedSprite.width());
347 const size_t anchoredY = centeredCoordinate(spriteInfo.y, oldBounds.height,
348 transformedSprite.height());
349 const Rect newBounds{anchoredX, anchoredY, transformedSprite.width(),
350 transformedSprite.height()};
354 Surface<RGB_T> updatedBackground =
357 spriteInfo.x = anchoredX;
358 spriteInfo.y = anchoredY;
359 spriteInfo.setTransformedSprite(std::move(transformedSprite));
360 spriteInfo.originalPixels = std::move(updatedBackground);
361 this->drawSprite(spriteInfo.x, spriteInfo.y, spriteInfo.currentSprite(),
362 spriteInfo.invisibleColor);
368 const float centeredPosition =
369 static_cast<
float>(oldPosition) +
370 (
static_cast<
float>(oldSize) -
static_cast<
float>(newSize)) / 2.0;
371 return centeredPosition <= 0.0
373 :
static_cast<size_t>(std::lround(centeredPosition));
379 const Rect& overlap) {
385 drawSpriteRegion(spriteInfo.originalPixels, 0, 0, oldBounds.x, oldBounds.y,
386 oldBounds.width, overlap.y - oldBounds.y);
388 const size_t overlapBottom = overlap.y + overlap.height;
389 drawSpriteRegion(spriteInfo.originalPixels, 0, overlapBottom - oldBounds.y,
390 oldBounds.x, overlapBottom, oldBounds.width,
391 (oldBounds.y + oldBounds.height) - overlapBottom);
393 drawSpriteRegion(spriteInfo.originalPixels, 0, overlap.y - oldBounds.y,
394 oldBounds.x, overlap.y, overlap.x - oldBounds.x,
397 const size_t overlapRight = overlap.x + overlap.width;
398 drawSpriteRegion(spriteInfo.originalPixels, overlapRight - oldBounds.x,
399 overlap.y - oldBounds.y, overlapRight, overlap.y,
400 (oldBounds.x + oldBounds.width) - overlapRight,
406 const Rect& oldBounds,
407 const Rect& newBounds,
408 const Rect& overlap) {
409 Surface<RGB_T> updatedBackground(newBounds.width, newBounds.height,
411 updatedBackground.begin();
414 captureFramebufferRegion(updatedBackground, 0, 0, newBounds.x,
415 newBounds.y, newBounds.width, newBounds.height);
416 return updatedBackground;
419 copySpriteRegion(spriteInfo.originalPixels, overlap.x - oldBounds.x,
420 overlap.y - oldBounds.y, updatedBackground,
421 overlap.x - newBounds.x, overlap.y - newBounds.y,
422 overlap.width, overlap.height);
424 captureFramebufferRegion(updatedBackground, 0, 0, newBounds.x, newBounds.y,
425 newBounds.width, overlap.y - newBounds.y);
427 const size_t overlapBottom = overlap.y + overlap.height;
428 captureFramebufferRegion(updatedBackground, 0, overlapBottom - newBounds.y,
429 newBounds.x, overlapBottom, newBounds.width,
430 (newBounds.y + newBounds.height) - overlapBottom);
432 captureFramebufferRegion(updatedBackground, 0, overlap.y - newBounds.y,
433 newBounds.x, overlap.y, overlap.x - newBounds.x,
436 const size_t overlapRight = overlap.x + overlap.width;
437 captureFramebufferRegion(updatedBackground, overlapRight - newBounds.x,
438 overlap.y - newBounds.y, overlapRight, overlap.y,
439 (newBounds.x + newBounds.width) - overlapRight,
442 return updatedBackground;
447 size_t sourceY, size_t destX, size_t destY,
448 size_t width, size_t height) {
449 for (size_t currentY = 0; currentY < height; ++currentY) {
450 for (size_t currentX = 0; currentX < width; ++currentX) {
451 const size_t framebufferX = destX + currentX;
452 const size_t framebufferY = destY + currentY;
453 if (framebufferX < surface_.width() &&
454 framebufferY < surface_.height()) {
456 framebufferX, framebufferY,
457 source.getPixel(sourceX + currentX, sourceY + currentY));
466 size_t sourceY,
Surface<RGB_T>& destination,
467 size_t destX, size_t destY, size_t width,
469 for (size_t currentY = 0; currentY < height; ++currentY) {
470 for (size_t currentX = 0; currentX < width; ++currentX) {
471 destination.setPixel(
472 destX + currentX, destY + currentY,
473 source.getPixel(sourceX + currentX, sourceY + currentY));
481 size_t destY, size_t sourceX, size_t sourceY,
482 size_t width, size_t height) {
483 for (size_t currentY = 0; currentY < height; ++currentY) {
484 for (size_t currentX = 0; currentX < width; ++currentX) {
485 const size_t framebufferX = sourceX + currentX;
486 const size_t framebufferY = sourceY + currentY;
488 framebufferX < surface_.width() && framebufferY < surface_.height()
489 ? surface_.getPixel(framebufferX, framebufferY)
491 destination.setPixel(destX + currentX, destY + currentY, color);
498 float scale,
IFont<RGB_T>& font) {
499 size_t scaledWidth =
static_cast<size_t>(source.width() * scale);
500 size_t scaledHeight =
static_cast<size_t>(source.height() * scale);
502 if (scaledWidth == 0) {
505 if (scaledHeight == 0) {
509 Surface<RGB_T> scaledSprite(scaledWidth, scaledHeight, font);
510 scaledSprite.begin();
511 for (size_t currentY = 0; currentY < scaledHeight; ++currentY) {
512 const size_t sourceY =
513 static_cast<size_t>(
static_cast<
float>(currentY) / scale);
514 const size_t clampedY =
515 sourceY < source.height() ? sourceY : source.height() - 1;
516 for (size_t currentX = 0; currentX < scaledWidth; ++currentX) {
517 const size_t sourceX =
518 static_cast<size_t>(
static_cast<
float>(currentX) / scale);
519 const size_t clampedX =
520 sourceX < source.width() ? sourceX : source.width() - 1;
521 scaledSprite.setPixel(currentX, currentY,
522 source.getPixel(clampedX, clampedY));
532 float angleDegrees, RGB_T fillColor,
533 IFont<RGB_T>& font) {
534 const float radians =
535 static_cast<
float>(angleDegrees) * 3.14159265358979323846 / 180.0;
536 const float cosine = std::cos(radians);
537 const float sine = std::sin(radians);
538 const float sourceWidth =
static_cast<
float>(source.width());
539 const float sourceHeight =
static_cast<
float>(source.height());
540 size_t rotatedWidth =
static_cast<size_t>(std::ceil(
541 std::fabs(sourceWidth * cosine) + std::fabs(sourceHeight * sine)));
542 size_t rotatedHeight =
static_cast<size_t>(std::ceil(
543 std::fabs(sourceWidth * sine) + std::fabs(sourceHeight * cosine)));
545 if (rotatedWidth == 0) {
548 if (rotatedHeight == 0) {
552 Surface<RGB_T> rotatedSprite(rotatedWidth, rotatedHeight, font);
553 rotatedSprite.begin();
554 rotatedSprite.clear(fillColor);
556 const float sourceCenterX = (sourceWidth - 1.0) / 2.0;
557 const float sourceCenterY = (sourceHeight - 1.0) / 2.0;
558 const float rotatedCenterX = (
static_cast<
float>(rotatedWidth) - 1.0) / 2.0;
559 const float rotatedCenterY =
560 (
static_cast<
float>(rotatedHeight) - 1.0) / 2.0;
562 for (size_t currentY = 0; currentY < rotatedHeight; ++currentY) {
563 for (size_t currentX = 0; currentX < rotatedWidth; ++currentX) {
564 const float targetX =
static_cast<
float>(currentX) - rotatedCenterX;
565 const float targetY =
static_cast<
float>(currentY) - rotatedCenterY;
566 const float sourceX =
567 (targetX * cosine) + (targetY * sine) + sourceCenterX;
568 const float sourceY =
569 (-targetX * sine) + (targetY * cosine) + sourceCenterY;
570 const long nearestX = std::lround(sourceX);
571 const long nearestY = std::lround(sourceY);
573 if (nearestX >= 0 && nearestY >= 0 &&
574 static_cast<size_t>(nearestX) < source.width() &&
575 static_cast<size_t>(nearestY) < source.height()) {
576 rotatedSprite.setPixel(
578 source.getPixel(
static_cast<size_t>(nearestX),
579 static_cast<size_t>(nearestY)));
584 return rotatedSprite;
589 surface_.drawSprite(spriteInfo.x, spriteInfo.y, spriteInfo.originalPixels);
595 sprites_.begin(), sprites_.end(),
596 [&spriteInfo](
const std::unique_ptr<SpriteInfo>& entry) {
597 return entry.get() == &spriteInfo;
Framebuffer with sprite placement and background restoration support.
Definition: FrameBuffer.h:21
static Surface< RGB_T > scaleSpriteImage(const ISurface< RGB_T > &source, float scale, IFont< RGB_T > &font)
Returns a scaled copy of a sprite image.
Definition: FrameBuffer.h:497
static bool isEmpty(const Rect &rect)
Returns true if the rectangle is empty (zero width or height).
Definition: FrameBuffer.h:334
IFont< RGB_T > & font()
Returns the currently set font for text rendering.
Definition: FrameBuffer.h:223
Surface< RGB_T > captureUpdatedBackground(const SpriteInfo &spriteInfo, const Rect &oldBounds, const Rect &newBounds, const Rect &overlap)
Captures the updated background pixels after a sprite move/transform.
Definition: FrameBuffer.h:405
void captureFramebufferRegion(Surface< RGB_T > &destination, size_t destX, size_t destY, size_t sourceX, size_t sourceY, size_t width, size_t height)
Definition: FrameBuffer.h:480
SurfaceT surface_
Definition: FrameBuffer.h:301
void fillRect(size_t x, size_t y, size_t w, size_t h, RGB_T color)
Fills a rectangle.
Definition: FrameBuffer.h:237
void scaleSprite(SpriteInfo &spriteInfo, float scale)
Scales a sprite image and redraws it at its current position.
Definition: FrameBuffer.h:187
void drawText(int16_t x, int16_t y, const char *text, RGB_T foreground, RGB_T background=RGB_T(), bool opaque=false, uint8_t scale=1, uint8_t spacing=1, uint8_t lineSpacing=1)
Draws UTF-8 text.
Definition: FrameBuffer.h:263
void drawLine(size_t x0, size_t y0, size_t x1, size_t y1, RGB_T color)
Draws a line between two points.
Definition: FrameBuffer.h:229
void drawSpriteRegion(const ISurface< RGB_T > &source, size_t sourceX, size_t sourceY, size_t destX, size_t destY, size_t width, size_t height)
Draws a rectangular region from a source surface onto the framebuffer.
Definition: FrameBuffer.h:446
void moveSprite(SpriteInfo &spriteInfo, size_t newX, size_t newY)
Moves a sprite to a new position and redraws it.
Definition: FrameBuffer.h:160
LinePrinter< RGB_T > & linePrinter()
Returns the line printer for text rendering.
Definition: FrameBuffer.h:271
Vector< std::unique_ptr< SpriteInfo > > sprites_
Definition: FrameBuffer.h:312
void copySprite(size_t x, size_t y, const ISurface< RGB_T > &sprite)
Copies a sprite.
Definition: FrameBuffer.h:259
void setFont(IFont< RGB_T > &font)
Sets the font for text rendering.
Definition: FrameBuffer.h:221
static size_t centeredCoordinate(size_t oldPosition, size_t oldSize, size_t newSize)
Calculates the coordinate to center a new size over an old position/size.
Definition: FrameBuffer.h:366
void end() override
Closes the framebuffer and releases resources.
Definition: FrameBuffer.h:115
static Rect intersect(const Rect &first, const Rect &second)
Returns the intersection rectangle of two rectangles.
Definition: FrameBuffer.h:315
void clear(RGB_T color=RGB_T())
Clears the framebuffer with a single color.
Definition: FrameBuffer.h:225
size_t height() const override
Returns the framebuffer height in pixels.
Definition: FrameBuffer.h:219
IFont< RGB_T > & activeFont()
Returns the currently active font used by the framebuffer.
Definition: FrameBuffer.h:311
bool setData(uint8_t *data, size_t dataSize)
Sets the framebuffer pixel data directly, replacing the current content.
Definition: FrameBuffer.h:291
void applyTransformedSprite(SpriteInfo &spriteInfo, Surface< RGB_T > &&transformedSprite)
Definition: FrameBuffer.h:340
void fillCircle(size_t x, size_t y, size_t r, RGB_T color)
Fills a circle.
Definition: FrameBuffer.h:245
bool resize(size_t w, size_t h) override
Resizes the framebuffer surface.
Definition: FrameBuffer.h:215
auto findSprite(SpriteInfo &spriteInfo)
Finds the iterator to a sprite in the internal sprite list.
Definition: FrameBuffer.h:593
const uint8_t * data() const override
Returns the raw pixel buffer as bytes.
Definition: FrameBuffer.h:286
SpriteInfo & addSprite(size_t x, size_t y, const ISurface< RGB_T > &sprite, RGB_T invisibleColor=RGB_T(0))
Adds a sprite to the framebuffer and draws it at the given position.
Definition: FrameBuffer.h:118
void clearSprite(size_t x, size_t y, ISurface< RGB_T > &sprite, RGB_T clearColor=RGB_T())
Clears a sprite.
Definition: FrameBuffer.h:254
FrameBuffer()=default
Creates an empty framebuffer.
FrameBuffer(size_t width, size_t height, IFont< RGB_T > &font)
Creates a framebuffer with the specified size and font.
Definition: FrameBuffer.h:111
void drawCircle(size_t x, size_t y, size_t r, RGB_T color)
Draws a circle outline.
Definition: FrameBuffer.h:241
void drawSprite(size_t x, size_t y, const ISurface< RGB_T > &sprite, RGB_T invisibleColor=RGB_T())
Draws a sprite.
Definition: FrameBuffer.h:249
size_t width() const override
Returns the framebuffer width in pixels.
Definition: FrameBuffer.h:217
void scroll(int dx, int dy) override
Scrolls the framebuffer content by the specified offsets.
Definition: FrameBuffer.h:227
SpriteInfo & addSprite(size_t x, size_t y, size_t maxX, size_t maxY, const ISurface< RGB_T > &sprite, RGB_T invisibleColor=RGB_T(0))
Adds a sprite with a preallocated max buffer size for transformations.
Definition: FrameBuffer.h:133
bool begin() override
Initializes the framebuffer surface.
Definition: FrameBuffer.h:114
void setPixelClipped(size_t x, size_t y, RGB_T color)
Sets a pixel with clipping.
Definition: FrameBuffer.h:277
void rotateSprite(SpriteInfo &spriteInfo, float angleDegrees)
Rotates a sprite image and redraws it at its current position.
Definition: FrameBuffer.h:197
void setPixel(size_t x, size_t y, RGB_T color) override
ISurface<RGB_T> interface delegation.
Definition: FrameBuffer.h:207
size_t size() const override
Returns the size of the buffer in bytes.
Definition: FrameBuffer.h:288
void restoreExposedPixels(const SpriteInfo &spriteInfo, const Rect &oldBounds, const Rect &overlap)
Definition: FrameBuffer.h:378
void drawRect(size_t x, size_t y, size_t w, size_t h, RGB_T color)
Draws a rectangle outline.
Definition: FrameBuffer.h:233
void removeSprite(SpriteInfo &spriteInfo)
Removes a sprite and restores the pixels behind it.
Definition: FrameBuffer.h:149
void restoreOriginalPixels(const SpriteInfo &spriteInfo)
Restores the original background pixels behind a sprite.
Definition: FrameBuffer.h:588
RGB_T getPixel(size_t x, size_t y) const override
Returns the pixel at the given position.
Definition: FrameBuffer.h:211
static void copySpriteRegion(const ISurface< RGB_T > &source, size_t sourceX, size_t sourceY, Surface< RGB_T > &destination, size_t destX, size_t destY, size_t width, size_t height)
Definition: FrameBuffer.h:465
void drawHorizontalLineClipped(int x0, int x1, int y, RGB_T color)
Draws a horizontal line with clipping.
Definition: FrameBuffer.h:281
bool isInBounds(size_t x, size_t y) const
Checks if the given coordinates are within the surface bounds.
Definition: FrameBuffer.h:273
static Surface< RGB_T > rotateSpriteImage(const ISurface< RGB_T > &source, float angleDegrees, RGB_T fillColor, IFont< RGB_T > &font)
Definition: FrameBuffer.h:531
Font rendering interface for TinyGPU-compatible framebuffers.
Definition: IFont.h:19
Helper for printing wrapped lines of text onto a TinyGPU target.
Definition: LinePrinter.h:17
RGB color stored in 16-bit RGB565 format.
Definition: RGB565.h:13
In-memory bitmap surface with basic 2D drawing and text rendering.
Definition: Surface.h:39
Simple header-only logger for TinyGPU with log levels and vararg support.
Definition: TinyGPULogger.h:24
@ INFO
General information.
Definition: TinyGPULogger.h:32
void log(Level level, const char *fmt,...)
Log a message with printf-style formatting.
Definition: TinyGPULogger.h:56
Definition: AVIWriter.h:9
Definition: FrameBuffer.h:303
size_t height
Definition: FrameBuffer.h:307
size_t width
Definition: FrameBuffer.h:306
size_t y
Definition: FrameBuffer.h:305
size_t x
Definition: FrameBuffer.h:304
Definition: FrameBuffer.h:29
size_t y
Definition: FrameBuffer.h:31
size_t maxWidth
Definition: FrameBuffer.h:32
std::unique_ptr< SurfaceT > transformedSprite
Definition: FrameBuffer.h:36
void setMaxSize(size_t maxX, size_t maxY)
Set the maximum buffer size for transformedSprite and allocate buffer.
Definition: FrameBuffer.h:64
void saveOriginalPixels(ISurface< RGB_T > &framebuffer)
Saves the background pixels currently covered by the sprite.
Definition: FrameBuffer.h:58
size_t x
Definition: FrameBuffer.h:30
IFont< RGB_T > & fontRef
Definition: FrameBuffer.h:38
SpriteInfo(size_t startX, size_t startY, const ISurface< RGB_T > &sourceSprite, RGB_T transparentColor, IFont< RGB_T > &font)
Definition: FrameBuffer.h:40
void setTransformedSprite(SurfaceT &&newSprite)
Definition: FrameBuffer.h:76
const ISurface< RGB_T > & currentSprite() const
Returns the sprite image currently used for drawing.
Definition: FrameBuffer.h:51
SurfaceT originalPixels
Definition: FrameBuffer.h:37
RGB_T invisibleColor
Definition: FrameBuffer.h:34
const ISurface< RGB_T > * sprite
Definition: FrameBuffer.h:35
size_t maxHeight
Definition: FrameBuffer.h:33