1
/*********************************************************
2
* Copyright (C) 1998 VMware, Inc. All rights reserved.
4
* This program is free software; you can redistribute it and/or modify it
5
* under the terms of the GNU Lesser General Public License as published
6
* by the Free Software Foundation version 2.1 and no later version.
8
* This program is distributed in the hope that it will be useful, but
9
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10
* or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public
11
* License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program; if not, write to the Free Software Foundation, Inc.,
15
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17
*********************************************************/
27
#include "imageUtilTypes.h"
29
#include "unicodeTypes.h"
35
typedef struct tagDIBINFOHEADER {
36
BITMAPINFOHEADER bmiHeader;
37
RGBQUAD bmiColors[256];
39
} DIBINFOHEADER, FAR *LPDIBINFOHEADER, *PDIBINFOHEADER;
41
BOOL ImageUtil_SavePNG(LPDIBINFOHEADER image, ConstUnicode fileName);
42
EXTERN HBITMAP ImageUtil_LoadPNG(ConstUnicode fileName);
43
EXTERN HBITMAP ImageUtil_LoadPNGFromBuffer(const unsigned char *imageData,
44
unsigned int dataLen);
45
EXTERN HBITMAP ImageUtil_LoadImage(ConstUnicode filename, unsigned int width,
49
#ifndef NO_X11_XLIB_H /* XXX Carbon and X both define 'Cursor'
50
* but we don't use ImgUtil_SavePNG in mksQuartz.h
51
* Remove after we have implemeted imageUtil with
55
#undef Bool // XXX conflict with vm_basic_types.h
59
Bool ImageUtil_SavePNG(const XImage *image,
60
unsigned int numColors, unsigned short colors[256][3],
61
const char *fileName);
62
#endif //USE_IMAGE_UTIL_H
65
#define DWORD_ALIGN(x) ((((x)+3) >> 2) << 2)
67
EXTERN Bool ImageUtil_ReadPNG(ImageInfo *image,
68
ConstUnicode pathName);
70
EXTERN Bool ImageUtil_WriteImage(const ImageInfo *image,
71
ConstUnicode pathName,
74
EXTERN Bool ImageUtil_ReadPNGBuffer(ImageInfo *image,
75
const unsigned char *imageData,
77
EXTERN Bool ImageUtil_ConstructPNGBuffer(const ImageInfo *image, DynBuf *imageData);
78
EXTERN Bool ImageUtil_ConstructPNGBufferEx(const ImageInfo *image,
79
const ImagePngOptions *options,
81
EXTERN Bool ImageUtil_ConstructBMPBuffer(const ImageInfo *image, DynBuf *imageData);
82
EXTERN Bool ImageUtil_ConstructBuffer(const ImageInfo *image, ImageType imageType,
84
EXTERN void ImageUtil_FreeImageData(ImageInfo *image);
86
#endif // _IMAGEUTIL_H_