ESPHome  2024.11.1
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)
 
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
 
uint32_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
 
void set_transparency (bool transparent)
 
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_rgb24_pixel_ (int x, int y) const
 
Color get_rgba_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_
 
bool transparent_
 
lv_img_dsc_t dsc_ {}
 

Detailed Description

Definition at line 20 of file image.h.

Constructor & Destructor Documentation

◆ Image()

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

Definition at line 174 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 126 of file image.cpp.

◆ get_bpp()

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

Definition at line 29 of file image.h.

◆ get_data_start()

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

Definition at line 26 of file image.h.

◆ get_grayscale_pixel_()

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

Definition at line 165 of file image.cpp.

◆ get_height()

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

Implements esphome::display::BaseImage.

Definition at line 172 of file image.cpp.

◆ get_lv_img_dsc()

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

Definition at line 83 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 64 of file image.cpp.

◆ get_rgb24_pixel_()

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

Definition at line 136 of file image.cpp.

◆ get_rgb565_pixel_()

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

Definition at line 149 of file image.cpp.

◆ get_rgba_pixel_()

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

Definition at line 131 of file image.cpp.

◆ get_type()

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

Definition at line 173 of file image.cpp.

◆ get_width()

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

Implements esphome::display::BaseImage.

Definition at line 171 of file image.cpp.

◆ get_width_stride()

uint32_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 47 of file image.h.

◆ has_transparency()

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

Definition at line 51 of file image.h.

◆ set_transparency()

void esphome::image::Image::set_transparency ( bool  transparent)
inline

Definition at line 50 of file image.h.

Field Documentation

◆ data_start_

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

Definition at line 66 of file image.h.

◆ dsc_

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

Definition at line 69 of file image.h.

◆ height_

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

Definition at line 64 of file image.h.

◆ transparent_

bool esphome::image::Image::transparent_
protected

Definition at line 67 of file image.h.

◆ type_

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

Definition at line 65 of file image.h.

◆ width_

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

Definition at line 63 of file image.h.


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