ESPHome 2025.9.1
Loading...
Searching...
No Matches
esp32_camera_jpeg_encoder.h
Go to the documentation of this file.
1#pragma once
2
3#ifdef USE_ESP32_CAMERA_JPEG_ENCODER
4
5#include <esp_camera.h>
6
8
10
13 public:
17 ESP32CameraJPEGEncoder(uint8_t quality, camera::EncoderBuffer *output);
20 void set_buffer_expand_size(size_t buffer_expand_size) { this->buffer_expand_size_ = buffer_expand_size; }
21 // -------- Encoder --------
24 void dump_config() override;
25 // -------------------------
26 protected:
27 static size_t callback_(void *arg, size_t index, const void *data, size_t len);
28 pixformat_t to_internal_(camera::PixelFormat format);
29
33 uint8_t quality_{};
35};
36
37} // namespace esphome::camera_encoder
38
39#endif
Interface for a generic buffer that stores image data.
Definition buffer.h:9
Interface for an encoder buffer supporting resizing and variable-length data.
Definition encoder.h:32
Interface for image encoders used in a camera pipeline.
Definition encoder.h:52
Encoder that uses the software-based JPEG implementation from Espressif's esp32-camera component.
void set_buffer_expand_size(size_t buffer_expand_size)
Sets the number of bytes to expand the output buffer on underflow during encoding.
camera::EncoderError encode_pixels(camera::CameraImageSpec *spec, camera::Buffer *pixels) override
ESP32CameraJPEGEncoder(uint8_t quality, camera::EncoderBuffer *output)
Constructs a ESP32CameraJPEGEncoder instance.
pixformat_t to_internal_(camera::PixelFormat format)
static size_t callback_(void *arg, size_t index, const void *data, size_t len)
EncoderError
Result codes from the encoder used to control camera pipeline flow.
Definition encoder.h:9
PixelFormat
Enumeration of different pixel formats.
Definition camera.h:19
std::string size_t len
Definition helpers.h:280
Specification of a caputured camera image.
Definition camera.h:69