Page 1 of 1

CustomFilterCallback width and height

Posted: Fri Aug 21, 2009 10:04 am
by wilbert
It would be great if the width and height of the object being drawn would be passed automatically to the callback function. It would allow for filters like a vignet, transition from SourceColor on the left to TargetColor on the right etc. All kind of filters where it is important to know the size of the object being drawn.

Posted: Fri Aug 21, 2009 12:55 pm
by freak
Just use the new OutputWidth() and OutputHeight() in the callback.

Posted: Fri Aug 21, 2009 1:20 pm
by Seymour Clufley
I think he means the object such as the image in DrawImage() or the text in DrawText().

Posted: Fri Aug 21, 2009 1:28 pm
by wilbert
Seymour Clufley wrote:I think he means the object such as the image in DrawImage() or the text in DrawText().
That was indeed what I was looking for but now I see the x and y are also output coordinates.
What I was looking for are the x, y, width and height of the source object.
That would make it possible to merge the SourceColor and TargetColor based on the distance from the source coordinate being drawn to the center of the source object so a vignet would be possible but also things like focal saturation.

Posted: Fri Aug 21, 2009 6:49 pm
by Demivec
wilbert wrote:
Seymour Clufley wrote:I think he means the object such as the image in DrawImage() or the text in DrawText().
That was indeed what I was looking for but now I see the x and y are also output coordinates.
What I was looking for are the x, y, width and height of the source object.
That would make it possible to merge the SourceColor and TargetColor based on the distance from the source coordinate being drawn to the center of the source object so a vignet would be possible but also things like focal saturation.
Why not set the values in a global structure before the filter is used?