ESPHome  2024.12.2
Public Member Functions | Protected Member Functions | Protected Attributes
esphome::animation::Animation Class Reference

#include <animation.h>

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

Public Member Functions

 Animation (const uint8_t *data_start, int width, int height, uint32_t animation_frame_count, image::ImageType type)
 
uint32_t get_animation_frame_count () const
 
int get_current_frame () const
 
void next_frame ()
 
void prev_frame ()
 
void set_frame (int frame)
 Selects a specific frame within the animation. More...
 
void set_loop (uint32_t start_frame, uint32_t end_frame, int count)
 
- Public Member Functions inherited from esphome::image::Image
 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

void update_data_start_ ()
 
- Protected Member Functions inherited from esphome::image::Image
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

const uint8_t * animation_data_start_
 
int current_frame_
 
uint32_t animation_frame_count_
 
uint32_t loop_start_frame_
 
uint32_t loop_end_frame_
 
int loop_count_
 
int loop_current_iteration_
 
- Protected Attributes inherited from esphome::image::Image
int width_
 
int height_
 
ImageType type_
 
const uint8_t * data_start_
 
bool transparent_
 
lv_img_dsc_t dsc_ {}
 

Detailed Description

Definition at line 9 of file animation.h.

Constructor & Destructor Documentation

◆ Animation()

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

Definition at line 8 of file animation.cpp.

Member Function Documentation

◆ get_animation_frame_count()

uint32_t esphome::animation::Animation::get_animation_frame_count ( ) const

Definition at line 25 of file animation.cpp.

◆ get_current_frame()

int esphome::animation::Animation::get_current_frame ( ) const

Definition at line 26 of file animation.cpp.

◆ next_frame()

void esphome::animation::Animation::next_frame ( )

Definition at line 27 of file animation.cpp.

◆ prev_frame()

void esphome::animation::Animation::prev_frame ( )

Definition at line 41 of file animation.cpp.

◆ set_frame()

void esphome::animation::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 50 of file animation.cpp.

◆ set_loop()

void esphome::animation::Animation::set_loop ( uint32_t  start_frame,
uint32_t  end_frame,
int  count 
)

Definition at line 18 of file animation.cpp.

◆ update_data_start_()

void esphome::animation::Animation::update_data_start_ ( )
protected

Definition at line 64 of file animation.cpp.

Field Documentation

◆ animation_data_start_

const uint8_t* esphome::animation::Animation::animation_data_start_
protected

Definition at line 29 of file animation.h.

◆ animation_frame_count_

uint32_t esphome::animation::Animation::animation_frame_count_
protected

Definition at line 31 of file animation.h.

◆ current_frame_

int esphome::animation::Animation::current_frame_
protected

Definition at line 30 of file animation.h.

◆ loop_count_

int esphome::animation::Animation::loop_count_
protected

Definition at line 34 of file animation.h.

◆ loop_current_iteration_

int esphome::animation::Animation::loop_current_iteration_
protected

Definition at line 35 of file animation.h.

◆ loop_end_frame_

uint32_t esphome::animation::Animation::loop_end_frame_
protected

Definition at line 33 of file animation.h.

◆ loop_start_frame_

uint32_t esphome::animation::Animation::loop_start_frame_
protected

Definition at line 32 of file animation.h.


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