-
Notifications
You must be signed in to change notification settings - Fork 66
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
Example code for UTFT, UTFT_SD.Jpeg does not work for LANDSCAPE #78
Comments
The problem is that UTFT does not use the hardware rotation features built into the display. This is possibly because it supports some displays that do not have this feature. This ultimately means that the display is kept in portrait orientation but x and y for each pixel are swappped (if required) and coordinates adjusted (if required) by subtracting from the width and height of display. There are a few ways to deal with this:
Personally I would avoid the UTFT library and use TFT_eSPI or Adafuit_GFX. Those libraries make thing simpler and use hardware rotation and have a performance advantage. Performing the rotations in software for every pixel has a performance impact, but does make the library "universal" which is as the author intended. |
Thanks for the reply. Does landscape work using the library example with any hardware combinations that you have tested? I am using a mega with a ITDB32S_V2 screen. Re 1 & 2, As detailed above I have extracted the MCU block and rotated it, with some improvement with simple lined shapes. Re 3 & 4, I had already tried the pre-rotating trick but this would not be a satisfactory solution. Is JpegDec.MCUx properly tied into the screen alignment, or is it specifically returning portrait positions? David |
Intuitively, looking at the image where blocks are not rotated, a 90 degree anticlockwise rotation of each MCU block will correct the image. What does it look like? |
90 degree anticlockwise was a good call. David main:
Jpeg_utilities.ino:
matrix.ino:
|
The example works perfectly for all of the supplied images in PORTRAIT.
If myGLCD.InitLCD(LANDSCAPE); is used the image drawn is not correct.
Is this a problem with renderJPEG ?
Can a landscape alternative be provided?
David
The text was updated successfully, but these errors were encountered: