diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2019-01-24 18:08:32 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2019-01-24 18:08:32 (GMT) |
commit | e930296e5d18c43a6218360a9fed0e37e0d21e02 (patch) | |
tree | 579110191c8f47fdf6bb03f57544822e63704b6d /tksao/frame | |
parent | f6e9267db71a82d86d71b07c61546871afda59ac (diff) | |
download | blt-e930296e5d18c43a6218360a9fed0e37e0d21e02.zip blt-e930296e5d18c43a6218360a9fed0e37e0d21e02.tar.gz blt-e930296e5d18c43a6218360a9fed0e37e0d21e02.tar.bz2 |
fix macos mojave port
Diffstat (limited to 'tksao/frame')
-rw-r--r-- | tksao/frame/framergb.C | 91 |
1 files changed, 65 insertions, 26 deletions
diff --git a/tksao/frame/framergb.C b/tksao/frame/framergb.C index d39a4e1..77538f3 100644 --- a/tksao/frame/framergb.C +++ b/tksao/frame/framergb.C @@ -500,6 +500,7 @@ void FrameRGB::colormapCmd(float rb, float gb, float bb, update(BASE); } +#ifndef MAC_OSX_TK void FrameRGB::colormapBeginCmd() { // we need a colorScale before we can render @@ -629,32 +630,6 @@ void FrameRGB::colormapBeginCmd() CLEARSIGBUS } -void FrameRGB::colormapEndCmd() -{ - if (colormapXM) { - XDestroyImage(colormapXM); - colormapXM = NULL; - } - - if (colormapPM) { - Tk_FreePixmap(display, colormapPM); - colormapPM = 0; - } - - if (colormapGCXOR) { - XFreeGC(display, colormapGCXOR); - colormapGCXOR = 0; - } - - for (int kk=0; kk<3; kk++) - if (colormapData[kk]) { - delete [] colormapData[kk]; - colormapData[kk] = NULL; - } - - update(BASE); // always update -} - void FrameRGB::colormapMotionCmd(float rb, float gb, float bb, float rc, float gc, float bc, int i, unsigned char* cells, int cnt) @@ -756,6 +731,70 @@ void FrameRGB::colormapMotionCmd(float rb, float gb, float bb, updatePanner(); } +void FrameRGB::colormapEndCmd() +{ + if (colormapXM) { + XDestroyImage(colormapXM); + colormapXM = NULL; + } + + if (colormapPM) { + Tk_FreePixmap(display, colormapPM); + colormapPM = 0; + } + + if (colormapGCXOR) { + XFreeGC(display, colormapGCXOR); + colormapGCXOR = 0; + } + + for (int kk=0; kk<3; kk++) + if (colormapData[kk]) { + delete [] colormapData[kk]; + colormapData[kk] = NULL; + } + + update(BASE); // always update +} +#else +void FrameRGB::colormapBeginCmd() {} + +void FrameRGB::colormapMotionCmd(float rb, float gb, float bb, + float rc, float gc, float bc, int i, + unsigned char* cells, int cnt) +{ + // we need a colorScale before we can render + if (!validColorScale()) + return; + + // first check for change + if (bias[0] == rb && bias[1] == gb && bias[2] == bb && + contrast[0] == rc && contrast[1] == gc && contrast[2] == bc && + invert == i && colorCells) + return; + + // we got a change + bias[0] = rb; + bias[1] = gb; + bias[2] = bb; + contrast[0] = rc; + contrast[1] = gc; + contrast[2] = bc; + invert = i; + + updateColorCells(cells, cnt); + updateColorScale(); + + update(BASE); + updatePanner(); +} + +void FrameRGB::colormapEndCmd() +{ + update(BASE); +} +#endif + void FrameRGB::getColorbarCmd() { ostringstream str; |