Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals

agl_video.h

Go to the documentation of this file.
00001 
00002 /*
00003      ______     __                     ___     __
00004     /\  _  \   /\ \                   /\_ \   /\_\
00005     \ \ \_\ \  \ \ \      __     ___  \//\ \  \/_/_
00006      \ \  __ \ `/__ \   /'__`\  / __`\  \ \ \   /\ \
00007       \ \ \/\ \/\\_\ \_/\ \_\ \/\ \_\ \_ \_\ \_ \_\ \_
00008        \ \_\ \_\ \_____\ \___\ \ \______\/\____\/\____\
00009         \/_/\/_/\/_____/\/___L\ \/______/\/____/\/____/
00010                           /\____/
00011                           \_/__/
00012 
00013 
00014 
00015 
00016                   An advanced game library
00017 
00018                  (c) Stephane APIOU 2003
00019 
00020 
00021     This program is free software; you can redistribute it and/or modify
00022     it under the terms of the GNU General Public License as published by
00023     the Free Software Foundation; either version 2 of the License, or
00024     (at your option) any later version.
00025 
00026     This program is distributed in the hope that it will be useful,
00027     but WITHOUT ANY WARRANTY; without even the implied warranty of
00028     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00029     GNU General Public License for more details.
00030 
00031     You should have received a copy of the GNU General Public License
00032     along with this program; if not, write to the Free Software
00033     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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 /* image manipulation */
00261 
00262 /* Load an image from a data source */
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 /* pixmap manipulation */
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 /* channel manipulation */
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 /* zone manipulation */
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 /* _agl_video_h */

Doc generated at 1 Jul 2003 for, adgali 0.2.3 written by Stephane APIOU, © 2001 Generated by doxygen 1.3.2 ,