Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pushImageRotateZoom() possible 4-bit palette bug giving in this function as a parameter #453

Closed
ESPboy-edu opened this issue Oct 7, 2023 · 4 comments
Labels
stale Inactive issues

Comments

@ESPboy-edu
Copy link

Environment ( 実行環境 )

  • MCU or Board name: ESPboy/ESP8266
  • Panel Driver IC: ST7735
  • Bus type: SPI
  • LovyanGFX version: v1.1.9
  • FrameWork version: Arduino LOLIN/WeMos D1/R2 and mini
  • Build Environment: ArduinoIDE
  • Operating System: macOS

Problem Description ( 問題の内容 )

Function:

void pushImageRotateZoom(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 void* data, color_depth_t depth, const T* palette);

with parameter "color_depth_t depth" = "lgfx::color_depth_t::palette_4bit"
seemed to render giving Image "void* data" with the palette which was set before using setPaletteColor() but not "const T* palette"

Expected Behavior ( 期待される動作 )

"pushImageRotateZoom" with settings "color_depth_t depth" = "lgfx::color_depth_t::palette_4bit" and "const T* palette" = "pointer to palette" should render giving image "const void* data" with the giving palette "const T* palette"

Actual Behavior ( 実際の動作 )

"pushImageRotateZoom" with settings "color_depth_t depth" = "lgfx::color_depth_t::palette_4bit" and "const T* palette" = "pointer to palette" renders giving image "const void* data" with the palette, which was set before using "setPaletteColor()"

Steps to reproduce ( 再現のための前提条件 )

  1. Set 4-bit palette using "setPaletteColor();"
  2. Draw image using "pushImageRotateZoom()" with settings "lgfx::color_depth_t::palette_4bit" and pointer to another palette than in previous step.
  3. You'll get image rendered with palette from step 1 but not giving in "pushImageRotateZoom()" in step 2

Code to reproduce this issue ( 再現させるためのコード )

https://gist.github.com/ESPboy-edu/f57c7d3dda8680aff5fe4e99380cd9c6

@lovyan03
Copy link
Owner

lovyan03 commented Oct 7, 2023

Hello, @ESPboy-edu
LovyanGFX currently does not have the ability to perform palette conversions when transferring between palette color images.
The palette specified by pushImageRotateZoom will have an effect only if the destination is not a palette color.
Therefore, the raw palette number of the spriteSpaceShip is transferred to the frameBuffer as is.
In other words, the airship's body color, 0x01, will be 0x01 in the frameBuffer.

I have left this matter as it is, as there has been no particular demand for this feature to date.
Therefore, a specification study is needed to determine how to implement this feature.

@ESPboy-edu
Copy link
Author

Yeah, that's my bad. Thank you very much. Indeed, direct sprite output on TFT is output with a given palette and of course if I use an intermediate screen buffer of 4bit palette, it is impossible to map a sprite of arbitrary image palette into it.

Copy link

github-actions bot commented Nov 6, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale Inactive issues label Nov 6, 2023
Copy link

This issue has been automatically closed because it has not had recent activity. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Inactive issues
Projects
None yet
Development

No branches or pull requests

2 participants