FastLED 3.9.15
Loading...
Searching...
No Matches

◆ jd_output()

int fl::third_party::TJpg_Decoder::jd_output ( JDEC * jdec,
void * bitmap,
JRECT * jrect )
static

Definition at line 108 of file TJpg_Decoder.cpp.hpp.

109{
110 // Retrieve instance pointer from JDEC device context
111 TJpg_Decoder *thisPtr = static_cast<TJpg_Decoder*>(jdec->device);
112
113 // Check if we have a valid thisPtr
114 if (!thisPtr) {
115 return 0; // Indicate failure
116 }
117
118 // Check if we have a callback function
119 if (!thisPtr->tft_output) {
120 return 0; // Indicate failure
121 }
122
123 // Retrieve rendering parameters and add any offset
124 int16_t x = jrect->left + thisPtr->jpeg_x;
125 int16_t y = jrect->top + thisPtr->jpeg_y;
126 uint16_t w = jrect->right + 1 - jrect->left;
127 uint16_t h = jrect->bottom + 1 - jrect->top;
128
129 // Pass the image block and rendering parameters in a callback to the sketch
130 return thisPtr->tft_output(x, y, w, h, (uint16_t*)bitmap);
131}
fl::u16 uint16_t
Definition coder.h:214
fl::i16 int16_t
Definition coder.h:215

References TJpg_Decoder(), FL_NOEXCEPT, jpeg_x, jpeg_y, tft_output, fl::x, and fl::y.

Referenced by drawJpg().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: