Menu

ili9341 copy background

2020-09-28
2020-09-28
  • stan cartwright

    stan cartwright - 2020-09-28

    Probably seems silly but ili9341 and gcb work fast and cheap display.
    notice there's SetAddressWindow_ILI9341 ( x,y,xwidth,yheight) which is not documented but safe to use.
    There's now a readpixel_ILI9341 so thought about copying part of screen to an array

    sub getbgnd
      ptr=1
      for hs=sprite_y to sprite_y+sprite_height
       for ws=sprite_x to sprite_x+sprite_width
          backgnd(ptr) = ReadPixel_ILI9341(ws,hs) and 0xfffff
          ptr++
       next ws
      next hs
    end sub
    

    and to replace the background

    sub restorebgnd (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 sprite_width * sprite_height
        SendWord_ILI9341 backgnd(ptr)
      next ptr
    end sub
    

    Is there a faster way like SetAddressWindow_ILI9341 but a window that can read height * width pixels and store them rather than the calculations to find a pixel x,y and then get it's colour for width * height times?

    I really like these displays and gcb cos they cheap and you can use your imagination...
    within glcd limits.
    I push the boat out for this display. The 8bit use does not seem to do it justice but
    I'm very happy with the gcld driver. Excellent!

     
  • stan cartwright

    stan cartwright - 2020-09-28

    oh dear,arrays are only bytes
    dim backgnd (255) as long compiles.
    so if I want to store pixel background I use 3 bytes for every pixel as they are long values and then process the array which would be 3 times bigger as bytes. dim backgnd (765).
    I don't think this project is gonna work out too good. pity

     

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.