ESPHome  2024.5.4
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

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 ()
 
ImageType get_type () const
 
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
 

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_
 

Detailed Description

Definition at line 34 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 130 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.

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 82 of file image.cpp.

◆ get_data_start()

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

Definition at line 40 of file image.h.

◆ get_grayscale_pixel_()

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

Definition at line 121 of file image.cpp.

◆ get_height()

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

Implements esphome::display::BaseImage.

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

◆ get_rgb565_pixel_()

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

Definition at line 105 of file image.cpp.

◆ get_rgba_pixel_()

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

Definition at line 87 of file image.cpp.

◆ get_type()

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

Definition at line 129 of file image.cpp.

◆ get_width()

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

Implements esphome::display::BaseImage.

Definition at line 127 of file image.cpp.

◆ has_transparency()

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

Definition at line 46 of file image.h.

◆ set_transparency()

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

Definition at line 45 of file image.h.

Field Documentation

◆ data_start_

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

Definition at line 58 of file image.h.

◆ height_

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

Definition at line 56 of file image.h.

◆ transparent_

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

Definition at line 59 of file image.h.

◆ type_

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

Definition at line 57 of file image.h.

◆ width_

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

Definition at line 55 of file image.h.


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