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
00040
00049
#ifndef _adgali__video_h
00050
#define _adgali_video_h
00051
00052
00054
00055
00056 #define AGL_RED agl_swapbe32(0XFF000000)
00057 #define AGL_GREEN agl_swapbe32(0X00FF0000)
00058 #define AGL_BLUE agl_swapbe32(0X0000FF00)
00059 #define AGL_ALPHA agl_swapbe32(0X000000FF)
00060
00061
00062
00064
00065 #define AGL_REDVAL(p) (((unsigned char *)(p))[0])
00066 #define AGL_GREENVAL(p) (((unsigned char *)(p))[1])
00067 #define AGL_BLUEVAL(p) (((unsigned char *)(p))[2])
00068 #define AGL_ALPHAVAL(p) (((unsigned char *)(p))[3])
00069
00070
00071
00072
00073
00074 #define AGL_OPAQUE 0XFF
00075 #define AGL_TRANSPARENT 0X00
00076
00077
00079
00080 #define AGL_VALRGBA2LONG(red,green, blue, alpha) AGL_RGBA2LONG(((red)<<24)|((green)<<16)|((blue)<<8)|(alpha))
00081
00082 #define AGL_RGBA2LONG(value) agl_swapbe32(value)
00083
00084
00085
00091 #define AGL_SETRED(value) (agl_swapbe32(value<<24) & AGL_RED)
00092
00094
00100 #define AGL_SETGREEN(value) (agl_swapbe32(value << 16) & AGL_GREEN)
00101
00103
00109 #define AGL_SETBLUE(value) (agl_swapbe32(value << 8) & AGL_BLUE)
00110
00112
00118 #define AGL_SETALPHA(value) (agl_swapbe32(value) & AGL_ALPHA)
00119
00120
00121
00122
00123 #define AGL_FULLSCREEN 1
00124
00125
00126
00128
00129
00130 #define AGL_RGB 0
00131 #define AGL_CMY 1
00132 #define AGL_HSV 2
00133 #define AGL_HLS 3
00134 #define AGL_AVG 4
00135
00136
00137
00138
00139
struct agl_zone;
00140
struct agl_zone_list;
00141
00143
00147 typedef struct
00148
{
00149 short x;
00150 short y;
00151 }
agl_pos;
00152
00154
00158 typedef struct
00159
{
00160 unsigned short width;
00161 unsigned short height;
00162 }
agl_size;
00163
00164
00166
00170 typedef struct
00171
{
00172 short x;
00173 short y;
00174 unsigned short width;
00175 unsigned short height;
00176 }
agl_rect;
00177
00178
typedef struct agl_rectlist
00179 {
00180
agl_rect rect;
00181
struct agl_rectlist *pnext;
00182 } agl_rectlist;
00183
00185
00189 typedef struct
00190
{
00191 agl_size size;
00192 unsigned char *pixels;
00193 unsigned short row_size;
00194 }
agl_channel;
00195
00197
00201 typedef struct
00202
{
00203 agl_size size;
00204 unsigned long *pixels;
00205 unsigned short row_size;
00206 unsigned char alpha;
00207 }
agl_pix;
00208
00209
00210
typedef struct agl_zone
00211 {
00212
agl_pix pix;
00213
char visible;
00214
long zl_nb;
00215
struct agl_zone_list *lower;
00216
struct agl_zone_list *upper;
00217
struct agl_zone_list *uplast;
00218
long flags;
00219 } agl_zone;
00220
00221
typedef struct agl_zone_list
00222 {
00223
unsigned long nb;
00224 agl_zone *zone;
00225
struct agl_zone_list *next;
00226 } agl_zone_list;
00227
00228
typedef struct
00229
{
00230
agl_pix *pix;
00231
unsigned long color_key;
00232
char *image_name;
00233
char *alpha_name;
00234 } agl_image;
00235
00236
typedef struct screen
00237 {
00238 agl_zone zone;
00239
void *sublayer;
00240
char bpp;
00241 } agl_screen;
00242
00243
typedef struct
00244
{
00245
int xo;
00246
int yo;
00247
int wm;
00248
int wx;
00249 } character;
00250
00252
00253
00254 #define ZONE_TILED 0
00255 #define ZONE_OVERLAPED 1
00256 #define ZONE_CONTAINER 2
00257
00258
00259
00260
00261
00262
00263
00264
extern agl_image *agl_imgioload(
agl_ios * filename);
00265
extern void agl_imgfree(agl_image * image);
00266
extern agl_image *agl_imgnew(
int width,
int height);
00267
extern agl_image *agl_imgdup(agl_image * pimg);
00268
00269
00270
00271
extern agl_pix *agl_pixnew(
int width,
int height);
00272
extern void agl_pixfree(
agl_pix * ppix);
00273
extern agl_pix *agl_pixdup(
agl_pix * ppix);
00274
00275
00276
00277
extern agl_channel *agl_channew(
int width,
int height);
00278
extern void agl_chanfree(
agl_channel * channel);
00279
extern agl_channel *agl_chandup(
agl_channel * channel);
00280
extern int agl_frompixmap(
int type,
agl_rect * rect,
agl_pix * pix,
agl_channel ** alpha,
agl_channel ** ch1,
agl_channel ** ch2,
00281
agl_channel ** ch3);
00282
extern int agl_topixmap(
int type,
agl_rect * rect,
agl_pix * pix,
agl_channel * alpha,
agl_channel * ch1,
agl_channel * ch2,
00283
agl_channel * ch3);
00284
00285
00286
00287
00288
00289
extern int agl_fillzone(agl_zone * pzone,
int width,
int height,
int flags);
00290
extern void agl_emptyzone(agl_zone * pzone);
00291
extern agl_zone *agl_createzone(
int width,
int height,
int flags);
00292
extern void agl_freezone(agl_zone * zone,
int cascade);
00293
extern void agl_originzone(agl_zone * zone,
int x,
int y);
00294
00295
00297
00298
00299 #define PIX_ID 0
00300 #define PIX_SYM0 1
00301 #define PIX_SYM45 2
00302 #define PIX_SYM90 3
00303 #define PIX_SYM135 4
00304 #define PIX_ROT90 5
00305 #define PIX_ROT180 6
00306 #define PIX_ROT270 7
00307
00308
00309
00311
00328 #define agl_pixcat(psrc, pdst, psrcrect, pdstrect, pos) agl_pixtranscat(psrc, pdst, psrcrect, pdstrect, pos, PIX_ID)
00329
00331
00347 #define agl_pixalpha(psrc, pdst, psrcrect, pdstrect, pos) agl_pixtransalpha(psrc, pdst, psrcrect, pdstrect, pos, PIX_ID)
00348
00350
00369
extern int agl_pixtranscat(
agl_pix * psrc,
agl_pix * pdst,
agl_rect * psrcrect,
agl_rect * pdstrect,
agl_pos * pos,
int type);
00370
00372
00390
extern int agl_pixtransalpha(
agl_pix * psrc,
agl_pix * pdst,
agl_rect * psrcrect,
agl_rect * pdstrect,
agl_pos * pos,
int type);
00391
00392
extern int agl_pixfill(
agl_pix * ptr,
agl_rect * rect,
unsigned long color);
00393
extern int agl_pixset(
agl_pix * ptr,
agl_rect * rect,
unsigned long mask,
unsigned long color);
00394
extern int agl_pixkey(
agl_pix * ptr,
agl_rect * rect,
unsigned long color);
00395
extern int agl_sublayersetvid(agl_handle handle,
int width,
int height,
int flag);
00396
extern int agl_sublayergetvidsz(agl_handle handle,
int flags,
int **h,
int **w);
00397
00398
#endif