EVE2 Palette8 Pixels

Comments

2 comments

  • Paul_B

    Hi warriorofwire!

    I’m sorry to hear about the trouble you are having with storing / displaying Paletted8 bitmaps.

    FTDI has an application note for image file conversion (see page 14):

    http://www.ftdichip.com/Support/Documents/AppNotes/AN_303%20FT800%20Image%20File%20Conversion.pdf

    //The following code shows a PALETTED8 example for the FT81x. PALETTED8 format is supported
    //indirectly in the FT81x and it is different from the PALETTED format in the FT80x. To render
    //Alpha, Red, Green and Blue channels, multi-pass drawing action is required.

    //addr_pal is the starting address of palette lookup table in RAM_G
    //bitmap source(palette indices) is starting from address 0

    dl(BITMAP_HANDLE(0))
    dl(BITMAP_LAYOUT(PALETTED8, width, height))
    dl(BITMAP_SIZE(NEAREST, BORDER, BORDER, width, height))

    dl(BITMAP_SOURCE(0)) //bitmap source(palette indices)

    dl(BEGIN(BITMAPS))
    dl(BLEND_FUNC(ONE, ZERO))

    //Draw Alpha channel
    dl(COLOR_MASK(0,0,0,1))
    dl(PALETTE_SOURCE(addr_pal+3))
    dl(VERTEX2II(0, 0, 0, 0))

    //Draw Red channel
    dl(BLEND_FUNC(DST_ALPHA, ONE_MINUS_DST_ALPHA))
    dl(COLOR_MASK(1,0,0,0))
    dl(PALETTE_SOURCE (addr_pal+2))
    dl(VERTEX2II (0, 0, 0, 0))

    //Draw Green channel
    dl(COLOR_MASK(0,1,0,0))
    dl(PALETTE_SOURCE(addr_pal + 1))
    dl(VERTEX2II(0, 0, 0, 0))

    //Draw Blue channel
    dl(COLOR_MASK(0,0,1,0))
    dl(PALETTE_SOURCE(addr_pal)

    Regarding the palette / index scheme of FTDI's image converter tool it may be beneficial to seek support from their support team directly.

    http://www.ftdichip.com/FTContact.htm.

    Hope this helps!

    0
  • warriorofwire

    Oh goodness, hi Paul - thank you for your reply, I didn't have email notification set up for this thread!

    I've reached out to FTDI for help.  I read that application note and the http://brtchip.com/wp-content/uploads/Support/Documentation/Programming_Guides/ICs/EVE/FT81X_Series_Programmer_Guide.pdf extensively.  It is very unclear what the "palette" schema is, and what a paletted bitmap should contain to reference that palette.

    Here's the application, sorry for the poor video - I haven't implemented screen capture for video yet:  https://photos.app.goo.gl/RMbkcYQt2TUKnVTR8

    The tachometer needle is a subtle asset with a blue glow that fades off over the span of a few pixels.  I'd like to retain a very high quality color gradient and use transparency.  I tried using "rgb8888" 32 bit raw bitmap and was unable to get that to work.  Any alternative ideas?  32bpp is expensive, but totally tolerable for this small, high-value asset.

    By the way, I thought it was kind of funny that the coprocessor uses "degrees" for rotation when it seems most natural to use "radians" with a transformation matrix

    0

Please sign in to leave a comment.