00001 #ifndef _XLV_COLORMAP_H
00002 #define _XLV_COLORMAP_H
00003
00004 #include <glib.h>
00005
00006 typedef struct _XLV_ColorMap XLV_ColorMap;
00007 typedef struct _XLV_CMap_Pixel XLV_CMap_Pixel;
00008
00009 #define XLV_CMAP_ALLOCATED 0x01
00010
00011 struct _XLV_CMap_Pixel {
00012 guint16 r, g, b;
00013 guint32 pixel;
00014 guint8 flags;
00015 };
00016
00017 struct _XLV_ColorMap {
00018 XLV_CMap_Pixel *m_colormap;
00019 guint32 m_n_colors;
00020 };
00021
00022 XLV_ColorMap *xlv_colormap_new (guint32 colors);
00023 void xlv_colormap_release (XLV_ColorMap * cmap);
00024
00025 guint32 xlv_colormap_alloc_pixel (XLV_ColorMap * cmap, guint16 r, guint16 g,
00026 guint16 b);
00027 gboolean xlv_colormap_get_pixel (XLV_ColorMap * cmap, XLV_CMap_Pixel * pix,
00028 guint32 pixel);
00029 guint32 xlv_colormap_solve_rgb (XLV_ColorMap * cmap, guint16 r, guint16 g,
00030 guint16 b);
00031
00032 #endif