summaryrefslogtreecommitdiff
path: root/iup/src/iup_image.h
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2009-11-04 11:56:41 -0800
committerPixel <pixel@nobis-crew.org>2009-11-04 11:59:33 -0800
commitd577d991b97ae2b5ee1af23641bcffc3f83af5b2 (patch)
tree590639d50205d1bcfaff2a7d2dc6ebf3f373c7ed /iup/src/iup_image.h
Initial import. Contains the im, cd and iup librairies, and a "working" Makefile for them under linux.
Diffstat (limited to 'iup/src/iup_image.h')
-rwxr-xr-xiup/src/iup_image.h61
1 files changed, 61 insertions, 0 deletions
diff --git a/iup/src/iup_image.h b/iup/src/iup_image.h
new file mode 100755
index 0000000..89e6795
--- /dev/null
+++ b/iup/src/iup_image.h
@@ -0,0 +1,61 @@
+/** \file
+ * \brief Image Resource Private Declarations
+ *
+ * See Copyright Notice in "iup.h"
+ */
+
+#ifndef __IUP_IMAGE_H
+#define __IUP_IMAGE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void* iupdrvImageCreateMask(Ihandle *ih);
+void* iupdrvImageCreateIcon(Ihandle *ih);
+void* iupdrvImageCreateCursor(Ihandle *ih);
+void* iupdrvImageCreateImage(Ihandle *ih, const char* bgcolor, int make_inactive);
+
+enum {IUPIMAGE_IMAGE, IUPIMAGE_ICON, IUPIMAGE_CURSOR};
+void* iupdrvImageLoad(const char* name, int type);
+void iupdrvImageDestroy(void* handle, int type);
+int iupdrvImageGetInfo(void* handle, int *w, int *h, int *bpp); /* only for IUPIMAGE_IMAGE */
+
+void* iupImageGetMask(const char* name);
+void* iupImageGetIcon(const char* name);
+void* iupImageGetCursor(const char* name);
+void* iupImageGetImage(const char* name, Ihandle* parent, int make_inactive);
+void iupImageGetInfo(const char* name, int *w, int *h, int *bpp);
+void iupImageUpdateParent(Ihandle *parent);
+void iupImageClearCache(Ihandle* ih, void* handle);
+
+typedef struct _iupColor {
+ unsigned char r, g, b, a;
+} iupColor;
+
+int iupImageInitColorTable(Ihandle *ih, iupColor* colors, int *colors_count);
+void iupImageInitNonBgColors(Ihandle* ih, unsigned char *colors);
+void iupImageColorMakeInactive(unsigned char *r, unsigned char *g, unsigned char *b,
+ unsigned char bg_r, unsigned char bg_g, unsigned char bg_b);
+int iupImageNormBpp(int bpp);
+
+#define iupALPHABLEND(_src,_dst,_alpha) (unsigned char)(((_src) * (_alpha) + (_dst) * (255 - (_alpha))) / 255)
+
+/* In Windows, RAW data is a DIB handle.
+ imgdata here is bottom-up arranged and has separated planes */
+void* iupdrvImageCreateImageRaw(int width, int height, int bpp, iupColor* colors, int colors_count, unsigned char *imgdata);
+int iupdrvImageGetRawInfo(void* handle, int *w, int *h, int *bpp, iupColor* colors, int *colors_count);
+void iupdrvImageGetRawData(void* handle, unsigned char* imgdata);
+
+void iupImageStockInit(void);
+void iupImageStockFinish(void);
+typedef Ihandle* (*iupImageStockCreateFunc)(void);
+void iupImageStockSet(const char *name, iupImageStockCreateFunc func, const char* native_name);
+void iupImageStockLoad(const char *name); /* Used only in iupImageLibLoadAll */
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif