View Single Post
Old 11 December 2018, 13:04   #4
Kalms
Registered User
 
Join Date: Nov 2006
Location: Stockholm, Sweden
Posts: 237
Quote:
Originally Posted by Ozzyboshi View Post
I dont think it would work because the exlusive fill deletes only one side of the edge, not both.
Furthermore what about the top or the bottom edge of a square?
It seems this operation is impossible with the blitter.
What about using the shift register?
I would make 4 other buffers of the size of the bitplane.
The first buffer would have the right shifted image of 1 px, at this point whenever in the source image there is a 1 and in the first buffer there is a 0, this would be the left edge.
The same process could be done with the right edge (left shifting)
For the top and bottom i could add or subtract the blitter addresses by one line.
Maybe it works....
That ought to work.

If it is OK to have one of the sides' edge-line lie 1 pixel outside of the filled polygon, then left+right can be handled in a single pass. Similarly, up+down can be handled in a single pass. Use (buffer XOR (buffer shifted by 1 pixel)) to generate, one pass horizontally, then another pass vertically, with blits like this:

Blit 1:
A, B = input image
D = output buffer
D = (A ^ (B shifted left by 1 pixel))

Blit 2:
A = input image
B = input image + 1 line
C, D = output buffer
D = C | (A ^ B))

If it is required to always have the edge-line inside of the filled polygon, then 4 passes will be needed. Use (buffer & ~(buffer shifted by 1 pixel)) to generate edge pixels. One pass each for left/right/up/down.
Kalms is offline  
 
Page generated in 0.08729 seconds with 11 queries