comp.lang.ada
 help / color / mirror / Atom feed
From: "Alex R. Mosteo" <alejandro@mosteo.invalid>
Subject: Re: Color gradients lib
Date: Tue, 08 Feb 2011 15:52:24 +0100
Date: 2011-02-08T15:52:24+01:00	[thread overview]
Message-ID: <iirlbk$mfc$1@news.eternal-september.org> (raw)
In-Reply-To: op.vqk5tbwlule2fv@garhos

Yannick Duchêne (Hibou57) wrote:

> Hi Alex,
> 
> Any graphic capabilities requires an output “device”, either memory
> bitmap, screen, image file, and the latter may be bitmap, PNG, JPEG. I
> feel you miss to provide a context here. Are you seeking for a library to
> generate shapes filled with gradient to which kind of output ? This is
> important to know.

Yes, I was a bit scarce on details.

For the output device I have an abstract layer that can output to GTK or a 
simulator or any other backend I could need, so that's not the issue.

I want a function mapping from some arbitrary values (my data, with its 
minimum and maximum values) into the RGB triplets giving that cold-hot 
representation. Let's say:

type My_Data is float range 0.0 .. 100.0;

type RGB_Component is float range 0.0 .. 1.0;
type RGB_Color is record R, G, B : RGB_Component; end record;

function Gradient (Value : My_Data) return RGB_Color;

And that's it. Hope this helps, and thanks for the interest.

Alex.

> Do not know anything about the context, however an idea : is SVG a valid
> option for you ? For graphs, pies, and other formal representations and
> plotted images, SVG is rather good (if no dynamic features is required),
> and it has gradient capabilities:
> http://www.w3.org/TR/SVG/pservers.html
> 
> Otherwise, please tell more about the context and any relevant technical
> details.
> 
> 
> Le Tue, 08 Feb 2011 11:58:00 +0100, Alex R. Mosteo
> <alejandro@mosteo.invalid> a écrit:
> 
>> Hello,
>>
>> I need to plot some data (2D maps) and I have everything in my drawing
>> library except some readily usable gradients. I was wondering if some Ada
>> library out there has this before making my custom one.
>>
>> I would need one to represent bad/good ranges (e.g. the default gradient
>> blue-cold to red-hot in matlab), and another to show a density of samples
>> (perhaps simple shades of gray).
>>
>> The second one is straightforward, but the first one seems like something
>> pretty standard, so I wouldn't like to create one that is similar but not
>> the same.
>>
>> (e.g. the first example in
>> http://www.mathworks.com/help/techdoc/visualize/f0-18164.html#f0-5919 )
>>
>> Thanks for any suggestions.
> 
> 




  reply	other threads:[~2011-02-08 14:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-08 10:58 Color gradients lib Alex R. Mosteo
2011-02-08 13:16 ` Yannick Duchêne (Hibou57)
2011-02-08 14:52   ` Alex R. Mosteo [this message]
2011-02-08 15:18     ` Yannick Duchêne (Hibou57)
2011-02-08 15:21       ` Yannick Duchêne (Hibou57)
2011-02-08 16:27         ` Alex R. Mosteo
2011-02-08 19:30           ` Yannick Duchêne (Hibou57)
2011-02-08 18:00 ` Dmitry A. Kazakov
2011-02-08 19:27   ` Yannick Duchêne (Hibou57)
2011-02-08 19:36     ` Yannick Duchêne (Hibou57)
2011-02-08 19:54     ` Dmitry A. Kazakov
2011-02-09  8:53   ` Alex R. Mosteo
2011-02-08 20:26 ` Gautier write-only
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox