[Freeciv-Dev] non-rectangular flag scaling
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Sat, 1 Sep 2001, Karl-Ingo Friese wrote:
> On Sat, 1 Sep 2001, Raimar Falke wrote:
> > The attached patch should work but doesn't. It works half if the
> > clipping is disabled. This leaves however black borders. Any ideas?
> >
> > Raimar
>
> I will have a look at it lateron today.
>
> Ingo
I rewrote the crop & scale part so that is able to deal
with non-rectangular flags now (which do not even have
to begin in the first row/column of pixels). Instead of
the combined crop & scale action before, I splited it
into first calculating the bounding box of the non-masked
pixels, croping it to the new dimensions and finaly scale
the croped image.
................
................
......X......... ...X...
.....XXX........ crop ..XXX.. scale .X.
....XXXXX....... -----> .XXXXX. -------> XXX
...XXXXXXX...... XXXXXXX .X.
......X......... ...X...
................
................
Raimar: I took your function and just changed it that way that
it looks now for the first/last column that contains a non
masked pixel (and same for the rows of course). The "old"
code parsed only the first row/column for start and end.
The result looks a little better; what is left to do now is
mask out the black pixels. I will have to look-up gtk-manuals
for this.
Current version of the patch is attached for comments.
Ingo
--
Karl-Ingo Friese
kif@xxxxxxxxxxxxxxxxxxxxxxxxxx
plrdlg.c.gz
Description: GNU Zip compressed data
|
|