FastLED 3.9.15
Loading...
Searching...
No Matches
TJpg_Decoder.h
Go to the documentation of this file.
1/*
2TJpg_Decoder.h
3
4JPEG Decoder for Arduino using TJpgDec:
5http://elm-chan.org/fsw/tjpgd/00index.html
6
7Incorporated into an Arduino library by Bodmer 18/10/19
8
9Latest version here:
10https://github.com/Bodmer/TJpg_Decoder
11*/
12
13#ifndef TJpg_Decoder_H
14 #define TJpg_Decoder_H
15
16 #include "User_Config.h"
17 #include "tjpgd.h"
18 #include "fl/stl/stdint.h"
19 #include "fl/stl/string.h"
20 #include "fl/stl/noexcept.h"
21
22namespace fl {
23namespace third_party {
24
25enum {
27};
28
29//------------------------------------------------------------------------------
30
31typedef bool (*SketchCallback)(int16_t x, int16_t y, uint16_t w, uint16_t h, uint16_t *data);
32
34
35public:
36
39
40 static int jd_output(JDEC* jdec, void* bitmap, JRECT* jrect) FL_NOEXCEPT;
41 static size_t jd_input(JDEC* jdec, uint8_t* buf, size_t len) FL_NOEXCEPT;
42
44 void setCallback(SketchCallback sketchCallback) FL_NOEXCEPT;
45
48
49 void setSwapBytes(bool swap) FL_NOEXCEPT;
50
51 bool _swap = false;
52
53 const uint8_t* array_data = nullptr;
54 size_t array_index = 0;
55 size_t array_size = 0;
56
57 // Must align workspace to a 32 bit boundary
58 uint8_t workspace[TJPGD_WORKSPACE_SIZE] __attribute__((aligned(4)));
59
61
64
66
68};
69
70} // namespace third_party
71} // namespace fl
72
73#endif // TJpg_Decoder_H
fl::UISlider scale("Scale", 4,.1, 4,.1)
A fixed-size array implementation similar to std::array.
Definition array.h:27
static int jd_output(JDEC *jdec, void *bitmap, JRECT *jrect) FL_NOEXCEPT
void setJpgScale(uint8_t scale) FL_NOEXCEPT
void setSwapBytes(bool swap) FL_NOEXCEPT
void setCallback(SketchCallback sketchCallback) FL_NOEXCEPT
JRESULT getJpgSize(uint16_t *w, uint16_t *h, const uint8_t array[], size_t array_size) FL_NOEXCEPT
JRESULT drawJpg(int32_t x, int32_t y, const uint8_t array[], size_t array_size) FL_NOEXCEPT
uint8_t workspace[TJPGD_WORKSPACE_SIZE]
static size_t jd_input(JDEC *jdec, uint8_t *buf, size_t len) FL_NOEXCEPT
fl::u16 uint16_t
Definition coder.h:214
bool(* SketchCallback)(int16_t x, int16_t y, uint16_t w, uint16_t h, uint16_t *data)
fl::i16 int16_t
Definition coder.h:215
fl::i32 int32_t
Definition coder.h:220
unsigned char uint8_t
Definition coder.h:209
void swap(array< T, N > &lhs, array< T, N > &rhs) FL_NOEXCEPT
Definition array.h:209
Base definition for an LED controller.
Definition crgb.hpp:179
#define FL_NOEXCEPT
#define TJPGD_WORKSPACE_SIZE
Definition tjpgdcnf.h:39