1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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
|