1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
3
* The contents of this file are subject to the Mozilla Public License
4
* Version 1.1 (the "MPL"); you may not use this file except in
5
* compliance with the MPL. You may obtain a copy of the MPL at
6
* http://www.mozilla.org/MPL/
8
* Software distributed under the MPL is distributed on an "AS IS" basis,
9
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the MPL
10
* for the specific language governing rights and limitations under the
13
* Alternatively, the contents of this file may be used under the
14
* terms of the GNU Library General Public License (the "LGPL"), in
15
* which case the provisions of the LGPL are applicable instead of
16
* those above. If you wish to allow use of your version of this file
17
* only under the terms of the LGPL and not to allow others to use
18
* your version of this file under the MPL, indicate your decision by
19
* deleting the provisions above and replace them with the notice and
20
* other provisions required by the LGPL. If you do not delete the
21
* provisions above, a recipient may use your version of this file
22
* under either the MPL or the LGPL.
26
* This code is derived from GdkRgb.
27
* For more information on GdkRgb, see http://www.levien.com/gdkrgb/
28
* Raph Levien <raph@acm.org>
31
/* Ported by Christopher Blizzard to Xlib. With permission from the
32
* original authors of this file, the contents of this file are also
33
* redistributable under the terms of the Mozilla Public license. For
34
* information about the Mozilla Public License, please see the
35
* license information at http://www.mozilla.org/MPL/
38
/* This code is copyright the following authors:
39
* Raph Levien <raph@acm.org>
40
* Manish Singh <manish@gtk.org>
41
* Tim Janik <timj@gtk.org>
42
* Peter Mattis <petm@xcf.berkeley.edu>
43
* Spencer Kimball <spencer@xcf.berkeley.edu>
44
* Josh MacDonald <jmacd@xcf.berkeley.edu>
45
* Christopher Blizzard <blizzard@redhat.com>
46
* Owen Taylor <otaylor@redhat.com>
47
* Shawn T. Amundson <amundson@gtk.org>
51
#ifndef __XLIB_RGB_H__
52
#define __XLIB_RGB_H__
56
#endif /* __cplusplus */
59
#include <X11/Xutil.h>
63
typedef struct _XlibRgbCmap XlibRgbCmap;
66
unsigned int colors[256];
67
unsigned char lut[256]; /* for 8-bit modes */
71
xlib_rgb_init (Display *display, Screen *screen);
73
xlib_rgb_init_with_depth (Display *display, Screen *screen, int prefDepth);
76
xlib_rgb_xpixel_from_rgb (guint32 rgb);
79
xlib_rgb_gc_set_foreground (GC gc, guint32 rgb);
82
xlib_rgb_gc_set_background (GC gc, guint32 rgb);
87
XLIB_RGB_DITHER_NORMAL,
92
xlib_draw_rgb_image (Drawable drawable,
99
unsigned char *rgb_buf,
103
xlib_draw_rgb_image_dithalign (Drawable drawable,
110
unsigned char *rgb_buf,
116
xlib_draw_rgb_32_image (Drawable drawable,
127
xlib_draw_gray_image (Drawable drawable,
138
xlib_rgb_cmap_new (guint32 *colors, int n_colors);
141
xlib_rgb_cmap_free (XlibRgbCmap *cmap);
144
xlib_draw_indexed_image (Drawable drawable,
155
/* Below are some functions which are primarily useful for debugging
156
and experimentation. */
158
xlib_rgb_ditherable (void);
161
xlib_rgb_set_verbose (Bool verbose);
163
/* experimental colormap stuff */
165
xlib_rgb_set_install (Bool install);
168
xlib_rgb_set_min_colors (int min_colors);
171
xlib_rgb_get_cmap (void);
174
xlib_rgb_get_visual (void);
177
xlib_rgb_get_visual_info (void);
180
xlib_rgb_get_depth (void);
183
xlib_rgb_get_display (void);
186
xlib_rgb_get_screen (void);
190
#endif /* __cplusplus */
193
#endif /* __XLIB_RGB_H__ */