BRT Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

Welcome to the Bridgetek Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ Bridgetek Support

Please refer to our website for detailed information on all our products - Bridgetek - Bridging Technology

Author Topic: Filled Irregular Polygons - Mission Impractical  (Read 193 times)

AT38

  • Newbie
  • *
  • Posts: 10
    • View Profile
Filled Irregular Polygons - Mission Impractical
« on: July 01, 2019, 01:13:36 PM »

Hi,

I was hoping to be able to draw filled polygons using an FT813 so that I can replace some large icon bitmaps with a small list of vertices, saving me a whole load of flash memory space.

I looked at application note AN334 https://brtchip.com/wp-content/uploads/Support/Documentation/Application_Notes/ICs/EVE/AN_334-FT801_Polygon_Application.pdf and I saw filled polygons.
On closer inspection, it seems that the polygon is split up into smaller sections so that they have vertical and horizontal edges for the scissor command to trim to.
This makes diagonals impractical however, as they would have to be cut up into squares whose sides match the width of the diagonal section. A long thin diagonal would require many cuts.
Concave polygons also need to be chopped up into straight edged convex pieces, and would need some thinking about..


Firstly, is filled concave polygons something that is likely to be supported in the future? Are the existing range of chips field upgradable, or would this feature require rolling out a new product?


Secondly, what would be the best way of getting around this?

1) I could draw over the unwanted part of the polygon with another polygon set to the background colour, but this wouldn't preserve non uniform backgrounds.

2) Perhaps I could draw to the stencil channel instead, but the stencil is 1bit and wouldn't have nice smooth edges when I fill, so far as I can tell from the docs, haven't tried it yet. I suppose I could then draw the outline with with a LINE_STIP to get the anti-aliased edges.

3) Or I could break up the icons into smaller components and composite them, making use of completely blank rectangular bitmaps that can be generated with the MEMFILL command and using the bitmap transform to rotate them to get the diagonals. Rotating bitmaps is a bit iffy, though. I did try animating a rotating circle and it did not look good. Its size and position kept shifting about.

4) Or I could give up and just use bitmaps, take the hit on space, hope deflate does a good job.

I think option (1) would suit my immediate needs, but I'd like to know if other folk have encountered this limitation, how they've gotten around it, and why that method, so I can make an informed decision before making a commitment.

Cheers,
 AT38
Logged

AT38

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Filled Irregular Polygons - Mission Impractical
« Reply #1 on: July 17, 2019, 11:28:10 AM »

I noticed that edge strips don't anti-alias, so need to be outlined anyway.

Using Scissors is the easiest way for simple shapes, but doesn't allow for moving the shape using vertex offsets. For that, stencilling is required.

For shapes with relatively thin diagonals, drawing multiple parallel lines seems to be the easiest way.

I haven't been able to get compressed images to work yet. PNGs load, but return zero length.
I'm now trying to upload compressed raw L4 converted output from the Asset Converter. For some reason it doesn't compress files when 'compressed' is selected. I've written a python script to compress the raw files and output to c array, but so far I've only gotten errors from CMD_INFLATE.
Logged

BRT Community

  • Administrator
  • Jr. Member
  • *****
  • Posts: 56
    • View Profile
Re: Filled Irregular Polygons - Mission Impractical
« Reply #2 on: July 17, 2019, 02:28:28 PM »

Hello,

You can have a look at section 7 of the following application note which covers loading PNGs and inflating images:
https://brtchip.com/wp-content/uploads/Support/Documentation/Application_Notes/ICs/EVE/BRT_AN_014_FT81X_Simple_PIC_Library_Examples.pdf

Best Regards,
FTDI Community
Logged