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

◆ jd_input()

size_t fl::third_party::TJpg_Decoder::jd_input ( JDEC * jdec,
uint8_t * buf,
size_t len )
static

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

82{
83 // Retrieve instance pointer from JDEC device context
84 TJpg_Decoder *thisPtr = static_cast<TJpg_Decoder*>(jdec->device);
85
86 // Handle an array input
87 if (thisPtr->jpg_source == TJPG_ARRAY) {
88 // Avoid running off end of array
89 if (thisPtr->array_index + len > thisPtr->array_size) {
90 len = thisPtr->array_size - thisPtr->array_index;
91 }
92
93 // If buf is valid then copy len bytes to buffer
94 if (buf) fl::memcpy(buf, (const uint8_t *)(thisPtr->array_data + thisPtr->array_index), len);
95
96 // Move pointer
97 thisPtr->array_index += len;
98 }
99
100 return len;
101}
unsigned char uint8_t
Definition coder.h:209
void * memcpy(void *dest, const void *src, size_t n) FL_NOEXCEPT

References TJpg_Decoder(), array_data, array_index, array_size, FL_NOEXCEPT, jpg_source, fl::memcpy(), and fl::third_party::TJPG_ARRAY.

Referenced by drawJpg(), and getJpgSize().

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