From: Arlindo da S. <da...@al...> - 2011-11-20 22:32:09
|
Brian, Jennifer: In GrADS 2.1, would you consider extending "set rgb" to accept an extra "alpha" channel? Since, you now use cairo for rendering, taking advantage of the channel is really trivial, you can take a look at what we did in gxyat<http://opengrads.cvs.sourceforge.net/viewvc/opengrads/contrib/extensions/gxyat/gxyat.c?revision=1.9&view=markup>. Partial transparency is very useful to create plots like this one: 153722<http://sourceforge.net/projects/opengrads/screenshots/153722>. If you wish I can contribute a reference implementation once the 2.1 sources are available. We could also have gxyat built in (gxyat is nothing more than "gxpng" modified to use cairo). Because gd is much faster than cairo, there always will be a place for printim as we know it, don't you think? Arlindo ---------- Forwarded message ---------- From: Arlindo da Silva <da...@al...> Date: Sun, Nov 20, 2011 at 5:12 PM Subject: Re: [gradsusr] Two gxout shaded value in one plot To: GrADS Users Forum <gra...@gr...> On Sat, Nov 19, 2011 at 1:12 PM, Joe Moore <jo...@wx...> wrote: > Hello! > > Can you provide the code you are trying to use? I'm having trouble > understanding exactly what you mean. > > Overlaying two shaded displays will result in the first being covered by > the second unless you specify to only shade certain values of the second. > While it is possible to set a shaded value to transparent using the latest > GrADS version (use set gxout shade2 and set the color to -1 to be > transparent), it is not possible (not my knowledge) to do any kind of > partial transparency. > > Yes, youn can, with the the "set_rgba" command in opengrads. It works just like "set rgb" but in addition to the red/green/blue values you specify an "alpha" value that controls the opacity of that color, see below. The caveat is that you do not see the transparency on the screen, only when you create the output with gxyat (png, svg, pdf or ps). (When Grads 2.1 is released I believe we will be able to extend this feature to screen output as well.) Arlindo *NAME* set_rgba - define color including alpha channel *SYNOPSIS* set_rgba color red green blue alpha [mask] *DESCRIPTION* This User Defined Command (UDC) defines *color* given its RGB triplet along with its *alpha* channel. color integer in the range [16-255] red, green, blue integers in the range [0-255] alpha float, with alpha ranging from 0.0 (fully transparent) to 1.0 (fully opaque). The optional parameter *mask* determines whether the color below it is visible or not. mask=0 --- if alpha<1, *color* will be semi-transparent and the colors below it will be visible (default) mask=1 --- if alpha<1, *color* will be semi-transparent but the colors below it will *not* be visible *EXAMPLE* In order to emulate the -t option in printim ga-> set rgb 60 125 125 125 ga-> printim img.png -t 60 Specify alpha=0 and mask=1 ga-> set_rgba 60 125 125 125 0 1 ga-> gxyat img.png -Joe > > > On Sat, Nov 19, 2011 at 3:21 AM, Cuba <jak...@o2...> wrote: > >> Hellow Gradsuser, >> I try make two gxout shaded value in one plot, but this not go. >> I know as make shaded value and countur in one plot, but in this time i >> needs two shaded value. >> Please for help. >> >> >> _______________________________________________ >> gradsusr mailing list >> gra...@gr... >> http://gradsusr.org/mailman/listinfo/gradsusr >> > > > _______________________________________________ > gradsusr mailing list > gra...@gr... > http://gradsusr.org/mailman/listinfo/gradsusr > > -- Arlindo da Silva da...@al... -- Arlindo da Silva da...@al... |