diff options
Diffstat (limited to 'tksao/frame/framergb.C')
-rw-r--r-- | tksao/frame/framergb.C | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/tksao/frame/framergb.C b/tksao/frame/framergb.C index b87ef0c..abdcc61 100644 --- a/tksao/frame/framergb.C +++ b/tksao/frame/framergb.C @@ -132,9 +132,6 @@ unsigned char* FrameRGB::fillImage(int width, int height, char* mk = new char[width*height]; memset(mk,0,width*height); - XColor* bgColour = bgColor(); - XColor* nanColour = getXColor(nanColourName); - SETSIGBUS // one channel at a time @@ -221,6 +218,8 @@ unsigned char* FrameRGB::fillImage(int width, int height, } // now fill in bg + XColor* bgColor = getBGColor(); + XColor* nanColor = getXColor(nanColourName); { unsigned char* dest = img; char* mkptr = mk; @@ -229,14 +228,14 @@ unsigned char* FrameRGB::fillImage(int width, int height, if (*mkptr == 2) // good value ; else if (*mkptr == 1) { // nan - *dest = (unsigned char)nanColour->red; - *(dest+1) = (unsigned char)nanColour->green; - *(dest+2) = (unsigned char)nanColour->blue; + *dest = (unsigned char)nanColor->red; + *(dest+1) = (unsigned char)nanColor->green; + *(dest+2) = (unsigned char)nanColor->blue; } else { // bg - *dest = (unsigned char)bgColour->red; - *(dest+1) = (unsigned char)bgColour->green; - *(dest+2) = (unsigned char)bgColour->blue; + *dest = (unsigned char)bgColor->red; + *(dest+1) = (unsigned char)bgColor->green; + *(dest+2) = (unsigned char)bgColor->blue; } } } @@ -669,9 +668,6 @@ void FrameRGB::colormapMotionCmd(float rb, float gb, float bb, int& width = colormapXM->width; int& height = colormapXM->height; - XColor* bgColour = bgColor(); - XColor* nanColour = getXColor(nanColourName); - // create img unsigned char* img = new unsigned char[width*height*3]; memset(img, 0, width*height*3); @@ -697,6 +693,8 @@ void FrameRGB::colormapMotionCmd(float rb, float gb, float bb, } // set remainder to bg + XColor* bgColor = getBGColor(); + XColor* nanColor = getXColor(nanColourName); { unsigned char* dest = img; char* mptr = mk; @@ -705,14 +703,14 @@ void FrameRGB::colormapMotionCmd(float rb, float gb, float bb, if (*mptr == 2) // good value ; else if (*mptr == 1) { // nan - *(dest ) = (unsigned char)nanColour->red; - *(dest+1) = (unsigned char)nanColour->green; - *(dest+2) = (unsigned char)nanColour->blue; + *(dest ) = (unsigned char)nanColor->red; + *(dest+1) = (unsigned char)nanColor->green; + *(dest+2) = (unsigned char)nanColor->blue; } else { // bg - *(dest ) = (unsigned char)bgColour->red; - *(dest+1) = (unsigned char)bgColour->green; - *(dest+2) = (unsigned char)bgColour->blue; + *(dest ) = (unsigned char)bgColor->red; + *(dest+1) = (unsigned char)bgColor->green; + *(dest+2) = (unsigned char)bgColor->blue; } } |