|
From: Pierre <pie...@gm...> - 2007-02-02 22:34:10
|
On 2/2/07, Ethan Merritt <merritt@u.washington.edu> wrote: > On Friday 02 February 2007 12:38, Hans-Bernhard Br=F6ker wrote: > > Ethan Merritt wrote: > > > gdImageShadedTriangle(gdImagePtr image, gdPoint *vertex, int *colo= r); > > > > > That is, a filled triangle with interpolation of three separate color= s > > > specified for the three vertices. > > > > Interpolation is quite a tricky business in color space, because there'= s > > no clear-cut idea what the curve to draw between two given points in > > colour space should be. To properly specify an interpolation mechanism= , > > one needs to specify at least the coordinate system in which the > > interpolated surface in color-space is supposed to be flat. > > That is an interesting point. > > I noted out in my feature request for libgd that it was unclear what > sort of interpolation could be done with an indexed colormap. The usual > shading interpolation routines assume either RGB or CMY colorspace. > But I think you've answered that question. The gnuplot PM3D grey > scale palette routines define a single scale within which interpolation > of the index value does make sense. The question then becomes, is > this linear ordering of index values maintained internally in libgd? > > We define colors 1->N sequentially using > for(i=3D0;i<N;i++) png_smooth_color[i] =3D gdImageColorAllocate(...) > Does this yield N successive color indices in libgd? I don't know. It does. > We should have plenty of time for testing, discussion, and > feedback. Gnuplot is headed for an imminent 4.2 release; > libgd for an imminant 2.0.34 release. Any work on coordinating > treatment of gradient-fill can proceed at leisure with an eye > to much more distant major release targets (4.4/5.0 and 2.1). I added a sample code in your report. It is a first shot but seems to work = well. --Pierre |