ESPHome  2025.2.0
Public Member Functions | Protected Member Functions | Protected Attributes
esphome::image::Image Class Reference

#include <image.h>

Inheritance diagram for esphome::image::Image:
esphome::display::BaseImage esphome::animation::Animation esphome::online_image::OnlineImage

Public Member Functions

 Image (const uint8_t *data_start, int width, int height, ImageType type, Transparency transparency)
 
Color get_pixel (int x, int y, Color color_on=display::COLOR_ON, Color color_off=display::COLOR_OFF) const
 
int get_width () const override
 
int get_height () const override
 
const uint8_t * get_data_start () const
 
ImageType get_type () const
 
int get_bpp () const
 
size_t get_width_stride () const
 Return the stride of the image in bytes, that is, the distance in bytes between two consecutive rows of pixels. More...
 
void draw (int x, int y, display::Display *display, Color color_on, Color color_off) override
 
bool has_transparency () const
 
lv_img_dsc_t * get_lv_img_dsc ()
 

Protected Member Functions

bool get_binary_pixel_ (int x, int y) const
 
Color get_rgb_pixel_ (int x, int y) const
 
Color get_rgb565_pixel_ (int x, int y) const
 
Color get_grayscale_pixel_ (int x, int y) const
 

Protected Attributes

int width_
 
int height_
 
ImageType type_
 
const uint8_t * data_start_
 
Transparency transparency_
 
size_t bpp_ {}
 
size_t stride_ {}
 
lv_img_dsc_t dsc_ {}
 

Detailed Description

Definition at line 25 of file image.h.

Constructor & Destructor Documentation

◆ Image()

esphome::image::Image::Image ( const uint8_t *  data_start,
int  width,
int  height,
ImageType  type,
Transparency  transparency 
)

Definition at line 213 of file image.cpp.

Member Function Documentation

◆ draw()

void esphome::image::Image::draw ( int  x,
int  y,
display::Display display,
Color  color_on,
Color  color_off 
)
overridevirtual

Implements esphome::display::BaseImage.

Reimplemented in esphome::online_image::OnlineImage.

Definition at line 8 of file image.cpp.

◆ get_binary_pixel_()

bool esphome::image::Image::get_binary_pixel_ ( int  x,
int  y 
) const
protected

Definition at line 150 of file image.cpp.

◆ get_bpp()

int esphome::image::Image::get_bpp ( ) const
inline

Definition at line 34 of file image.h.

◆ get_data_start()

const uint8_t* esphome::image::Image::get_data_start ( ) const
inline

Definition at line 31 of file image.h.

◆ get_grayscale_pixel_()

Color esphome::image::Image::get_grayscale_pixel_ ( int  x,
int  y 
) const
protected

Definition at line 196 of file image.cpp.

◆ get_height()

int esphome::image::Image::get_height ( ) const
overridevirtual

Implements esphome::display::BaseImage.

Definition at line 211 of file image.cpp.

◆ get_lv_img_dsc()

lv_img_dsc_t * esphome::image::Image::get_lv_img_dsc ( )

Definition at line 90 of file image.cpp.

◆ get_pixel()

Color esphome::image::Image::get_pixel ( int  x,
int  y,
Color  color_on = display::COLOR_ON,
Color  color_off = display::COLOR_OFF 
) const

Definition at line 71 of file image.cpp.

◆ get_rgb565_pixel_()

Color esphome::image::Image::get_rgb565_pixel_ ( int  x,
int  y 
) const
protected

Definition at line 175 of file image.cpp.

◆ get_rgb_pixel_()

Color esphome::image::Image::get_rgb_pixel_ ( int  x,
int  y 
) const
protected

Definition at line 155 of file image.cpp.

◆ get_type()

ImageType esphome::image::Image::get_type ( ) const

Definition at line 212 of file image.cpp.

◆ get_width()

int esphome::image::Image::get_width ( ) const
overridevirtual

Implements esphome::display::BaseImage.

Definition at line 210 of file image.cpp.

◆ get_width_stride()

size_t esphome::image::Image::get_width_stride ( ) const
inline

Return the stride of the image in bytes, that is, the distance in bytes between two consecutive rows of pixels.

Definition at line 38 of file image.h.

◆ has_transparency()

bool esphome::image::Image::has_transparency ( ) const
inline

Definition at line 41 of file image.h.

Field Documentation

◆ bpp_

size_t esphome::image::Image::bpp_ {}
protected

Definition at line 57 of file image.h.

◆ data_start_

const uint8_t* esphome::image::Image::data_start_
protected

Definition at line 55 of file image.h.

◆ dsc_

lv_img_dsc_t esphome::image::Image::dsc_ {}
protected

Definition at line 60 of file image.h.

◆ height_

int esphome::image::Image::height_
protected

Definition at line 53 of file image.h.

◆ stride_

size_t esphome::image::Image::stride_ {}
protected

Definition at line 58 of file image.h.

◆ transparency_

Transparency esphome::image::Image::transparency_
protected

Definition at line 56 of file image.h.

◆ type_

ImageType esphome::image::Image::type_
protected

Definition at line 54 of file image.h.

◆ width_

int esphome::image::Image::width_
protected

Definition at line 52 of file image.h.


The documentation for this class was generated from the following files: