64bit fixes
[AROS-Contrib.git] / vpdf / system / chunky.h
blobed4c2d43b66e74157f72e9780d2e3a62875fd9a9
1 /*
2 chunky.h
4 Chunky image structure definition.
5 v1.0 translated from AmigaE.
6 */
8 #ifndef _CHUNKY_H
9 #define _CHUNKY_H
11 typedef union
13 unsigned char *dataB;
14 unsigned int *dataL;
15 unsigned short *dataW;
16 } dataPointer;
18 typedef struct chkimage
20 int width,height;
21 union
23 unsigned char *b;
24 unsigned int *l;
25 unsigned short *w;
26 void *p;
27 }data ;
28 int pixfmt; /* image format (CHK_PIXFMTXXX) */
29 } ChkImage;
31 typedef struct texture
33 struct texture *next; /* for list support */
34 struct texture *prev;
36 ChkImage *image;
37 int private; /* is texture used as private in engine */
39 char *name; /* texture filename */
40 char *alphaname; /* texture's alphaimage filename */
41 int openc; /* opening count */
42 ChkImage *second; /* this is allocated with txt_AllocSecondBuffer() */
44 float x0,y0,scale;
45 float x,y;
46 int filtered;
47 int additive;
48 int substractive;
49 float transparency;
51 void *rendererTexture; /* renderer specific data */
52 void *env; /* enviroment. used by some functions. */
54 char *type; /* */
56 } Texture;
58 ChkImage* chkCreate( int width, int height, int format, int zero );
59 void chkFree(ChkImage *image);
61 ChkImage* chk_AllocImageStruct(int,int);
64 ChkImage* chk_Duplicate(struct chkimage *);
65 ChkImage *chkResize(ChkImage *img, int width, int height, int filter);
66 ChkImage *chkResizeExt(ChkImage *img, int width, int height, int destfmt, int flags);
67 void chkResizeInplace(ChkImage *img, int width, int height, int filter);
68 void chk_DimRadial(struct chkimage *,float);
69 void chk_Clear(struct chkimage *i,int k);
70 void chk_Copy(struct chkimage *simage,struct chkimage *dimage);
71 ChkImage* chk_CreateImageFromMem(void *memory,int width,int height);
72 void chk_DimRadialXY(struct chkimage *image,int x,int y,int r,float factor);
74 int chkGetBytesPerPixel( ChkImage *img );
75 int fmtGetBytesPerPixel( int format );
78 void chk_CopyArea(struct chkimage *i1,int sx,int sy,struct chkimage *i2);
80 void txt_Negative(struct texture *txt);
81 void txt_Spherical(struct texture *txt);
83 void chk_ReadARGBPixel(struct chkimage *img, int x, int y, int *a, int *r, int *g, int *b);
84 void chk_WriteARGBPixel(struct chkimage *img, int x, int y, int a, int r, int g, int b);
85 #define chkReadARGBPixel chk_ReadARGBPixel
86 #define chkWriteARGBPixel chk_WriteARGBPixel
88 void chkFillImage(ChkImage *img, int r, int g, int b, int a);
89 int chkHasAlphaInformation(ChkImage *img);
91 void chkConvert(unsigned char *src, int sfmt, unsigned char *dst, int dfmt, int width, int height);
94 // chkuny image pixel formats
95 // CHK_PIXFMT_RGB565 - used for normal textures
96 // CHK_PIXFMT_ARGB4444 - used for textures with alpha channel
97 // CHK_PIXFMT_ARGB8888 - used for high quality textures
100 #define CHK_PIXFMT_RGB888 0
101 #define CHK_PIXFMT_RGBA8888 1
102 #define CHK_PIXFMT_RGB565 2
103 #define CHK_PIXFMT_LUT 3
104 #define CHK_PIXFMT_ARGB4444 4
105 #define CHK_PIXFMT_RGBA5551 5
106 #define CHK_PIXFMT_ARGB1555 6
107 #define CHK_PIXFMT_ARGB8888 7
108 #define CHK_PIXFMT_LUMINANCE 8
109 #define CHK_PIXFMT_ALPHA 9
110 #define CHK_PIXFMT_YUV422 10
111 #define CHK_PIXFMT_YUV422C 11
113 #define CHK_CHANNEL_LUMINANCE 1
114 #define CHK_CHANNEL_CHROMINANCE 2
115 #define CHK_CHANNEL_SATURATION 4
116 #define CHK_CHANNEL_Y 8
117 #define CHK_CHANNEL_U 16
118 #define CHK_CHANNEL_V 32
119 #define CHK_CHANNEL_R 64
120 #define CHK_CHANNEL_G 128
121 #define CHK_CHANNEL_B 256
123 #endif