/* file name GraImage.h ---------------------------------------- 280621 */ /* SCM 28.06.21 export.h renamed as ph_export.h to avoid mixup with other files*/ /* SCM 20.03.18 Update definition for pcx_to_bmp */ /* SCM 08.08.17 CloseAnimGIFFile now returns int (0=success) */ /* SCM 13.12.16 Remove unused function declarations */ /* SCM 23.09.16 Export declarations needed for GraImage DLL compilation */ /* -------------------------------------------------------------------- */ #include #include "ph_export.h" #define PALETTESIZE 256 /* Number of entries in the system palette */ /* --------- Structures used in Satellite DLL ------------------------ */ #ifndef _RGBCOLS #define _RGBCOLS typedef struct _RGBCols { unsigned short red; // each value in range 0-255 unsigned short green; unsigned short blue; } RGBCols; #endif /* _RGBCOLS */ #ifndef _GFXSTRUCT #define _GFXSTRUCT typedef struct _RunlengthPacket { unsigned short red; unsigned short green; unsigned short blue; unsigned short length; unsigned short index; } RunlengthPacket; typedef struct _Image { FILE *file; int interlace; int columns; int rows; int packets; int colors; RGBCols *colormap; RunlengthPacket *pixels; } Image; #endif /* _GFXSTRUCT */ /* --------- End Structure declarations ----------------------------- */ #ifndef _PHODEBUG #define _PHODEBUG // Function declarations for Debug Output GRAPHICS_EXPORT FILE* OpenDebug(char*, BOOL*); GRAPHICS_EXPORT void DebugMessage(char*); GRAPHICS_EXPORT void DebugMessage2(char*, char*); GRAPHICS_EXPORT void DebugIntegerValue(char*, int); GRAPHICS_EXPORT void DebugLastErrorMessage(int); GRAPHICS_EXPORT void CloseDebug(); // Function declarations for handling Private Heap GRAPHICS_EXPORT HANDLE myGetPrivateHeap(); GRAPHICS_EXPORT void myDestroyPrivateHeap(); #endif /* _PHODEBUG */ /* Handle to a DIB */ #ifndef HDIB #define HDIB HANDLE #endif /* Print Area selection */ #define PW_WINDOW 1 #define PW_CLIENT 2 #define PW_USERSET 3 // Additional option for user set rectangle // Exported Image handling functions GRAPHICS_EXPORT HDIB pcx_to_bmp( char * ); GRAPHICS_EXPORT HDIB gif_to_bmp( char * ); GRAPHICS_EXPORT HDIB png_to_bmp( char * ); GRAPHICS_EXPORT VOID DisplayImageFile(HWND, HDC, char*, int, int, int, int); GRAPHICS_EXPORT VOID SavePCXFile(HDIB, char *, int); GRAPHICS_EXPORT void SaveGIFFile(HDIB, char *, int, BOOL); GRAPHICS_EXPORT int SaveJPEGFile(HDIB, char*, int); GRAPHICS_EXPORT int SavePngFile(HANDLE, char*, int); GRAPHICS_EXPORT FILE *OpenAnimGIFFile(HANDLE, char*, Image*, int, int); GRAPHICS_EXPORT BOOL AppendAnimGIFFile(HANDLE, FILE*, Image*, int); GRAPHICS_EXPORT int CloseAnimGIFFile(FILE*, Image*); GRAPHICS_EXPORT WORD DIBBitsOffset(HDIB, WORD); GRAPHICS_EXPORT unsigned char * simage_jpeg_load(const char*, int*, int*, int*); GRAPHICS_EXPORT HDIB LoadPixeltoDIB(unsigned char*, int, int); GRAPHICS_EXPORT HDIB CopyWindowToDIB(HWND, WORD, LPRECT); GRAPHICS_EXPORT int BestPixel(BYTE *, int *); #ifndef _PHODIB #define _PHODIB GRAPHICS_EXPORT HDIB BitmapToDIB (HBITMAP hBitmap, HPALETTE hPal); GRAPHICS_EXPORT HBITMAP CopyWindowToBitmap (HWND, WORD); GRAPHICS_EXPORT HDIB CopyWindowToDIB (HWND, WORD, LPRECT); GRAPHICS_EXPORT WORD DestroyDIB (HDIB); GRAPHICS_EXPORT DWORD DIBHeight (LPSTR lpDIB); GRAPHICS_EXPORT WORD DIBNumColors (LPSTR lpDIB); GRAPHICS_EXPORT HBITMAP DIBToBitmap (HDIB hDIB, HPALETTE hPal); GRAPHICS_EXPORT DWORD DIBWidth (LPSTR lpDIB); GRAPHICS_EXPORT LPSTR FindDIBBits (LPSTR lpDIB); GRAPHICS_EXPORT HPALETTE GetSystemPalette (void); GRAPHICS_EXPORT BOOL PaintDIB (HDC, LPRECT, HDIB, LPRECT, HPALETTE); GRAPHICS_EXPORT WORD SaveDIB(HDIB, LPSTR); #endif /* _PHODIB */