Gradient function for shape-blended round rect?

View: New views
9 Messages — Rating Filter:   Alert me  

Parent Message unknown Gradient function for shape-blended round rect?

by Vinnie-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I'm doing shaped gradient fills on rounded rectangles. A shaped gradient fill is one where the gradient colors take on the shape of the enclosing object. So for a rectangle it would be a series of rectangles. For an ellipse, a series of ellipses. Unlike the agg demo, my gradient fills are always "stretch to fit". The origin and scale factors are calculated to precisely fit the enclosing shape (polygon, round rect, rect, ellipse, or arc).

The problem is that I am currently using:

typedef agg::gradient_diamond gfunc_type;  

This works great for shape blended rectangles but doesn't work for rounded rectangles.

Is there an existing gradient function I can use to get rounded rectangle blends? Or what is the "right" formula?


------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations
Conference from O'Reilly Media. Velocity features a full day of
expert-led, hands-on workshops and two days of sessions from industry
leaders in dedicated Performance & Operations tracks. Use code vel09scf
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
Vector-agg-general mailing list
Vector-agg-general@...
https://lists.sourceforge.net/lists/listinfo/vector-agg-general

Re: Gradient function for shape-blended round rect?

by Lorne Laliberte :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Do a search for "gradient" and "contour" in this mailing list, someone
posted some code to do contour gradients which might be what you're
looking for.

(It wasn't terribly fast, though.)

Lorne Laliberte
Senior Software Developer, Indigo Rose Software



On Tue, Apr 28, 2009 at 8:43 AM, Vinnie <thevinn@...> wrote:

>
> I'm doing shaped gradient fills on rounded rectangles. A shaped gradient fill is one where the gradient colors take on the shape of the enclosing object. So for a rectangle it would be a series of rectangles. For an ellipse, a series of ellipses. Unlike the agg demo, my gradient fills are always "stretch to fit". The origin and scale factors are calculated to precisely fit the enclosing shape (polygon, round rect, rect, ellipse, or arc).
>
> The problem is that I am currently using:
>
> typedef agg::gradient_diamond gfunc_type;
>
> This works great for shape blended rectangles but doesn't work for rounded rectangles.
>
> Is there an existing gradient function I can use to get rounded rectangle blends? Or what is the "right" formula?
>
>
> ------------------------------------------------------------------------------
> Register Now & Save for Velocity, the Web Performance & Operations
> Conference from O'Reilly Media. Velocity features a full day of
> expert-led, hands-on workshops and two days of sessions from industry
> leaders in dedicated Performance & Operations tracks. Use code vel09scf
> and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
> _______________________________________________
> Vector-agg-general mailing list
> Vector-agg-general@...
> https://lists.sourceforge.net/lists/listinfo/vector-agg-general
>

------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations
Conference from O'Reilly Media. Velocity features a full day of
expert-led, hands-on workshops and two days of sessions from industry
leaders in dedicated Performance & Operations tracks. Use code vel09scf
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
Vector-agg-general mailing list
Vector-agg-general@...
https://lists.sourceforge.net/lists/listinfo/vector-agg-general

Re: Gradient function for shape-blended round rect?

by Milan Marusinec :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Lorne Laliberte wrote:
> Do a search for "gradient" and "contour" in this mailing list, someone
> posted some code to do contour gradients which might be what you're
> looking for.
>
> (It wasn't terribly fast, though.)
>
> Lorne Laliberte
> Senior Software Developer, Indigo Rose Software

http://milan.marusinec.sk/aggcp/

Milan


------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations
Conference from O'Reilly Media. Velocity features a full day of
expert-led, hands-on workshops and two days of sessions from industry
leaders in dedicated Performance & Operations tracks. Use code vel09scf
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
Vector-agg-general mailing list
Vector-agg-general@...
https://lists.sourceforge.net/lists/listinfo/vector-agg-general

Re: Gradient function for shape-blended round rect?

by Eugene Lazutkin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Milan,

What license covers your contribution?

Eugene Lazutkin
http://lazutkin.com/

On 05/03/2009 04:46 PM, Milan Marusinec wrote:

> Lorne Laliberte wrote:
>> Do a search for "gradient" and "contour" in this mailing list, someone
>> posted some code to do contour gradients which might be what you're
>> looking for.
>>
>> (It wasn't terribly fast, though.)
>>
>> Lorne Laliberte
>> Senior Software Developer, Indigo Rose Software
>
> http://milan.marusinec.sk/aggcp/
>
> Milan
>
>
> ------------------------------------------------------------------------------
> Register Now & Save for Velocity, the Web Performance & Operations
> Conference from O'Reilly Media. Velocity features a full day of
> expert-led, hands-on workshops and two days of sessions from industry
> leaders in dedicated Performance & Operations tracks. Use code vel09scf
> and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf


------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Vector-agg-general mailing list
Vector-agg-general@...
https://lists.sourceforge.net/lists/listinfo/vector-agg-general

Re: Gradient function for shape-blended round rect?

by Milan Marusinec :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Eugene Lazutkin wrote:
> Milan,
>
> What license covers your contribution?
>
> Eugene Lazutkin
> http://lazutkin.com/

MIT - the same as Agg 2.4

Milan


------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Vector-agg-general mailing list
Vector-agg-general@...
https://lists.sourceforge.net/lists/listinfo/vector-agg-general

Re: Gradient function for shape-blended round rect?

by Eugene Lazutkin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Milan,

Could you update the archive on your page and make it explicit?

Thank you in advance,

Eugene Lazutkin
http://lazutkin.com/

On 05/09/2009 03:51 AM, Milan Marusinec wrote:

> Eugene Lazutkin wrote:
>> Milan,
>>
>> What license covers your contribution?
>>
>> Eugene Lazutkin
>> http://lazutkin.com/
>
> MIT - the same as Agg 2.4
>
> Milan
>
>
> ------------------------------------------------------------------------------
> The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
> production scanning environment may not be a perfect world - but thanks to
> Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
> Series Scanner you'll get full speed at 300 dpi even with all image
> processing features enabled. http://p.sf.net/sfu/kodak-com


------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Vector-agg-general mailing list
Vector-agg-general@...
https://lists.sourceforge.net/lists/listinfo/vector-agg-general

Re: Gradient function for shape-blended round rect?

by Milan Marusinec :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Eugene Lazutkin wrote:
> Milan,
>
> Could you update the archive on your page and make it explicit?

OK, so I looked at the files and found out there is even
a little bit more liberal licence than MIT - the Public Licence.

Each source file states:

// Permission to copy, use, modify, sell and distribute this software
// is granted provided this copyright notice appears in all copies.
// This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.

And that's it. It's the same as Agg 2.4 Public Licence
and I don't see any point in degrading it to MIT/BSD
with wich it is anyway compatible.

Is there any problem with the licence for you ?

Milan


------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Vector-agg-general mailing list
Vector-agg-general@...
https://lists.sourceforge.net/lists/listinfo/vector-agg-general

Re: Gradient function for shape-blended round rect?

by Petr Kobalíček :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I think it's perfect.

- Petr

2009/5/9 Milan Marusinec <milan@...>:

> Eugene Lazutkin wrote:
>> Milan,
>>
>> Could you update the archive on your page and make it explicit?
>
> OK, so I looked at the files and found out there is even
> a little bit more liberal licence than MIT - the Public Licence.
>
> Each source file states:
>
> // Permission to copy, use, modify, sell and distribute this software
> // is granted provided this copyright notice appears in all copies.
> // This software is provided "as is" without express or implied
> // warranty, and with no claim as to its suitability for any purpose.
>
> And that's it. It's the same as Agg 2.4 Public Licence
> and I don't see any point in degrading it to MIT/BSD
> with wich it is anyway compatible.
>
> Is there any problem with the licence for you ?
>
> Milan
>
>
> ------------------------------------------------------------------------------
> The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
> production scanning environment may not be a perfect world - but thanks to
> Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
> Series Scanner you'll get full speed at 300 dpi even with all image
> processing features enabled. http://p.sf.net/sfu/kodak-com
> _______________________________________________
> Vector-agg-general mailing list
> Vector-agg-general@...
> https://lists.sourceforge.net/lists/listinfo/vector-agg-general
>

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Vector-agg-general mailing list
Vector-agg-general@...
https://lists.sourceforge.net/lists/listinfo/vector-agg-general

Re: Gradient function for shape-blended round rect?

by Eugene Lazutkin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

No problem, just wanted to clarify the license. In any case it looks
good to me.

Thanks,

Eugene Lazutkin
http://lazutkin.com/

On 05/09/2009 03:03 PM, Milan Marusinec wrote:

> Eugene Lazutkin wrote:
>> Milan,
>>
>> Could you update the archive on your page and make it explicit?
>
> OK, so I looked at the files and found out there is even
> a little bit more liberal licence than MIT - the Public Licence.
>
> Each source file states:
>
> // Permission to copy, use, modify, sell and distribute this software
> // is granted provided this copyright notice appears in all copies.
> // This software is provided "as is" without express or implied
> // warranty, and with no claim as to its suitability for any purpose.
>
> And that's it. It's the same as Agg 2.4 Public Licence
> and I don't see any point in degrading it to MIT/BSD
> with wich it is anyway compatible.
>
> Is there any problem with the licence for you ?
>
> Milan
>
>
> ------------------------------------------------------------------------------
> The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
> production scanning environment may not be a perfect world - but thanks to
> Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
> Series Scanner you'll get full speed at 300 dpi even with all image
> processing features enabled. http://p.sf.net/sfu/kodak-com


------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Vector-agg-general mailing list
Vector-agg-general@...
https://lists.sourceforge.net/lists/listinfo/vector-agg-general