summaryrefslogtreecommitdiffstats
path: root/tksao
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2019-01-23 19:14:26 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2019-01-23 19:14:26 (GMT)
commitf10065035d4c80a05f646b1eb0299fc56e8afa19 (patch)
tree4301fd2b9c1f40e56491f24edf0a9fbc5ef6a866 /tksao
parent3f07ef324bff63299229e50d5793fc04e01015a5 (diff)
downloadblt-f10065035d4c80a05f646b1eb0299fc56e8afa19.zip
blt-f10065035d4c80a05f646b1eb0299fc56e8afa19.tar.gz
blt-f10065035d4c80a05f646b1eb0299fc56e8afa19.tar.bz2
fix aqua rotation and colormap
Diffstat (limited to 'tksao')
-rw-r--r--tksao/frame/frame.C30
-rw-r--r--tksao/frame/framebase.C12
-rw-r--r--tksao/frame/frcommand.C16
-rw-r--r--tksao/widget/truecolor24.C22
4 files changed, 52 insertions, 28 deletions
diff --git a/tksao/frame/frame.C b/tksao/frame/frame.C
index 2e69841..692a0ae 100644
--- a/tksao/frame/frame.C
+++ b/tksao/frame/frame.C
@@ -548,6 +548,7 @@ void Frame::colormapCmd(int id, float b, float c, int i,
update(BASE);
}
+#ifndef MAC_OSX_TK
void Frame::colormapBeginCmd()
{
// we need a colorScale before we can render
@@ -762,6 +763,35 @@ void Frame::colormapEndCmd()
update(BASE); // always update
}
+#else
+void Frame::colormapBeginCmd() {}
+
+void Frame::colormapMotionCmd(int id, float b, float c, int i,
+ unsigned char* cells, int cnt)
+{
+ // we need a colorScale before we can render
+ if (!validColorScale())
+ return;
+
+ // first check for change
+ if (cmapID == id && bias == b && contrast == c && invert == i && colorCells)
+ return;
+
+ // we got a change
+ cmapID = id;
+ bias = b;
+ contrast = c;
+ invert = i;
+
+ updateColorCells(cells, cnt);
+ updateColorScale();
+
+ update(BASE);
+ updatePanner();
+}
+
+void Frame::colormapEndCmd() {}
+#endif
void Frame::getColorbarCmd()
{
diff --git a/tksao/frame/framebase.C b/tksao/frame/framebase.C
index 3ee699a..ec8a06c 100644
--- a/tksao/frame/framebase.C
+++ b/tksao/frame/framebase.C
@@ -227,19 +227,8 @@ void FrameBase::rotateMotion()
double y = i*mm[1] + j*mm[4] + mm[7];
if (x >= 0 && x < width && y >= 0 && y < height) {
-#if MAC_OSX_TK
- // I really don't understand this
- char* sptr = src + ((int)y)*rotateDestXM->bytes_per_line+
- ((int)x)*bytesPerPixel;
-
- *(dest+0) = *(sptr+3);
- *(dest+1) = *(sptr+0);
- *(dest+2) = *(sptr+1);
- *(dest+3) = *(sptr+2);
-#else
memcpy(dest, src + ((int)y)*rotateDestXM->bytes_per_line +
((int)x)*bytesPerPixel, bytesPerPixel);
-#endif
}
else
memcpy(dest, bgTrueColor_, bytesPerPixel);
@@ -255,6 +244,7 @@ void FrameBase::rotateMotion()
XCopyArea(display, rotatePM, Tk_WindowId(tkwin), rotateGCXOR, 0, 0,
options->width, options->height, dd[0], dd[1]);
}
+
void FrameBase::setBinCursor()
{
if (context->cfits)
diff --git a/tksao/frame/frcommand.C b/tksao/frame/frcommand.C
index 2f2c306..949dfca 100644
--- a/tksao/frame/frcommand.C
+++ b/tksao/frame/frcommand.C
@@ -354,6 +354,7 @@ void FrameBase::panEndCmd(const Vector& vv)
update(MATRIX);
}
+#ifndef MAC_OSX_TK
void FrameBase::rotateBeginCmd()
{
// save the current rotation
@@ -404,6 +405,21 @@ void FrameBase::rotateEndCmd()
update(MATRIX);
}
+#else
+void FrameBase::rotateBeginCmd()
+{
+ // save the current rotation
+ rotateRotation = rotation;
+}
+
+void FrameBase::rotateMotionCmd(double angle)
+{
+ rotation = rotateRotation + angle;
+ update(MATRIX);
+}
+
+void FrameBase::rotateEndCmd() {}
+#endif
void FrameBase::saveFitsResampleFileCmd(const char* fn)
{
diff --git a/tksao/widget/truecolor24.C b/tksao/widget/truecolor24.C
index 9ef87f9..f19e2d4 100644
--- a/tksao/widget/truecolor24.C
+++ b/tksao/widget/truecolor24.C
@@ -14,23 +14,11 @@ TrueColor24::TrueColor24(Visual* visual)
bx_ = visual->blue_mask;
#endif
#if MAC_OSX_TK
- // major change in 8.6.9: in macos/tkMacOSXImage.c
- if (TCL_MAJOR_VERSION == 8 &&
- TCL_MINOR_VERSION == 6 &&
- TCL_RELEASE_SERIAL < 9) {
- // bitmapInfo = (image->byte_order == MSBFirst ? kCGBitmapByteOrder32Big : kCGBitmapByteOrder32Little);
- ax_ = 0xFF000000;
- rx_ = 0x00FF0000;
- gx_ = 0x0000FF00;
- bx_ = 0x000000FF;
- }
- else {
- // bitmapInfo = (image->byte_order == MSBFirst ? kCGBitmapByteOrder32Little : kCGBitmapByteOrder32Big);
- ax_ = 0xFF000000;
- rx_ = 0x000000FF;
- gx_ = 0x0000FF00;
- bx_ = 0x00FF0000;
- }
+ // macos masks are plain wrong
+ ax_ = 0xFF000000;
+ rx_ = 0x000000FF;
+ gx_ = 0x0000FF00;
+ bx_ = 0x00FF0000;
#endif
#if _WIN32
// windows masks are plain wrong