summaryrefslogtreecommitdiffstats
path: root/tksao/widget/truecolor24.h
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2016-10-27 18:59:29 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2016-10-27 18:59:29 (GMT)
commitd4d595fa7fb12903db9227d33d48b2b00120dbd1 (patch)
tree7d18365de0d6d1b29399b6a17c7eb01c2eb3ed49 /tksao/widget/truecolor24.h
parent949f96e29bfe0bd8710d775ce220e597064e2589 (diff)
downloadblt-d4d595fa7fb12903db9227d33d48b2b00120dbd1.zip
blt-d4d595fa7fb12903db9227d33d48b2b00120dbd1.tar.gz
blt-d4d595fa7fb12903db9227d33d48b2b00120dbd1.tar.bz2
Initial commit
Diffstat (limited to 'tksao/widget/truecolor24.h')
-rw-r--r--tksao/widget/truecolor24.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/tksao/widget/truecolor24.h b/tksao/widget/truecolor24.h
new file mode 100644
index 0000000..7d106bd
--- /dev/null
+++ b/tksao/widget/truecolor24.h
@@ -0,0 +1,47 @@
+// Copyright (C) 1999-2016
+// Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+// For conditions of distribution and use, see copyright notice in "copyright"
+
+#ifndef __truecolor24_h__
+#define __truecolor24_h__
+
+#include <string.h>
+
+#include <iostream>
+#include <sstream>
+#include <iomanip>
+using namespace std;
+
+#include <tk.h>
+
+class TrueColor24 {
+ protected:
+ unsigned long rx_;
+ unsigned long gx_;
+ unsigned long bx_;
+ unsigned long ax_;
+ int rs_;
+ int gs_;
+ int bs_;
+ int as_;
+
+ private:
+ int decodeMask(unsigned long);
+ void decodeTrueColor24(char*, XColor*, XImage*);
+ void decodeTrueColor32(char*, XColor*, XImage*);
+ void encodeTrueColor24(XColor*, char*, XImage*);
+ void encodeTrueColor24(unsigned char*, XImage*);
+ void encodeTrueColor32(XColor*, char*, XImage*);
+ void encodeTrueColor32(unsigned char*, XImage*);
+
+ protected:
+ void decodeTrueColor(char*, XColor*, XImage*);
+ void encodeTrueColor(XColor*, char*, XImage*);
+ void encodeTrueColor(unsigned char*, XImage*);
+
+ public:
+ TrueColor24(Visual*);
+};
+
+#endif
+