calc_error() needs the colormap color values; changed to reference the
fl_cmap array (this might actually be off from the colormap value that
is actually allocated, but hopefully this patch will eliminate extra
color allocations anyways...)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@1242 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
@ -168,15 +170,15 @@ static void color8_converter(const uchar *from, uchar *to, int w, int delta) {
@@ -168,15 +170,15 @@ static void color8_converter(const uchar *from, uchar *to, int w, int delta) {
g+=from[1];if(g<0)g=0;elseif(g>255)g=255;
b+=from[2];if(b<0)b=0;elseif(b>255)b=255;
i=cube[((r<<4)&0xf00)+(g&0xf0)+(b>>4)];
Fl_XColor*x=fl_xmap[0]+i;
r-=x->r;
g-=x->g;
b-=x->b;
if(!alloc_color[i])
{
fl_xpixel((Fl_Color)i);
alloc_color[i]=1;
}
Fl_XColor*x=fl_xmap[0]+i;
r-=x->r;
g-=x->g;
b-=x->b;
*to=uchar(x->pixel);
}
ri=r;gi=g;bi=b;
@ -201,13 +203,13 @@ static void mono8_converter(const uchar *from, uchar *to, int w, int delta) {
@@ -201,13 +203,13 @@ static void mono8_converter(const uchar *from, uchar *to, int w, int delta) {
for(;w--;from+=d,to+=td){
r+=from[0];if(r<0)r=0;elseif(r>255)r=255;
i=cube[(r>>4)*0x111];
Fl_XColor*x=fl_xmap[0]+i;
r-=x->g;
if(!alloc_color[i])
{
fl_xpixel((Fl_Color)i);
alloc_color[i]=1;
}
Fl_XColor*x=fl_xmap[0]+i;
r-=x->g;
*to=uchar(x->pixel);
}
ri=r;
@ -650,5 +652,5 @@ void fl_rectf(int x, int y, int w, int h, uchar r, uchar g, uchar b) {
@@ -650,5 +652,5 @@ void fl_rectf(int x, int y, int w, int h, uchar r, uchar g, uchar b) {
#endif
//
// End of "$Id: fl_draw_image.cxx,v 1.5.2.3 2000/06/27 23:07:51 easysw Exp $".
// End of "$Id: fl_draw_image.cxx,v 1.5.2.4 2000/06/27 23:30:54 easysw Exp $".