Menu

GLCD and palette

2020-09-18
2020-09-18
  • David Stephenson

    Are there any GLCDs that support a palette? If not is there a reason why this is so?
    Normally you have to send 16 or 24 bits per pixel which slows things down.
    Back when PCs were slow many graphics modes used palettes that is you could select any (64 bit) colour, but you only use 16 or sometimes 256 of them.
    Normally on GLCDs I use only say 4 or 8 colours so I could easily send at a rate of two pixels per byte some 4 to 8 times faster than with the GLCDs that I have been using.

     
    • Anobium

      Anobium - 2020-09-18

      Yes. the Nextion.

      I did a Gas/Petrol Station numeric display using palette control. Very fast.

      I am not aware of any of the GLCD libraries I have written have palette control within the glcd controller.

      Or, create a solution using a mcu to controller the GLCD and serial attach your 'main' mcu,
      Or, use an MCU with a large amout of RAM and double buffer (therefore only sending the changes as we do with most of the mono GLCDs),
      Or, hunt around the internet for a GLCD with a pallete controller.

       
  • stan cartwright

    stan cartwright - 2020-09-18

    By colour palette do you mean colours can be changed after being displayed.
    ie if one printed text in blue then you changed blue to say yellow then
    the printed text would become yellow without reprinting it?
    Anobium-I did not know nextions had colour palette switching!
    can nextion tell the colour of a pixel?
    nextions are complex displays,lots to learn but there seems more info now
    but google nextion editor or nextion suggestions clicking some don't do anything at all,
    no response or error,nothing.

     
  • stan cartwright

    stan cartwright - 2020-09-18

    This is code I took from the ili9341 part of include glcd and modified to make
    a sprite routine. It's not officially supported but works and may work with other ili displays.
    The table holds the colours that were defined for abreviation.
    each colour eg bk is black but it's a word value so how to use 2 colours like this
    and send more pixels in the word.
    pixel is dimmed as word.

    sub sprite (sprite_x,sprite_y) ;fills box with sprite data
    ;  SetAddressWindow_ILI9341 ( sprite_x,sprite_y,sprite_x + sprite_width-1,sprite_y + sprite_height - 1 )
      SetAddressWindow_ILI9341 ( sprite_x,sprite_y,sprite_x + 23,sprite_y + 23)
      for ptr=1 to 576 ;(sprite_width * sprite_height)
        ReadTable lander,ptr,pixel
        SendWord_ILI9341 pixel
      next ptr
    end sub
    ;
    ;sprite data
    ;1 2  3  4  5  6  7  8  9  10 11 12 13 14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wh,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,wh,bk,bk,bk ;14
    bk,bk,wh,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,wh,bk,bk ;15
    bk,wh,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,wh,bk ;16
    bk,wh,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,wh,bk ;17
    bk,bk,wh,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,wh,bk,bk ;18
    bk,bk,bk,wh,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,wh,bk,bk,bk ;19
    bk,bk,bk,wh,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,wh,bk,bk,bk ;20
    bk,bk,bk,wh,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,wh,bk,bk,bk ;21
    bk,bk,wh,wh,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,wh,wh,bk,bk ;22
    bk,wh,wh,wh,wh,wh,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,wh,wh,wh,wh,wh,bk ;23
    bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk,bk ;24
    end table
    
     
  • stan cartwright

    stan cartwright - 2020-09-18

    Anobium-"I did a Gas/Petrol Station numeric display using palette control. Very fast."
    like a guage picture and lots of coloured needles but all background colour except one,
    then make that needle background colour to erase it and next needle make forground colour.
    That would be faster than erasing the needle and redrawing in new position..if it uses trig to do that.

     
  • David Stephenson

    Thanks Anobium I was wondering why this was not a feature.
    Stan, the palatte is set to you 16 favourite colours then you only need send 4 bits to specify the colour of the pixel.

     
    • stan cartwright

      stan cartwright - 2020-09-18

      the palatte is set to you 16 favourite colours then you only need send 4 bits to specify the colour of the pixel.
      How to implement that using gcb glcd ilidisplay is beyond me.
      I rely on the gcb glcd includes as the display data sheets are too much for me.
      I last used palette switching on an amstrad 464. I see no way of implementing it with gcb and supported displays.
      Personally I like using gcb and glcds. Anobium wrote most drivers and they are fast...
      I tried my own line draw and the gcb version was faster :)

      If you can improve gcb glcd in any way for people like me who like using glcds then please share.
      I think we may be talking about completely different display modules here.

      I did not understand the 4bit colour when gcb glcd needs 16bit for each colour ie word.
      I understand 4bit it 0 to 15 but the ili display needs a 16 bit value for colour...
      dunno...I didn;t write the driver...nor could...or I would have.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.