ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
jpeg_decoder.h
Go to the documentation of this file.
1#pragma once
2#include "image_decoder.h"
3#include "runtime_image.h"
6#ifdef USE_RUNTIME_IMAGE_JPEG
7#include <JPEGDEC.h>
8
10
14class JpegDecoder : public ImageDecoder {
15 public:
22 ~JpegDecoder() override {}
23
24 int HOT decode(uint8_t *buffer, size_t size) override;
25
26 bool uses_direct_rgb565() const { return this->direct_rgb565_; }
27 void draw_rgb565(int x, int y, int w, int h, const uint8_t *pixels);
28
29 protected:
30 bool prepare_rgb565_scaling_(int width, int height);
31
32 JPEGDEC jpeg_{};
37 bool direct_rgb565_{false};
38};
39
40} // namespace esphome::runtime_image
41
42#endif // USE_RUNTIME_IMAGE_JPEG
uint8_t h
Definition bl0906.h:2
Fixed-capacity vector - sized once through init() or try_init(); push_back never reallocates This avo...
Definition helpers.h:616
Class to abstract decoding different image formats.
Image decoder specialization for JPEG images.
FixedVector< uint16_t > y_boundaries_
void draw_rgb565(int x, int y, int w, int h, const uint8_t *pixels)
FixedVector< uint16_t > x_boundaries_
JpegDecoder(RuntimeImage *image)
Construct a new JPEG Decoder object.
int HOT decode(uint8_t *buffer, size_t size) override
bool prepare_rgb565_scaling_(int width, int height)
A dynamic image that can be loaded and decoded at runtime.
uint32_t buffer
Definition gif.cpp:50
uint16_t size
Definition helpers.cpp:34
uint16_t x
Definition tt21100.cpp:5
uint16_t y
Definition tt21100.cpp:6