summaryrefslogtreecommitdiffstats
path: root/doc/man/man3/tqglcolormap.3qt
blob: 2b614ad6006833233a8d63601f8f7515190cf2b5 (plain)
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
'\" t
.TH TQGLColormap 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*-
.\" Copyright 1992-2007 Trolltech ASA.  All rights reserved.  See the
.\" license file included in the distribution for a complete license
.\" statement.
.\"
.ad l
.nh
.SH NAME
TQGLColormap \- Used for installing custom colormaps into TQGLWidgets
.SH SYNOPSIS
\fC#include <tqglcolormap.h>\fR
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "\fBTQGLColormap\fR ()"
.br
.ti -1c
.BI "\fBTQGLColormap\fR ( const TQGLColormap & map )"
.br
.ti -1c
.BI "\fB~TQGLColormap\fR ()"
.br
.ti -1c
.BI "TQGLColormap & \fBoperator=\fR ( const TQGLColormap & map )"
.br
.ti -1c
.BI "bool \fBisEmpty\fR () const"
.br
.ti -1c
.BI "int \fBsize\fR () const"
.br
.ti -1c
.BI "void \fBdetach\fR ()"
.br
.ti -1c
.BI "void \fBsetEntries\fR ( int count, const TQRgb * colors, int base = 0 )"
.br
.ti -1c
.BI "void \fBsetEntry\fR ( int idx, TQRgb color )"
.br
.ti -1c
.BI "void \fBsetEntry\fR ( int idx, const TQColor & color )"
.br
.ti -1c
.BI "TQRgb \fBentryRgb\fR ( int idx ) const"
.br
.ti -1c
.BI "TQColor \fBentryColor\fR ( int idx ) const"
.br
.ti -1c
.BI "int \fBfind\fR ( TQRgb color ) const"
.br
.ti -1c
.BI "int \fBfindNearest\fR ( TQRgb color ) const"
.br
.in -1c
.SH DESCRIPTION
The TQGLColormap class is used for installing custom colormaps into TQGLWidgets.
.PP
TQGLColormap provides a platform independent way of specifying and installing indexed colormaps into TQGLWidgets. TQGLColormap is especially useful when using the OpenGL color-index mode.
.PP
Under X11 you must use an X server that supports either a \fCPseudoColor\fR or \fCDirectColor\fR visual class. If your X server currently only provides a \fCGrayScale\fR, \fCTrueColor\fR, \fCStaticColor\fR or \fCStaticGray\fR visual, you will not be able to allocate colorcells for writing. If this is the case, try setting your X server to 8 bit mode. It should then provide you with at least a \fCPseudoColor\fR visual. Note that you may experience colormap flashing if your X server is running in 8 bit mode.
.PP
Under Windows the size of the colormap is always set to 256 colors. Note that under Windows you can also install colormaps in child widgets.
.PP
This class uses explicit sharing (see Shared Classes).
.PP
Example of use:
.PP
.nf
.br
    #include <ntqapplication.h>
.br
    #include <tqglcolormap.h>
.br
.br
    int main()
.br
    {
.br
        QApplication a( argc, argv );
.br
.br
        MySuperGLWidget widget( 0 ); // A TQGLWidget in color-index mode
.br
        TQGLColormap colormap;
.br
.br
        // This will fill the colormap with colors ranging from
.br
        // black to white.
.br
        for ( int i = 0; i < colormap.size(); i++ )
.br
            colormap.setEntry( i, tqRgb( i, i, i ) );
.br
.br
        widget.setColormap( colormap );
.br
        widget.show();
.br
        return a.exec();
.br
    }
.br
.fi
.PP
See also TQGLWidget::setColormap(), TQGLWidget::colormap(), Graphics Classes, and Image Processing Classes.
.SH MEMBER FUNCTION DOCUMENTATION
.SH "TQGLColormap::TQGLColormap ()"
Construct a TQGLColormap.
.SH "TQGLColormap::TQGLColormap ( const TQGLColormap & map )"
Construct a shallow copy of \fImap\fR.
.SH "TQGLColormap::~TQGLColormap ()"
Dereferences the TQGLColormap and deletes it if this was the last reference to it.
.SH "void TQGLColormap::detach ()"
Detaches this TQGLColormap from the shared block.
.SH "TQColor TQGLColormap::entryColor ( int idx ) const"
Returns the TQRgb value in the colorcell with index \fIidx\fR.
.SH "TQRgb TQGLColormap::entryRgb ( int idx ) const"
Returns the TQRgb value in the colorcell with index \fIidx\fR.
.SH "int TQGLColormap::find ( TQRgb color ) const"
Returns the index of the color \fIcolor\fR. If \fIcolor\fR is not in the map, -1 is returned.
.SH "int TQGLColormap::findNearest ( TQRgb color ) const"
Returns the index of the color that is the closest match to color \fIcolor\fR.
.SH "bool TQGLColormap::isEmpty () const"
Returns TRUE if the colormap is empty; otherwise returns FALSE. A colormap with no color values set is considered to be empty.
.SH "TQGLColormap & TQGLColormap::operator= ( const TQGLColormap & map )"
Assign a shallow copy of \fImap\fR to this TQGLColormap.
.SH "void TQGLColormap::setEntries ( int count, const TQRgb * colors, int base = 0 )"
Set an array of cells in this colormap. \fIcount\fR is the number of colors that should be set, \fIcolors\fR is the array of colors, and \fIbase\fR is the starting index.
.SH "void TQGLColormap::setEntry ( int idx, TQRgb color )"
Set cell at index \fIidx\fR in the colormap to color \fIcolor\fR.
.SH "void TQGLColormap::setEntry ( int idx, const TQColor & color )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Set the cell with index \fIidx\fR in the colormap to color \fIcolor\fR.
.SH "int TQGLColormap::size () const"
Returns the number of colorcells in the colormap.

.SH "SEE ALSO"
.BR http://doc.trolltech.com/tqglcolormap.html
.BR http://www.trolltech.com/faq/tech.html
.SH COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com.  See the
license file included in the distribution for a complete license
statement.
.SH AUTHOR
Generated automatically from the source code.
.SH BUGS
If you find a bug in Qt, please report it as described in
.BR http://doc.trolltech.com/bughowto.html .
Good bug reports help us to help you. Thank you.
.P
The definitive TQt documentation is provided in HTML format; it is
located at $TQTDIR/doc/html and can be read using TQt Assistant or with
a web browser. This man page is provided as a convenience for those
users who prefer man pages, although this format is not officially
supported by Trolltech. 
.P
If you find errors in this manual page, please report them to
.BR qt-bugs@trolltech.com .
Please include the name of the manual page (tqglcolormap.3qt) and the Qt
version (3.3.8).