ESPHome  2023.5.5
Public Member Functions | Protected Attributes
esphome::display::Animation Class Reference

#include <display_buffer.h>

Inheritance diagram for esphome::display::Animation:
esphome::display::Image

Public Member Functions

 Animation (const uint8_t *data_start, int width, int height, uint32_t animation_frame_count, ImageType type)
 
bool get_pixel (int x, int y) const override
 
Color get_color_pixel (int x, int y) const override
 
Color get_rgb565_pixel (int x, int y) const override
 
Color get_grayscale_pixel (int x, int y) const override
 
int get_animation_frame_count () const
 
int get_current_frame () const override
 
void next_frame ()
 
void prev_frame ()
 
void set_frame (int frame)
 Selects a specific frame within the animation. More...
 
- Public Member Functions inherited from esphome::display::Image
 Image (const uint8_t *data_start, int width, int height, ImageType type)
 
int get_width () const
 
int get_height () const
 
ImageType get_type () const
 

Protected Attributes

int current_frame_
 
int animation_frame_count_
 
- Protected Attributes inherited from esphome::display::Image
int width_
 
int height_
 
ImageType type_
 
const uint8_t * data_start_
 

Detailed Description

Definition at line 558 of file display_buffer.h.

Constructor & Destructor Documentation

◆ Animation()

esphome::display::Animation::Animation ( const uint8_t *  data_start,
int  width,
int  height,
uint32_t  animation_frame_count,
ImageType  type 
)

Definition at line 712 of file display_buffer.cpp.

Member Function Documentation

◆ get_animation_frame_count()

int esphome::display::Animation::get_animation_frame_count ( ) const

Definition at line 714 of file display_buffer.cpp.

◆ get_color_pixel()

Color esphome::display::Animation::get_color_pixel ( int  x,
int  y 
) const
overridevirtual

Reimplemented from esphome::display::Image.

Definition at line 676 of file display_buffer.cpp.

◆ get_current_frame()

int esphome::display::Animation::get_current_frame ( ) const
overridevirtual

Reimplemented from esphome::display::Image.

Definition at line 715 of file display_buffer.cpp.

◆ get_grayscale_pixel()

Color esphome::display::Animation::get_grayscale_pixel ( int  x,
int  y 
) const
overridevirtual

Reimplemented from esphome::display::Image.

Definition at line 702 of file display_buffer.cpp.

◆ get_pixel()

bool esphome::display::Animation::get_pixel ( int  x,
int  y 
) const
overridevirtual

Reimplemented from esphome::display::Image.

Definition at line 666 of file display_buffer.cpp.

◆ get_rgb565_pixel()

Color esphome::display::Animation::get_rgb565_pixel ( int  x,
int  y 
) const
overridevirtual

Reimplemented from esphome::display::Image.

Definition at line 688 of file display_buffer.cpp.

◆ next_frame()

void esphome::display::Animation::next_frame ( )

Definition at line 716 of file display_buffer.cpp.

◆ prev_frame()

void esphome::display::Animation::prev_frame ( )

Definition at line 722 of file display_buffer.cpp.

◆ set_frame()

void esphome::display::Animation::set_frame ( int  frame)

Selects a specific frame within the animation.

Parameters
frameIf possitive, advance to the frame. If negative, recede to that frame from the end frame.

Definition at line 729 of file display_buffer.cpp.

Field Documentation

◆ animation_frame_count_

int esphome::display::Animation::animation_frame_count_
protected

Definition at line 579 of file display_buffer.h.

◆ current_frame_

int esphome::display::Animation::current_frame_
protected

Definition at line 578 of file display_buffer.h.


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