/********************************************/
/*                                          */
/* bitmap.h                                 */
/*                                          */
/********************************************/


//
// Modifications History
//
//$ LB (13/06/2002) : NewObjBitmap ==> ObjBitmap_New, 
//                    and introduce ObjBitmap_GetNewHandler and ObjBitmap_CreateDIBSection,
//                    in order to manage the GDI resources.
//
//$LB (09/06/2003) : add _SAVEbitmap
//
//$LB (22/07/2003) : add DIBbitmap
//
//$LB (11/12/2003) : add _DRAWgradient
//
//$LB (12/12/2003) : add _BLURbitmap
//
//$LB (14/12/2003) : add _CAPTUREscreen 
//
//$LB (15/12/2003) : add _CRmaskFromBitmap to create an grayscale alpha mask from a bitmap
//
//$LB (10/05/2004)2 : add _GETbitmapBGR, _SETbitmapBGR, _STEREObitmap
//

#ifndef _BITMAP_H_
#define _BITMAP_H_


#include "x/scolplugin.h"
#include "x/version.h"



/****************************************************************************************/
/*                                                                                      */
/*      Declaration des fonctions du package bitmap.pkg                                 */
/*                                                                                      */
/****************************************************************************************/


/* fonction de manipulation de palette */
void SetBitmapPalette ( PtrObjBitmap B , PtrPalette P ) ;
void GetBitmapPalette ( PtrObjBitmap B , PtrPalette P ) ;

int ObjBitmap_New ( PtrObjBitmap B , PtrPalette P );
int ObjBitmap_CreateDIBSection (PtrObjBitmap B);


int GRdrawIcon(mmachine m);
int GRinfoIcon(mmachine m);

int GREmptyBuffer       ( mmachine m ) ; /* vide un buffer graphique                           */ 
int GRLoadBitmap        ( mmachine m ) ; /* charge un bitmap windows ( BMP )                   */ 
int GRGetBitmapSize     ( mmachine m ) ; /* renvoi la taille horizontale en pixel d'un bitmap  */ 
int GRCreateBitmap      ( mmachine m ) ; /* cree un opbjet de type bitmap                      */ 
int GRBlitBitmap        ( mmachine m ) ; /* blit un bitmap dans une fenetre                    */ 
int GRCreateBuffer      ( mmachine m ) ; /* cree un buffer graphique                           */ 
int GRPaintBuffer       ( mmachine m ) ; /* peind un buffer graphique dans une fenetre         */ 
int GRDrawRectangle     ( mmachine m ) ; /* dessine un rectangle dans un buffer graphique      */ 
int GRDrawLine          ( mmachine m ) ; /* dessine uen ligne dans un buffer                   */ 
int GRDrawCircle        ( mmachine m ) ; /* dessine un cercle dans un buffer graphique         */ 
int GRLoadBitmap8       ( mmachine m ) ; /* charge un bitmap 256 couleurs                      */ 
int GRCreateBitmap8     ( mmachine m ) ; /* cree directement un bitmap 256 couleurs            */ 
int GRDestroyBitmap     ( mmachine m ) ; /* detruit un bitmap 16 bits                          */ 
int GRGetBitmapPalette  ( mmachine m ) ; /* retourne la palette bitmap                         */ 
int GRSetBitmapPalette  ( mmachine m ) ; /* affecte une nouvelle palette a un objet bitmap     */ 
int GRCopyBitmap        ( mmachine m ) ; /* copie d'une bitmap dans un autre                   */ 
int GRAffBitmapPalette  ( mmachine m ) ; /* affecte une palette a un objet et le remap         */ 
int GRGetBitmap         ( mmachine m ) ; /* retourne une copie du bitmap                       */ 
int GRSetBitmap         ( mmachine m ) ; /* affecte un bitmap                                  */ 
int GRStretchBitmap     ( mmachine m ) ; /* copie un bitmap avec un stretch                    */ 
int GRMapBitmap         ( mmachine m ) ; /* effectue un mapping lineaire d'un rectangle bitmap */ 
int GRFileBitmap        ( mmachine m ) ; /* cree un buffer contenant un fichier archivable     */ 
int GRCopyWinBitmap     ( mmachine m ) ; /* blit avec seulement un rectangle de la source      */ 
int GRGetPixel          ( mmachine m ) ; /* donne la couleur au format 24 bits d'un pixel      */ 
int GRDrawPoly          ( mmachine m ) ; /* trace un polygone plein                            */ 
int GRPutPixel          ( mmachine m ) ; /* trace UN pixel                                     */ 
int GRAndBitmap         ( mmachine m ) ; /* AND entre 2 bitmaps                                */ 
int GROrBitmap          ( mmachine m ) ; /* OR entre 2 bitmaps                                 */ 
int GRXorBitmap         ( mmachine m ) ; /* XOR entre 2 bitmaps                                */ 
int GRPlusBitmap        ( mmachine m ) ; /* PLUS entre 2 bitmaps                               */ 
int GRMinusBitmap       ( mmachine m ) ; /* MINUS entre 2 bitmaps                              */ 
int GRSPlusBitmap       ( mmachine m ) ; /* PLUS entre 2 bitmaps avec saturation               */ 
int GRSMinusBitmap      ( mmachine m ) ; /* MINUS entre 2 bitmaps avec saturation              */ 
int GRNotBitmap         ( mmachine m ) ; /* NOT sur 1 bitmap                                   */ 
int GRMulBitmap         ( mmachine m ) ; /* MULbitmap sur 1 bitmap                             */ 
int GRDrawRectangleText ( mmachine m ) ; /* DRAWrectangleText sur 1 bitmap                     */ 
int GRStretchBlit       ( mmachine m ) ; /* stretch blit sur une fenetre                       */ 
int GRClearWindow       ( mmachine m ) ; /* vide le background d'une fenetre                   */ 
int GRtstzbuf           ( mmachine m ) ;
int GRCopyWindow        ( mmachine m ) ;

//$LB (09/06/2003) : _SAVEbitmap
int _SAVEbitmap (mmachine m);
//$LB (22/07/2003)
int DIBbitmap ( mmachine m );
//$LB (11/12/2003)
int _DRAWgradient (mmachine m);
//$LB (12/12/2003)
int _BLURbitmap (mmachine m);
//$LB (14/12/2003)
void CaptureScreen (PtrObjBitmap B, int x, int y, int w, int h, int flag);
int _CAPTUREscreen (mmachine m);
//$LB (15/12/2003)
int _CRmaskFromBitmap (mmachine m);

//$LB (10/05/2004)
int _GETbitmapBGR (mmachine m);
int _SETbitmapBGR (mmachine m);
int _STEREObitmap (mmachine m);

//$BLG: v4.6a5
int _GETbitmapFromObjWin(mmachine m);

//$BLG - v5.21: Add
int _GETwindowMap(mmachine m);

#endif