7 namespace online_image {
9 static const char *
const TAG =
"online_image.decoder";
18 auto width = std::min(this->
image_->
buffer_width_, static_cast<int>(std::ceil((x + w) * this->x_scale_)));
19 auto height = std::min(this->
image_->
buffer_height_, static_cast<int>(std::ceil((y + h) * this->y_scale_)));
20 for (
int i = x * this->
x_scale_; i < width; i++) {
21 for (
int j = y * this->
y_scale_; j < height; j++) {
28 if (offset > this->size_) {
29 ESP_LOGE(TAG,
"Tried to access beyond download buffer bounds!!!");
32 return this->buffer_ + offset;
37 if (this->unread_ > 0) {
38 memmove(this->data(), this->data(len), this->unread_);
bool resize_(int width, int height)
void draw_pixel_(int x, int y, Color color)
Draw a pixel into the buffer.
int buffer_width_
Actual width of the current image.
int buffer_height_
Actual height of the current image.
void draw(int x, int y, int w, int h, const Color &color)
Draw a rectangle on the display_buffer using the defined color.
uint8_t * data(size_t offset=0)
void set_size(int width, int height)
Request the image to be resized once the actual dimensions are known.
Implementation of SPI Controller mode.