cancel
Showing results for 
Search instead for 
Did you mean: 

Inverting colors

Hello, I have a 1bpp display and would like to invert the colors on all screens programatically. I've tried in

a) getColorFrom24BitRGB(uint8_t red, uint8_t green, uint8_t blue) by XORing with 1, which is ok except for bitmaps

b) TouchGFXHAL::flushFrameBuffer(const touchgfx::Rect& rect) by locking the framebuffer and XORing each word with 0xFFFFFFFF, which is ok on invalidated rect, but flickers on the remainder of the screen.

6 REPLIES 6

Is this possible?

MM..1
Chief II

Simpler way is use display registers setup to inverted mode, then no next code changes.

Unfortunately the device doesn't have this capability

MM..1
Chief II

Make two screens one positive one negative and switch between when your display controller IC dont have invert mode

Not practical - I have hundreds of screens.

Then you need display with invert function, that is practical, or virtual buffers mean touchgfx uses positive buffers and ltdc negative with double buffering.

Example command on LCD

void ili9341_Initnoinvert(void)

{

 LCD_IO_Init();

 ili9341_WriteReg(0x21);//Display Inversion Off

}

void ili9341_Initinvert(void)

{

 LCD_IO_Init();

 ili9341_WriteReg(0x20);//Display Inversion On

}