ESP32-P4 hardware JPEG encoder with one output buffer: one encoded frame at a time.
More...
#include <jpeg_encoder.h>
|
| | JpegEncoder (jpeg_enc_input_format_t input_format, jpeg_down_sampling_type_t sub_sample, uint8_t quality) |
| |
| bool | init (uint16_t width, uint16_t height, size_t frame_size) |
| | Allocates the encoder engine and its output buffer.
|
| |
| size_t | encode (const uint8_t *frame, size_t frame_length) |
| | Encodes one frame into the internal output buffer.
|
| |
| uint8_t * | get_output_buffer () const |
| | Returns the buffer holding the most recently encoded image.
|
| |
| uint8_t | get_quality () const |
| |
ESP32-P4 hardware JPEG encoder with one output buffer: one encoded frame at a time.
Definition at line 12 of file jpeg_encoder.h.
◆ JpegEncoder()
| esphome::mipi_csi::JpegEncoder::JpegEncoder |
( |
jpeg_enc_input_format_t | input_format, |
|
|
jpeg_down_sampling_type_t | sub_sample, |
|
|
uint8_t | quality ) |
|
inline |
- Parameters
-
| input_format | Pixel layout of the frames that will be passed to encode(). |
| sub_sample | Chroma subsampling to use for the encoded image. |
| quality | JPEG quality, 1 (smallest) to 100 (best). |
Definition at line 17 of file jpeg_encoder.h.
◆ encode()
| size_t esphome::mipi_csi::JpegEncoder::encode |
( |
const uint8_t * | frame, |
|
|
size_t | frame_length ) |
Encodes one frame into the internal output buffer.
- Parameters
-
| frame | Raw pixel data in the configured input format. |
| frame_length | Length of frame in bytes. |
- Returns
- Number of JPEG bytes written to the output buffer, or 0 on failure.
Definition at line 36 of file jpeg_encoder.cpp.
◆ get_output_buffer()
| uint8_t * esphome::mipi_csi::JpegEncoder::get_output_buffer |
( |
| ) |
const |
|
inline |
Returns the buffer holding the most recently encoded image.
Definition at line 37 of file jpeg_encoder.h.
◆ get_quality()
| uint8_t esphome::mipi_csi::JpegEncoder::get_quality |
( |
| ) |
const |
|
inline |
◆ init()
| bool esphome::mipi_csi::JpegEncoder::init |
( |
uint16_t | width, |
|
|
uint16_t | height, |
|
|
size_t | frame_size ) |
Allocates the encoder engine and its output buffer.
- Parameters
-
| width | Frame width in pixels. |
| height | Frame height in pixels. |
| frame_size | Size in bytes of one raw frame. |
- Returns
- true when the encoder is ready for use.
Definition at line 14 of file jpeg_encoder.cpp.
◆ config_
| jpeg_encode_cfg_t esphome::mipi_csi::JpegEncoder::config_ {} |
|
protected |
◆ engine_
| jpeg_encoder_handle_t esphome::mipi_csi::JpegEncoder::engine_ {nullptr} |
|
protected |
◆ output_
| uint8_t* esphome::mipi_csi::JpegEncoder::output_ {nullptr} |
|
protected |
◆ output_size_
| size_t esphome::mipi_csi::JpegEncoder::output_size_ {0} |
|
protected |
The documentation for this class was generated from the following files: