/****************************************************************************************/
/*                                                                                      */
/*              load_bitmap.h                                                           */
/*                                                                                      */
/****************************************************************************************/

//
// Modifications History
//
//$LB (09/06/2003) : add _SAVEbitmap
//
//$LB (22/07/2003) : add _DIBbitmap to easy the process of Multimedia objects
//
//$LB (11/12/2003) : add _DRAWgradient to draw a gradient color into a bitmap
//
//$LB (12/12/2003) : add _BLURbitmap to process a gaussian blur into a bitmap 
//
//$LB (14/12/2003) : add _CAPTUREscreen to capture a screen area into a bitmap
//
//$LB (15/12/2003) : add _CRmaskFromBitmap to create an grayscale alpha mask from a bitmap
//
//$LB (01/02/2004) : add _CPbitmap24, _DRAWpoly24, _GETpixel24, _PUTpixel24
//
//$LB (10/05/2004) : add _GETbitmapBGR, _SETbitmapBGR, _STEREObitmap
//
#ifndef _LOAD_BITMAP_H_
#define _LOAD_BITMAP_H_




#include "objects/bitmap.h"


/************************************************************************************/
/*                                                                                  */
/*          Package sur les bitmp et buffer graphique                               */
/*                                                                                  */
/************************************************************************************/



#define BITMAPPKGSIZE 70

char * bitmappkgname [ BITMAPPKGSIZE ] = {
    "_FILLbitmap" , "_LDbitmap" , "_GETbitmapSize" , "_CRbitmap" , 
    "_BLTbitmap" , "_DRAWrectangle" , "_DRAWline" , "_DRAWcircle" ,
    "_DRAWtext" , "_LDbitmap8" , "_BLTbitmap8" , "_FILLbitmap8" ,
    "_GETbitmap8Size" , "_DRAWrectangle8" , "_DRAWline8" , "_DRAWcircle8" ,
    "_DRAWtext8" , "_CRbitmap8" , "_DSbitmap8" , "_DSbitmap" ,
    "_GETbitmapPalette" , "_SETbitmapPalette" ,"_CPbitmap8" , "_CPbitmap" ,
    "_AFFbitmapPalette" , "_GETbitmap" , "_GETbitmap8" , "_SETbitmap" ,
    "_SETbitmap8" , "_SCPbitmap8" , "_SCPbitmap"  ,
    "_MAPbitmap" , "_FILEbitmap" , "_FILEbitmap8" , "_CPWbitmap", 
    "_CPWbitmap8" , "_CPbitmap16" ,"_GETpixel8" , "_GETpixel16" ,
    "_DRAWpoly16" , "_PUTpixel16" , "_PUTpixel8" , "_ANDbitmap" ,
    "_ORbitmap", "_XORbitmap", "_PLUSbitmap" , "_MINUSbitmap" ,
    "_SPLUSbitmap" , "_SMINUSbitmap" , "_NOTbitmap" , "_MULbitmap",
    "_DRAWrectangleText", "_STBLTbitmap" , "_STBLTbitmap8" ,"_drawIconExe",
	"_infoIconExe", "_BLTwindow",
	//$LB (09/06/2003) 
	"_SAVEbitmap",
	//$LB (22/07/2003)
	"_DIBbitmap",
	//$LB (11/12/2003)
	"_DRAWgradient",
	//$LB (12/12/2003)
	"_BLURbitmap",
	//$LB (14/12/2003)
	"_CAPTUREscreen",
	//$LB (15/12/2003)
	"_CRmaskFromBitmap",
	//$LB (01/02/2004)
	"_CPbitmap24", "_DRAWpoly24", "_GETpixel24", "_PUTpixel24",
	//$LB (10/05/2004)
	"_GETbitmapBGR", "_SETbitmapBGR", "_STEREObitmap"



} ;        


char * bitmappkgtype [ BITMAPPKGSIZE ] = {
    "fun [ObjBitmap I ] ObjBitmap" ,                        /* _fill_bitmap                 */
    "fun [ Chn P ] ObjBitmap" ,                             /* _load_bitmap                 */
    "fun [ ObjBitmap ] [I I]",                              /* _get_bitmap_size             */
    "fun [ Chn I I ] ObjBitmap" ,                           /* _create_bitmap               */
    "fun [ ObjWin ObjBitmap I I ] ObjWin" ,                 /* _blit_bitmap                 */
    "fun [ ObjBitmap I I I I I I I I I] ObjBitmap",         /* _draw_rectangle              */
    "fun [ ObjBitmap I I I I I I I ] ObjBitmap" ,           /* _draw_line                   */
    "fun [ ObjBitmap I I I I I I I I] ObjBitmap" ,          /* _draw_circle                 */
    "fun [ ObjBitmap ObjFont I I I I S] ObjBitmap" ,        /* _draw_text                   */       
    "fun [ Chn P ] ObjBitmap8" ,                            /* _load_bitmap8                */
    "fun [ ObjWin ObjBitmap8 I I ] ObjWin" ,                /* _blit_bitmap8                */
    "fun [ ObjBitmap8 I ] ObjBitmap8" ,                     /* _fill_bitmap8                */
    "fun [ ObjBitmap8 ] [ I I ]" ,                          /* _get_bitmap8_size            */
    "fun [ ObjBitmap8 I I I I I I I I I] ObjBitmap8",       /* _draw_rectangle8             */
    "fun [ ObjBitmap8 I I I I I I I ] ObjBitmap8" ,         /* _draw_line8                  */
    "fun [ ObjBitmap8 I I I I I I I I ] ObjBitmap8" ,       /* _draw_circle8                */
    "fun [ ObjBitmap8 ObjFont I I I I S] ObjBitmap8" ,      /* _draw_text8                  */
    "fun [ Chn I I ] ObjBitmap8" ,                          /* _create_bitmap8              */
    "fun [ ObjBitmap8] I",                                  /* _destroy_bitmap8             */
    "fun [ ObjBitmap ] I" ,                                 /* _destroy_bitmap              */
    "fun [ ObjBitmap8 ] tab  I " ,                          /* _get_bitmap_palette          */
    "fun [ ObjBitmap8 tab I ] ObjBitmap8" ,                 /* _set_bitmap_palette          */
    "fun [ ObjBitmap8 I I ObjBitmap8 I I I I I] ObjBitmap8",/* _copy_bitmap8                */
    "fun [ ObjBitmap I I ObjBitmap8 I I I I I] ObjBitmap" , /* _copy_bitmap8_16             */
    "fun [ ObjBitmap8 tab I ] ObjBitmap8" ,                 /* _aff_bitmap_palette          */
    "fun [ ObjBitmap ] S" ,                                 /* _get_bitmap                  */
    "fun [ ObjBitmap8 ] S",                                 /* _get_bitmap8                 */
    "fun [ ObjBitmap S ] ObjBitmap" ,                       /* _set_bitmap                  */
    "fun [ ObjBitmap8 S ] ObjBitmap8",                      /* _set_bitmap8                 */
    "fun [ObjBitmap8 I I I I ObjBitmap8 I I I I I ] ObjBitmap8",/*  _stretch_bitmap8        */
    "fun [ObjBitmap I I I I ObjBitmap I I I I I ] ObjBitmap",/* stretch_bitmap8             */
    
    "fun [ ObjBitmap I I I I I I I I ObjBitmap I I I I I ] ObjBitmap" , /* _map_bitmap      */  
    "fun [ ObjBitmap ] S" ,                                  /* _file_bitmap                */ 
    "fun [ ObjBitmap8 ] S",                                  /* _file_bitmap8               */ 
    "fun [ ObjWin I I ObjBitmap I I I I ] ObjWin" ,          /* _copy_bitmap_window         */ 
    "fun [ ObjWin I I ObjBitmap8 I I I I ] ObjWin" ,         /* _copy_bitmap_window8        */ 
    "fun [ ObjBitmap I I ObjBitmap I I I I I] ObjBitmap" ,   /* _copy_bitmap8_16            */ 
    "fun [ObjBitmap8 I I ] I" ,                              /* _get_pixel_8                */ 
    "fun [ObjBitmap I I ] I" ,                               /* _get_pixel_16               */ 
    "fun [ObjBitmap I tab [I I] I I I I I] ObjBitmap"  ,     /* _draw_poly_16               */ 
    "fun [ObjBitmap I I I] ObjBitmap" ,                      /* _put_pixel16                */ 
    "fun [ObjBitmap8 I I I ] ObjBitmap8",                    /* _put_pixel8                 */ 
    "fun [ObjBitmap I I I I ObjBitmap I I] ObjBitmap",       /* _and_bitmap                 */ 
    "fun [ObjBitmap I I I I ObjBitmap I I] ObjBitmap",       /* _or_bitmap                  */ 
    "fun [ObjBitmap I I I I ObjBitmap I I] ObjBitmap",       /* _xor_bitmap                 */ 
    "fun [ObjBitmap I I I I ObjBitmap I I] ObjBitmap",       /* _plus_bitmap                */ 
    "fun [ObjBitmap I I I I ObjBitmap I I] ObjBitmap",       /*_minus_bitmap                */ 
    "fun [ObjBitmap I I I I ObjBitmap I I] ObjBitmap",       /* _plus_bitmap avec saturation*/ 
    "fun [ObjBitmap I I I I ObjBitmap I I] ObjBitmap",       /* _minus_bitmap + saturation  */ 
    "fun [ObjBitmap I I I I] ObjBitmap" ,                    /* _not_bitmap                 */ 
    "fun [ObjBitmap I I I I F F F I] ObjBitmap",             /* mul_bitmap                  */ 
    "fun [ObjBitmap ObjFont I I I I I I S] ObjBitmap",       /* _draw_rectangle_text        */ 
            
    "fun [ObjWin I I I I ObjBitmap I I I I] ObjWin",        /* strectcht blit               */ 
    "fun [ObjWin I I I I ObjBitmap8 I I I I] ObjWin" ,      /* stretch blit 8 bits          */ 
    "fun [S S ObjBitmap I I I] I",
    "fun [S S I] [I I]", 
    "fun [ObjBitmap I I ObjWin I I I I ] ObjBitmap",
	//$LB (09/06/2003) 
	"fun [ObjBitmap W] ObjBitmap",                          /* _SAVEbitmap                   */
	//$LB (22/07/2003)
	"fun [ObjBitmap] ObjBitmap",                            /* _DIBbitmap                    */
    //$LB (11/12/2003)
	"fun [ObjBitmap I I I I I I I] ObjBitmap",              /* _DRAWgradient                 */
	//$LB (12/12/2003)
	"fun [ObjBitmap I I I I I I] ObjBitmap",                /* _BLURbitmap                   */
	//$LB (14/12/2003)
	"fun [ObjBitmap I I I I] ObjBitmap",                    /* _CAPTUREscreen                */
	//$LB (15/12/2003)
    "fun [Chn ObjBitmap I I] ObjBitmap8",                   /* _CRmaskFromBitmap             */
	//$LB (01/02/2004)
	"fun [ObjBitmap I I ObjBitmap I I I I I] ObjBitmap" ,   /* _CPbitmap24                   */ 
    "fun [ObjBitmap I tab [I I] I I I I I] ObjBitmap"  ,    /* _DRAWpoly24                   */ 
    "fun [ObjBitmap I I ] I" ,                              /* _GETpixel24                   */ 
    "fun [ObjBitmap I I I] ObjBitmap" ,                     /* _PUTpixel24                   */ 
	//$LB (10/05/2004)
	"fun [Chn ObjBitmap] [ObjBitmap8 ObjBitmap8 ObjBitmap8]",       // _GETbitmapBGR
	"fun [ObjBitmap [ObjBitmap8 ObjBitmap8 ObjBitmap8]] ObjBitmap", // _SETbitmapBGR
	"fun [ObjBitmap ObjBitmap ObjBitmap] ObjBitmap"	            // _STEREObitmap,

 
} ;

#define NARG_FILL_BITMAP                2
#define NARG_LOAD_BITMAP                2
#define NARG_GET_BITMAP_SIZE            1
#define NARG_CREATE_BITMAP              3
#define NARG_BLIT_BITMAP                4
#define NARG_DRAW_RECTANGLE             10
#define NARG_DRAW_LINE                  8
#define NARG_DRAW_TEXT                  7
#define NARG_DRAW_CIRCLE                9
#define NARG_LOAD_BITMAP8               2
#define NARG_BLIT_BITMAP8               4
#define NARG_FILL_BITMAP8               2
#define NARG_GET_BITMAP8_SIZE           1
#define NARG_DRAW_RECTANGLE8            10
#define NARG_DRAW_LINE8                 8
#define NARG_DRAW_CIRCLE8               9
#define NARG_DRAW_TEXT8                 7
#define NARG_CREATE_BITMAP8             3
#define NARG_DESTROY_BITMAP8            1
#define NARG_DESTROY_BITMAP             1
#define NARG_GET_BITMAP_PALETTE         1
#define NARG_SET_BITMAP_PALETTE         2
#define NARG_COPY_BITMAP8               9
#define NARG_COPY_BITMAP8_16            9
#define NARG_AFF_BITMAP_PALETTE         2
#define NARG_GET_BITMAP                 1
#define NARG_SET_BITMAP                 2
#define NARG_STRETCH_BITMAP             11
#define NARG_MAP_BITMAP                 15
#define NARG_FILE_BITMAP                1
#define NARG_COPYWIN_BITMAP             8
#define NARG_COPY_BITMAP16              9
#define NARG_GET_PIXEL                  3
#define NARG_DRAW_POLY                  8
#define NARG_PUTPIXEL                   4
#define NARG_AND_BITMAP                 8
#define NARG_OR_BITMAP                  8
#define NARG_XOR_BITMAP                 8
#define NARG_PLUS_BITMAP                8
#define NARG_MINUS_BITMAP               8
#define NARG_SPLUS_BITMAP               8
#define NARG_SMINUS_BITMAP              8
#define NARG_NOT_BITMAP                 5
#define NARG_MUL_BITMAP                 9
#define NARG_DRAW_RECT_TEXT             9
#define NARG_STRETCH_BLIT               10
//$LB (09/06/2003) : _SAVEbitmap
#define NARG_SAVEBITMAP                 2
//$LB (22/07/2003)
#define NARG_DIBBITMAP                  1
//$LB (11/12/2003)
#define NARG_DRAWGRADIENT               8
//$LB (12/12/2003)
#define NARG_BLURBITMAP                 7
//$LB (14/12/2003)
#define NARG_CAPTURESCREEN              5
//$LB (15/12/2003)
#define NARG_CRMASKFROMBITMAP           4



int bitmappkgarg [BITMAPPKGSIZE ]= {
    NARG_FILL_BITMAP , NARG_LOAD_BITMAP , NARG_GET_BITMAP_SIZE , NARG_CREATE_BITMAP ,
    NARG_BLIT_BITMAP , NARG_DRAW_RECTANGLE , NARG_DRAW_LINE , NARG_DRAW_CIRCLE ,
    NARG_DRAW_TEXT , NARG_LOAD_BITMAP8 , NARG_BLIT_BITMAP8 , NARG_FILL_BITMAP8 ,
    NARG_GET_BITMAP8_SIZE , NARG_DRAW_RECTANGLE8 , NARG_DRAW_LINE8 , NARG_DRAW_CIRCLE8 ,
    NARG_DRAW_TEXT8 , NARG_CREATE_BITMAP8 , NARG_DESTROY_BITMAP8 , NARG_DESTROY_BITMAP ,
    NARG_GET_BITMAP_PALETTE , NARG_SET_BITMAP_PALETTE , NARG_COPY_BITMAP8 , NARG_COPY_BITMAP8_16 ,
    NARG_AFF_BITMAP_PALETTE , NARG_GET_BITMAP , NARG_GET_BITMAP , NARG_SET_BITMAP ,
    NARG_SET_BITMAP , NARG_STRETCH_BITMAP , NARG_STRETCH_BITMAP , 
    NARG_MAP_BITMAP , NARG_FILE_BITMAP , NARG_FILE_BITMAP , NARG_COPYWIN_BITMAP ,
    NARG_COPYWIN_BITMAP , NARG_COPY_BITMAP16 , NARG_GET_PIXEL , NARG_GET_PIXEL ,
    NARG_DRAW_POLY , NARG_PUTPIXEL , NARG_PUTPIXEL , NARG_AND_BITMAP ,
    NARG_OR_BITMAP , NARG_XOR_BITMAP, NARG_PLUS_BITMAP , NARG_MINUS_BITMAP ,
    NARG_SPLUS_BITMAP , NARG_SMINUS_BITMAP , NARG_NOT_BITMAP , NARG_MUL_BITMAP ,
    NARG_DRAW_RECT_TEXT , NARG_STRETCH_BLIT , NARG_STRETCH_BLIT ,6, 3, 8,
	//$LB (09/06/2003) 
	NARG_SAVEBITMAP,
	//$LB (22/07/2003)
	NARG_DIBBITMAP,
	//$LB (11/12/2003)
	NARG_DRAWGRADIENT,
	//$LB (12/12/2003)
	NARG_BLURBITMAP,
	//$LB (14/12/2003)
	NARG_CAPTURESCREEN,
	//$LB (15/12/2003)
    NARG_CRMASKFROMBITMAP,
	//$LB (01/02/2004)
	9,8,3,4,
	//$LB (10/05/2004) : _GETbitmapBGR, _SETbitmapBGR, _STEREObitmap
	2,2,3


} ;


int _TEST (mmachine m);

int (*bitmappkgfun [ BITMAPPKGSIZE ] ) ( mmachine m ) = {
    GREmptyBuffer , GRLoadBitmap , GRGetBitmapSize , GRCreateBitmap ,
    GRBlitBitmap , GRDrawRectangle , GRDrawLine , GRDrawCircle ,
    GRTextOut , GRLoadBitmap8 , GRBlitBitmap , GREmptyBuffer ,
    GRGetBitmapSize , GRDrawRectangle , GRDrawLine , GRDrawCircle ,
    GRTextOut , GRCreateBitmap8 , GRDestroyBitmap , GRDestroyBitmap ,
    GRGetBitmapPalette , GRSetBitmapPalette , GRCopyBitmap , GRCopyBitmap ,
    GRAffBitmapPalette , GRGetBitmap , GRGetBitmap , GRSetBitmap ,
    GRSetBitmap , GRStretchBitmap , GRStretchBitmap ,
    GRMapBitmap , GRFileBitmap , GRFileBitmap , GRCopyWinBitmap ,
    GRCopyWinBitmap , GRCopyBitmap , GRGetPixel , GRGetPixel ,
    GRDrawPoly , GRPutPixel , GRPutPixel , GRAndBitmap ,
    GROrBitmap , GRXorBitmap , GRPlusBitmap, GRMinusBitmap,
    GRSPlusBitmap, GRSMinusBitmap,GRNotBitmap, GRMulBitmap ,
    GRDrawRectangleText,GRStretchBlit , GRStretchBlit ,GRdrawIcon,
	GRinfoIcon, GRCopyWindow,
	//$LB (09/06/2003) 
	_SAVEbitmap,
	//$LB (22/07/2003)
	DIBbitmap,
	//$LB (11/12/2003)
	_DRAWgradient,
	//$LB (12/12/2003)
	_BLURbitmap,
	//$LB (14/12/2003)
	_CAPTUREscreen,
	//$LB (15/12/2003)
	_CRmaskFromBitmap,
	//$LB (01/02/2004)
	GRCopyBitmap, GRDrawPoly, GRGetPixel, GRPutPixel,
	//$LB (10/05/2004)
	_GETbitmapBGR, _SETbitmapBGR, _STEREObitmap

} ;


#endif
