[Thuban-list] [Patch] Improved hsv ramps patch
Daniel Calvelo Aros
dcalvelo at minag.gob.pe
Fri Feb 27 01:05:35 CET 2004
On Mon, 23 Feb 2004 21:20:29 +0100, Bernhard Herzog wrote
> I think we can check this in once we have tests. I would especially
> like to see tests for interpolate_hsv because it has quite a few special
> cases.
Right. It's coming along.
> Another thing that we might want to fix, but this can be done after the
> hsv code has been checked in, is the way Transparent is interpolated
> with non-transparent color.
>
> As it's currently implemented in CVS (and inherited from the that in
> the interpolate_rgb and interpolate_hsv functions in the patch) is
> wrong, imo. For example. interpolate_rgb(Color(1, 1, 1),
> Transparent, 0) yields black and not as one would expect, white.
> However, I'm not even sure those functions should even allow
> interpolation of Transparent with non-transparent colors. If Thuban
> could handle translucent shapes that might be useful but currently
> it doesn't so that kind of interpolation cannot really be done in a
> sensible way.
>
> At the moment, I'd say that the interpolation functions should simply
> assume that the color parameters are normal RGB colors and raise
> exceptions when that assumption doesn't hold. This could either be done
> implicitly when trying to access the red, green and blue attributes
> or more explicitly by checking whether either of the color
> parameters is Transparent and raise e.g. TypeError. Handling of
> Transparent for class generation would then have to be done by the
> CustomRamp class.
How hard would be to switch the default renderer to a wxGL canvas? Maybe it's
time to begin that work...
> Bernhard
Daniel.
-- Daniel Calvelo Aros
-- Dirección General de Información Agraria
-- Ministerio de Agricultura del Perú
-- (51-1)424-9001
More information about the Thuban-list
mailing list
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)