From b40317ceb3183d7cb47eb97adeb4bb4bb5cfb3e2 Mon Sep 17 00:00:00 2001 From: tobi807 Date: Wed, 17 Jul 2024 11:44:18 +0200 Subject: [PATCH 01/10] Update Panel_RA8875.cpp (#589) fix for using the lib with Adafruit RA8875 Board --- src/lgfx/v1/panel/Panel_RA8875.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lgfx/v1/panel/Panel_RA8875.cpp b/src/lgfx/v1/panel/Panel_RA8875.cpp index e29bc86c..52ec44bb 100644 --- a/src/lgfx/v1/panel/Panel_RA8875.cpp +++ b/src/lgfx/v1/panel/Panel_RA8875.cpp @@ -50,6 +50,8 @@ namespace lgfx 0x1e , 1, 0x06, //VSTR1 //VSYNC Start Position[8] //VSYNC Start Position(PCLK) = (VSTR + 1) 0x1f , 1, 0x01, //VPWR //VSYNC Polarity ,VSYNC Pulse Width[6:0] //VSYNC Pulse Width(PCLK) = (VPWR + 1) + 0xc7 , 1, 0x01, // set Extra General Purpose IO Register to Output (used to enable Display by Adafruit) + 0x8a , 1, 0x80, //PWM setting 0x8a , 1, 0x81, //PWM setting //open PWM 0x8b , 1, 0x7F, //Backlight brightness setting //Brightness parameter 0xff-0x00 From d16721c7caeb4b6516d1e681cc7d2871d2f11ca8 Mon Sep 17 00:00:00 2001 From: lovyan03 <42724151+lovyan03@users.noreply.github.com> Date: Thu, 25 Jul 2024 15:00:35 +0900 Subject: [PATCH 02/10] add createFromBmpFile ( path only version ) --- src/lgfx/v1/LGFX_Sprite.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lgfx/v1/LGFX_Sprite.hpp b/src/lgfx/v1/LGFX_Sprite.hpp index 58210b58..44f3ebcb 100644 --- a/src/lgfx/v1/LGFX_Sprite.hpp +++ b/src/lgfx/v1/LGFX_Sprite.hpp @@ -201,6 +201,12 @@ namespace lgfx return createFromBmp(&data); } + bool createFromBmpFile(const char *path) + { + auto data = _create_data_wrapper(); + return create_from_bmp_file(data, path); + } + template bool createFromBmpFile(T &fs, const char *path) { From 5e32d5756b9ebb097cb02b827f763ffc39654c92 Mon Sep 17 00:00:00 2001 From: lovyan03 <42724151+lovyan03@users.noreply.github.com> Date: Thu, 25 Jul 2024 15:02:03 +0900 Subject: [PATCH 03/10] fix Linux FB . --- src/lgfx/v1/platforms/common.hpp | 6 +++--- src/lgfx/v1/platforms/device.hpp | 2 +- src/lgfx/v1/platforms/framebuffer/Panel_fb.cpp | 6 +----- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/lgfx/v1/platforms/common.hpp b/src/lgfx/v1/platforms/common.hpp index 4789dd69..edd5d5e0 100644 --- a/src/lgfx/v1/platforms/common.hpp +++ b/src/lgfx/v1/platforms/common.hpp @@ -49,15 +49,15 @@ Original Source: #include "arduino_default/common.hpp" -#elif __has_include() || __has_include() +#elif (__has_include() || __has_include()) && !defined(LGFX_LINUX_FB) #include "sdl/common.hpp" -#elif __has_include() +#elif __has_include() && !defined(LGFX_LINUX_FB) #include "opencv/common.hpp" -#elif defined (__linux__) +#elif defined (__linux__) && defined(LGFX_LINUX_FB) #include "framebuffer/common.hpp" diff --git a/src/lgfx/v1/platforms/device.hpp b/src/lgfx/v1/platforms/device.hpp index 961cadbf..409cadf5 100644 --- a/src/lgfx/v1/platforms/device.hpp +++ b/src/lgfx/v1/platforms/device.hpp @@ -94,7 +94,7 @@ Original Source: #include "arduino_default/Bus_SPI.hpp" -#elif __has_include() || __has_include() +#elif (__has_include() || __has_include()) && !defined(LGFX_LINUX_FB) #include "sdl/Bus_I2C.hpp" #include "sdl/Panel_sdl.hpp" diff --git a/src/lgfx/v1/platforms/framebuffer/Panel_fb.cpp b/src/lgfx/v1/platforms/framebuffer/Panel_fb.cpp index 48f44162..3b02f25b 100644 --- a/src/lgfx/v1/platforms/framebuffer/Panel_fb.cpp +++ b/src/lgfx/v1/platforms/framebuffer/Panel_fb.cpp @@ -89,15 +89,11 @@ namespace lgfx { // unmap fb file from memory munmap(_fbp, _screensize); - // reset the display mode - if (ioctl(_fbfd, FBIOPUT_VSCREENINFO, &_fix_info)) { - printf("Error re-setting variable information.\n"); - } // close fb file close(_fbfd); memset(&_fix_info, 0, sizeof(_fix_info)); - memset(&_var_info, 0, sizeof(_fix_info)); + memset(&_var_info, 0, sizeof(_var_info)); } Panel_fb::Panel_fb(void) : Panel_Device(), _fbp(nullptr) From f38076b07bb38ce8d785a9e53175bce1bbe07360 Mon Sep 17 00:00:00 2001 From: lovyan03 <42724151+lovyan03@users.noreply.github.com> Date: Thu, 25 Jul 2024 15:03:26 +0900 Subject: [PATCH 04/10] Fixed the problem that the operation of TwoWire suddenly became strange when using it together with Arduino TwoWire on ESP32S3 --- src/lgfx/v1/platforms/esp32/Bus_SPI.cpp | 2 +- src/lgfx/v1/platforms/esp32/common.cpp | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/lgfx/v1/platforms/esp32/Bus_SPI.cpp b/src/lgfx/v1/platforms/esp32/Bus_SPI.cpp index 4d3368c0..2aa114b9 100644 --- a/src/lgfx/v1/platforms/esp32/Bus_SPI.cpp +++ b/src/lgfx/v1/platforms/esp32/Bus_SPI.cpp @@ -22,7 +22,7 @@ Original Source: /// ESP32-S3をターゲットにした際にREG_SPI_BASEが定義されていなかったので応急処置 ; #if defined ( CONFIG_IDF_TARGET_ESP32S3 ) - #if ( ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 3, 0) ) + #if !defined( REG_SPI_BASE ) #define REG_SPI_BASE(i) (DR_REG_SPI1_BASE + (((i)>1) ? (((i)* 0x1000) + 0x20000) : (((~(i)) & 1)* 0x1000 ))) #endif #elif defined ( CONFIG_IDF_TARGET_ESP32 ) || !defined ( CONFIG_IDF_TARGET ) diff --git a/src/lgfx/v1/platforms/esp32/common.cpp b/src/lgfx/v1/platforms/esp32/common.cpp index 1a46efab..81b384a1 100644 --- a/src/lgfx/v1/platforms/esp32/common.cpp +++ b/src/lgfx/v1/platforms/esp32/common.cpp @@ -775,6 +775,7 @@ namespace lgfx if (fifo_reg == ®[i]) { continue; } reg[i] = _reg_store[i]; } + updateDev(dev); } void setPins(i2c_dev_t* dev, gpio_num_t scl, gpio_num_t sda) @@ -862,10 +863,6 @@ namespace lgfx gpio_set_direction(scl_io, GPIO_MODE_OUTPUT_OD); delayMicroseconds(I2C_CLR_BUS_HALF_PERIOD_US); - auto mod = getPeriphModule(i2c_port); - // ESP-IDF環境でperiph_module_disableを使うと、後でenableできなくなる問題が起きたためコメントアウト; - //periph_module_disable(mod); - // SDAがHIGHになるまでSTOP送出を繰り返す。; int i = 0; do @@ -879,9 +876,10 @@ namespace lgfx gpio_set_level(sda_io, 1); delayMicroseconds(I2C_CLR_BUS_HALF_PERIOD_US); } while (!gpio_get_level(sda_io) && (i++ < I2C_CLR_BUS_SCL_NUM)); - periph_module_enable(mod); + #if !defined (CONFIG_IDF_TARGET_ESP32C3) /// ESP32C3で periph_module_reset を使用すると以後通信不能になる問題が起きたため分岐; + auto mod = getPeriphModule(i2c_port); periph_module_reset(mod); #endif i2c_set_pin((i2c_port_t)i2c_port, sda_io, scl_io, gpio_pullup_t::GPIO_PULLUP_ENABLE, gpio_pullup_t::GPIO_PULLUP_ENABLE, I2C_MODE_MASTER); @@ -1005,6 +1003,9 @@ namespace lgfx #endif #endif #endif +#else + auto mod = getPeriphModule(i2c_port); + periph_module_disable(mod); #endif if ((int)i2c_context[i2c_port].pin_scl >= 0) { @@ -1074,6 +1075,9 @@ namespace lgfx #else twowire->begin((int)i2c_context[i2c_port].pin_sda, (int)i2c_context[i2c_port].pin_scl); #endif +#else + auto mod = getPeriphModule(i2c_port); + periph_module_enable(mod); #endif i2c_context[i2c_port].initialized = true; From 48e87f6e5d1ea4094eff1f641214f216d681291e Mon Sep 17 00:00:00 2001 From: lovyan03 <42724151+lovyan03@users.noreply.github.com> Date: Thu, 25 Jul 2024 15:52:31 +0900 Subject: [PATCH 05/10] add support SSD1963 PWM backlight control. ( #586 ) --- src/lgfx/v1/panel/Panel_SSD1963.cpp | 9 +++++++++ src/lgfx/v1/panel/Panel_SSD1963.hpp | 2 ++ 2 files changed, 11 insertions(+) diff --git a/src/lgfx/v1/panel/Panel_SSD1963.cpp b/src/lgfx/v1/panel/Panel_SSD1963.cpp index 835ff3f5..c24ca5fe 100644 --- a/src/lgfx/v1/panel/Panel_SSD1963.cpp +++ b/src/lgfx/v1/panel/Panel_SSD1963.cpp @@ -142,6 +142,15 @@ namespace lgfx return true; } + void Panel_SSD1963::setBrightness(uint8_t brightness) + { + if (_light) { Panel_LCD::setBrightness(brightness); } + else { + uint8_t cmd[] = { 0xBE, 6, 0x05, brightness, 0x01, 0xFF, 0x00, 0x00, 0xFF, 0xFF }; + command_list(cmd); + } + } + color_depth_t Panel_SSD1963::setColorDepth(color_depth_t depth) { uint8_t mode = 0x00; diff --git a/src/lgfx/v1/panel/Panel_SSD1963.hpp b/src/lgfx/v1/panel/Panel_SSD1963.hpp index 2d426f15..80b4a047 100644 --- a/src/lgfx/v1/panel/Panel_SSD1963.hpp +++ b/src/lgfx/v1/panel/Panel_SSD1963.hpp @@ -66,6 +66,8 @@ namespace lgfx _read_depth = rgb565_2Byte; } + void setBrightness(uint8_t brightness) override; + void setHSync(uint_fast16_t front, uint_fast16_t sync, uint_fast16_t back, uint_fast16_t move = 0, uint_fast16_t lpspp = 0); void setVSync(uint_fast16_t front, uint_fast16_t sync, uint_fast16_t back, uint_fast16_t move = 0); From aaa94e28e20f8dd148a7d51640c9c669bd1b072d Mon Sep 17 00:00:00 2001 From: tobozo Date: Fri, 26 Jul 2024 08:09:57 +0200 Subject: [PATCH 06/10] Fix esp-idf v5.3 compilation error with ESP32C6 (#595) * Fix esp-idf 5.3 compilation error with ESP32C6 --- src/lgfx/v1/platforms/esp32/common.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lgfx/v1/platforms/esp32/common.cpp b/src/lgfx/v1/platforms/esp32/common.cpp index 81b384a1..ffd53fe7 100644 --- a/src/lgfx/v1/platforms/esp32/common.cpp +++ b/src/lgfx/v1/platforms/esp32/common.cpp @@ -36,7 +36,10 @@ Original Source: #include #include #if (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 0)) - #include + //#include + #if __has_include() + #include + #endif #else #if __has_include () #include @@ -669,7 +672,7 @@ namespace lgfx static i2c_dev_t* getDev(int num) { -#if SOC_I2C_NUM == 1 +#if SOC_I2C_NUM == 1 || defined CONFIG_IDF_TARGET_ESP32C6 return &I2C0; #else return num == 0 ? &I2C0 : &I2C1; From 59078497df2edf8b64694fec409a6f060c7633cb Mon Sep 17 00:00:00 2001 From: Tyler Camp Date: Sat, 3 Aug 2024 13:30:54 -0400 Subject: [PATCH 07/10] Add missing 'start/endWrite' calls for SSD1963 brightness (#599) --- src/lgfx/v1/panel/Panel_SSD1963.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lgfx/v1/panel/Panel_SSD1963.cpp b/src/lgfx/v1/panel/Panel_SSD1963.cpp index c24ca5fe..44b5d768 100644 --- a/src/lgfx/v1/panel/Panel_SSD1963.cpp +++ b/src/lgfx/v1/panel/Panel_SSD1963.cpp @@ -146,8 +146,10 @@ namespace lgfx { if (_light) { Panel_LCD::setBrightness(brightness); } else { + startWrite(); uint8_t cmd[] = { 0xBE, 6, 0x05, brightness, 0x01, 0xFF, 0x00, 0x00, 0xFF, 0xFF }; command_list(cmd); + endWrite(); } } From 043f1147858a51703a383007a96b24ed0aabe771 Mon Sep 17 00:00:00 2001 From: tobozo Date: Wed, 7 Aug 2024 15:48:37 +0200 Subject: [PATCH 08/10] Fix for fillGradientRect/VLINEAR ignoring y-coords fixes #601 --- src/lgfx/v1/LGFXBase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lgfx/v1/LGFXBase.cpp b/src/lgfx/v1/LGFXBase.cpp index 2b3a7d73..a415cef7 100644 --- a/src/lgfx/v1/LGFXBase.cpp +++ b/src/lgfx/v1/LGFXBase.cpp @@ -1125,7 +1125,7 @@ namespace lgfx for( int ys=0;ys Date: Mon, 12 Aug 2024 10:37:34 +0900 Subject: [PATCH 09/10] add pushImageARGB function ( for argb8888_t* / bgra8888_t* ) --- src/lgfx/v1/LGFXBase.cpp | 8 ++++---- src/lgfx/v1/LGFXBase.hpp | 28 ++++++++++++++++++++++++++++ src/lgfx/v1/misc/common_function.cpp | 8 +++++++- src/lgfx/v1/misc/pixelcopy.hpp | 6 +++--- 4 files changed, 42 insertions(+), 8 deletions(-) diff --git a/src/lgfx/v1/LGFXBase.cpp b/src/lgfx/v1/LGFXBase.cpp index a415cef7..2f132e07 100644 --- a/src/lgfx/v1/LGFXBase.cpp +++ b/src/lgfx/v1/LGFXBase.cpp @@ -1510,15 +1510,15 @@ namespace lgfx else if (pc_post.dst_bits > 16) { if (dst_depth == rgb888_3Byte) { - pc_post.fp_copy = pixelcopy_t::blend_rgb_fast; + pc_post.fp_copy = pixelcopy_t::blend_rgb_fast; } else { - pc_post.fp_copy = pixelcopy_t::blend_rgb_fast; + pc_post.fp_copy = pixelcopy_t::blend_rgb_fast; } } else { if (dst_depth == rgb565_2Byte) { - pc_post.fp_copy = pixelcopy_t::blend_rgb_fast; + pc_post.fp_copy = pixelcopy_t::blend_rgb_fast; } else { // src_depth == rgb332_1Byte: - pc_post.fp_copy = pixelcopy_t::blend_rgb_fast; + pc_post.fp_copy = pixelcopy_t::blend_rgb_fast; } } push_image_affine_aa(matrix, pc, &pc_post); diff --git a/src/lgfx/v1/LGFXBase.hpp b/src/lgfx/v1/LGFXBase.hpp index 979fec89..ec96117e 100644 --- a/src/lgfx/v1/LGFXBase.hpp +++ b/src/lgfx/v1/LGFXBase.hpp @@ -564,6 +564,34 @@ namespace lgfx LGFX_INLINE_T void pushGrayscaleImageRotateZoom(float dst_x, float dst_y, float src_x, float src_y, float angle, float zoom_x, float zoom_y, int32_t w, int32_t h, const uint8_t* image, color_depth_t depth, const T& forecolor, const T& backcolor) { push_grayimage_rotate_zoom(dst_x, dst_y, src_x, src_y, angle, zoom_x, zoom_y, w, h, image, depth, convert_to_rgb888(forecolor), convert_to_rgb888(backcolor)); } LGFX_INLINE_T void pushGrayscaleImageAffine(const float matrix[6], int32_t w, int32_t h, const uint8_t* image, color_depth_t depth, const T& forecolor, const T& backcolor) { push_grayimage_affine(matrix, w, h, image, depth, convert_to_rgb888(forecolor), convert_to_rgb888(backcolor)); } +//---------------------------------------------------------------------------- + + // T == bgra8888_t or argb8888_t + template + void pushImageARGB(int32_t x, int32_t y, int32_t w, int32_t h, const T* data) + { + auto pc = create_pc(data); + if (pc.dst_bits > 16) { + if (pc.dst_depth == rgb888_3Byte) { + pc.fp_copy = pixelcopy_t::blend_rgb_fast; + } else { + pc.fp_copy = pixelcopy_t::blend_rgb_fast; + } + } else { + if (pc.dst_depth == rgb565_2Byte) { + pc.fp_copy = pixelcopy_t::blend_rgb_fast; + } else { // src_depth == rgb332_1Byte: + pc.fp_copy = pixelcopy_t::blend_rgb_fast; + } + } + pc.src_bitwidth = w; + pc.src_width = w; + pc.src_height = h; + startWrite(); + _panel->writeImageARGB(x, y, w, h, &pc); + endWrite(); + } + //---------------------------------------------------------------------------- /// read RGB565 16bit color diff --git a/src/lgfx/v1/misc/common_function.cpp b/src/lgfx/v1/misc/common_function.cpp index 6ef28f4d..ffd264b7 100644 --- a/src/lgfx/v1/misc/common_function.cpp +++ b/src/lgfx/v1/misc/common_function.cpp @@ -11,7 +11,13 @@ namespace lgfx void memset_multi(uint8_t* buf, uint32_t c, size_t size, size_t length) { - if (size == 1 || ((c & 0xFF) == ((c >> 8) & 0xFF) && (size == 2 || ((c & 0xFF) == ((c >> 16) & 0xFF))))) + if (size == 1 + || ( (c & 0xFF) == ((c >> 8) & 0xFF) + && ( size == 2 + || ( (c & 0xFF) == ((c >> 16) & 0xFF) + && ( size == 3 + || ( (c & 0xFF) == ((c >> 24) & 0xFF) + )))))) { memset(buf, c, size * length); return; diff --git a/src/lgfx/v1/misc/pixelcopy.hpp b/src/lgfx/v1/misc/pixelcopy.hpp index 6a4147ee..fa7a46fa 100644 --- a/src/lgfx/v1/misc/pixelcopy.hpp +++ b/src/lgfx/v1/misc/pixelcopy.hpp @@ -449,13 +449,13 @@ namespace lgfx return last; } - template + template static uint32_t blend_rgb_fast(void* __restrict dst, uint32_t index, uint32_t last, pixelcopy_t* __restrict param) { auto d = static_cast(dst); auto src_x32_add = param->src_x32_add; auto src_y32_add = param->src_y32_add; - auto s = static_cast(param->src_data); + auto s = static_cast(param->src_data); for (;;) { uint32_t i = param->src_x + param->src_y * param->src_bitwidth; uint_fast16_t a = s[i].a; @@ -463,7 +463,7 @@ namespace lgfx { if (a == 255) { - d[index].set(s[i].r, s[i].g, s[i].b); + d[index].set(s[i].R8(), s[i].G8(), s[i].B8()); param->src_x32 += src_x32_add; param->src_y32 += src_y32_add; if (++index == last) return last; From b25548496672c396cc78be762faaa36a44aa0e57 Mon Sep 17 00:00:00 2001 From: lovyan03 <42724151+lovyan03@users.noreply.github.com> Date: Mon, 12 Aug 2024 17:16:50 +0900 Subject: [PATCH 10/10] rename pushImageARGB to pushAlphaImage --- src/lgfx/v1/LGFXBase.cpp | 21 +++++++++++++++++++++ src/lgfx/v1/LGFXBase.hpp | 15 ++++++++------- src/lgfx/v1/panel/Panel_Device.cpp | 24 ++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 7 deletions(-) diff --git a/src/lgfx/v1/LGFXBase.cpp b/src/lgfx/v1/LGFXBase.cpp index 2f132e07..ac616615 100644 --- a/src/lgfx/v1/LGFXBase.cpp +++ b/src/lgfx/v1/LGFXBase.cpp @@ -1441,6 +1441,27 @@ namespace lgfx endWrite(); } + void LGFXBase::pushAlphaImage(int32_t x, int32_t y, int32_t w, int32_t h, pixelcopy_t *param) + { + uint32_t x_mask = 7 >> (param->src_bits >> 1); + param->src_bitwidth = (w + x_mask) & (~x_mask); + + int32_t dx=0, dw=w; + if (0 < _clip_l - x) { dx = _clip_l - x; dw -= dx; x = _clip_l; } + + if (_adjust_width(x, dx, dw, _clip_l, _clip_r - _clip_l + 1)) return; + param->src_x32 = param->src_x32_add * dx; + + int32_t dy=0, dh=h; + if (0 < _clip_t - y) { dy = _clip_t - y; dh -= dy; y = _clip_t; } + if (_adjust_width(y, dy, dh, _clip_t, _clip_b - _clip_t + 1)) return; + param->src_y = dy; + + startWrite(); + _panel->writeImageARGB(x, y, dw, dh, param); + endWrite(); + } + void LGFXBase::make_rotation_matrix(float* result, float dst_x, float dst_y, float src_x, float src_y, float angle, float zoom_x, float zoom_y) { float rad = fmodf(angle, 360) * deg_to_rad; diff --git a/src/lgfx/v1/LGFXBase.hpp b/src/lgfx/v1/LGFXBase.hpp index ec96117e..a20369e0 100644 --- a/src/lgfx/v1/LGFXBase.hpp +++ b/src/lgfx/v1/LGFXBase.hpp @@ -568,9 +568,13 @@ namespace lgfx // T == bgra8888_t or argb8888_t template - void pushImageARGB(int32_t x, int32_t y, int32_t w, int32_t h, const T* data) + void pushAlphaImage(int32_t x, int32_t y, int32_t w, int32_t h, const T* data) { auto pc = create_pc(data); + + // not support 1, 2, 4, and palette mode. + if (pc.dst_bits < 8 || this->hasPalette()) { return; } + if (pc.dst_bits > 16) { if (pc.dst_depth == rgb888_3Byte) { pc.fp_copy = pixelcopy_t::blend_rgb_fast; @@ -584,14 +588,11 @@ namespace lgfx pc.fp_copy = pixelcopy_t::blend_rgb_fast; } } - pc.src_bitwidth = w; - pc.src_width = w; - pc.src_height = h; - startWrite(); - _panel->writeImageARGB(x, y, w, h, &pc); - endWrite(); + pushAlphaImage(x, y, w, h, &pc); } + void pushAlphaImage(int32_t x, int32_t y, int32_t w, int32_t h, pixelcopy_t *param); + //---------------------------------------------------------------------------- /// read RGB565 16bit color diff --git a/src/lgfx/v1/panel/Panel_Device.cpp b/src/lgfx/v1/panel/Panel_Device.cpp index f8c7c6b9..f876716d 100644 --- a/src/lgfx/v1/panel/Panel_Device.cpp +++ b/src/lgfx/v1/panel/Panel_Device.cpp @@ -178,7 +178,30 @@ namespace lgfx } //---------------------------------------------------------------------------- + void Panel_Device::writeImageARGB(uint_fast16_t x, uint_fast16_t y, uint_fast16_t w, uint_fast16_t h, pixelcopy_t* param) + { + auto src_x = param->src_x; + auto bytes = param->dst_bits >> 3; + pixelcopy_t pc_read(nullptr, _write_depth, _read_depth); + pixelcopy_t pc_write(nullptr, _write_depth, _write_depth); + for (;;) + { + uint8_t* dmabuf = _bus->getDMABuffer((w+1) * bytes); + pc_write.src_data = dmabuf; + readRect(x, y, w, 1, dmabuf, &pc_read); + { + param->fp_copy(dmabuf, 0, w, param); + pc_write.src_x = 0; + writeImage(x, y, w, 1, &pc_write, true); + } + if (!--h) return; + param->src_x = src_x; + param->src_y++; + ++y; + } + } +#if 0 void Panel_Device::writeImageARGB(uint_fast16_t x, uint_fast16_t y, uint_fast16_t w, uint_fast16_t h, pixelcopy_t* param) { auto src_x = param->src_x; @@ -237,6 +260,7 @@ namespace lgfx ++y; } } +#endif void Panel_Device::copyRect(uint_fast16_t dst_x, uint_fast16_t dst_y, uint_fast16_t w, uint_fast16_t h, uint_fast16_t src_x, uint_fast16_t src_y) {