00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051 #ifndef __XLIB_RGB_H__
00052 #define __XLIB_RGB_H__
00053
00054 #ifdef __cplusplus
00055 extern "C" {
00056 #endif
00057
00058 #include <X11/Xlib.h>
00059 #include <X11/Xutil.h>
00060 #include <X11/Xos.h>
00061 #include <X11/Intrinsic.h>
00062
00063
00064 typedef struct _XlibRgbCmap XlibRgbCmap;
00065
00066 struct _XlibRgbCmap {
00067 unsigned int colors[256];
00068 unsigned char lut[256];
00069 };
00070
00071 void
00072 xlib_rgb_init (Display *display, Screen *screen);
00073 void
00074 xlib_rgb_init_with_depth (Display *display, Screen *screen, int prefDepth);
00075
00076 unsigned long
00077 xlib_rgb_xpixel_from_rgb (unsigned int rgb);
00078
00079 void
00080 xlib_rgb_gc_set_foreground (GC gc, unsigned int rgb);
00081
00082 void
00083 xlib_rgb_gc_set_background (GC gc, unsigned int rgb);
00084
00085 typedef enum
00086 {
00087 XLIB_RGB_DITHER_NONE,
00088 XLIB_RGB_DITHER_NORMAL,
00089 XLIB_RGB_DITHER_MAX
00090 } XlibRgbDither;
00091
00092 void
00093 xlib_draw_rgb_image (Drawable drawable,
00094 GC gc,
00095 int x,
00096 int y,
00097 int width,
00098 int height,
00099 XlibRgbDither dith,
00100 unsigned char *rgb_buf,
00101 int rowstride);
00102
00103 void
00104 xlib_draw_rgb_image_dithalign (Drawable drawable,
00105 GC gc,
00106 int x,
00107 int y,
00108 int width,
00109 int height,
00110 XlibRgbDither dith,
00111 unsigned char *rgb_buf,
00112 int rowstride,
00113 int xdith,
00114 int ydith);
00115
00116 void
00117 xlib_draw_rgb_32_image (Drawable drawable,
00118 GC gc,
00119 int x,
00120 int y,
00121 int width,
00122 int height,
00123 XlibRgbDither dith,
00124 unsigned char *buf,
00125 int rowstride);
00126
00127 void
00128 xlib_draw_gray_image (Drawable drawable,
00129 GC gc,
00130 int x,
00131 int y,
00132 int width,
00133 int height,
00134 XlibRgbDither dith,
00135 unsigned char *buf,
00136 int rowstride);
00137
00138 XlibRgbCmap *
00139 xlib_rgb_cmap_new (unsigned int *colors, int n_colors);
00140
00141 void
00142 xlib_rgb_cmap_free (XlibRgbCmap *cmap);
00143
00144 void
00145 xlib_draw_indexed_image (Drawable drawable,
00146 GC gc,
00147 int x,
00148 int y,
00149 int width,
00150 int height,
00151 XlibRgbDither dith,
00152 unsigned char *buf,
00153 int rowstride,
00154 XlibRgbCmap *cmap);
00155
00156
00157
00158 Bool
00159 xlib_rgb_ditherable (void);
00160
00161 void
00162 xlib_rgb_set_verbose (Bool verbose);
00163
00164
00165 void
00166 xlib_rgb_set_install (Bool install);
00167
00168 void
00169 xlib_rgb_set_min_colors (int min_colors);
00170
00171 Colormap
00172 xlib_rgb_get_cmap (void);
00173
00174 Visual *
00175 xlib_rgb_get_visual (void);
00176
00177 XVisualInfo *
00178 xlib_rgb_get_visual_info (void);
00179
00180 int
00181 xlib_rgb_get_depth (void);
00182
00183 Display *
00184 xlib_rgb_get_display (void);
00185
00186 Screen *
00187 xlib_rgb_get_screen (void);
00188
00189 #ifdef __cplusplus
00190 }
00191 #endif
00192
00193
00194 #endif