CustomFilterCallback width and height

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3942
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

CustomFilterCallback width and height

Post 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.
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

Just use the new OutputWidth() and OutputHeight() in the callback.
quidquid Latine dictum sit altum videtur
Seymour Clufley
Addict
Addict
Posts: 1264
Joined: Wed Feb 28, 2007 9:13 am
Location: London

Post by Seymour Clufley »

I think he means the object such as the image in DrawImage() or the text in DrawText().
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3942
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Post 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.
User avatar
Demivec
Addict
Addict
Posts: 4260
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Post 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?
Post Reply