> > 1. My example is not optimal. It copies the whole
> > rendering buffer and uses only the circle-part of
> Aha, so you want to copy the minimal bounding box
Yes, and all we need for that is a possibility to copy
source pixels with offset, namely, integer dx, dy.
> > 2. Clipping is the responsibility of the filter,
> > this case, namely span_convolve_matrix_rgb24. Now
> > crashes when the area needs to be clipped.
> Aha, you mean not referencing pixels outside the
> buffer/filtering area?
Right. In fact, it's a problem. You see, when writing
pixels I can easily clip them in advance. But I cannot
do that when reading because it can require (and will
of course) some neighbor pixels. In the image
transformer I simply reduce the valid area of the
source image to the half size of the filter. For
example, the bicubic filter has a matrix of 4x4, so,
there's a 2 pixel invalid "border" is implied in the
source image. I could do something smarter of course,
but I suppose it's fair enough for most cases.
Afterall, we can extend the area when creating the
copy of the source and it can be easily automated.
BTW, the main problem with the image transformer is
that it's not automated in the meaning of the
relationship between the affine matrices and the
source and destination images :-)
> > 3. It'd be great to avoid using Tab characters :-)
> Very hard for me actually :-)
> I still have to know
> exactly how composite operators and blend modes are
> related to each
Let's take for example XOR mode. When there're no
anti-aliasing neither alpha-blending everything is
easy. But what if there are? My suggestion is that you
calculate the R,G,B components as R = Rsrc ^ Rpix,
etc., and then anti-alias it according to the alpha
value as a regular pixel. Well, I'll try to write an
Technically you just copy the respective
agg_pixfmt_*.h to say, agg_pixfmt_*_xor.h and modify
it according to its functionality. I think it's the
best way to provide different blend modes. You see, if
you need performance you use a switch():
. . .
. . .
. . .
If you need a real, dynamic polymorphism you'll have
to write a simple wrapper with virtual methods and use
it as a universal pixel format. Yes, it will affect
the performance, but in certain cases can be used.
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).