~n-muench/ubuntu/oneiric/open-vm-tools/open-vm-tools.fix-836277

« back to all changes in this revision

Viewing changes to lib/include/imageUtil.h

  • Committer: Bazaar Package Importer
  • Author(s): Devid Antonio Filoni
  • Date: 2008-08-15 21:21:40 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080815212140-05fhxj8wroosysmj
Tags: 2008.08.08-109361-1ubuntu1
* Merge from Debian unstable (LP: #258393), remaining Ubuntu change:
  - add ubuntu_toolchain_FTBFS.dpatch patch, fix FTBFS
* Update ubuntu_toolchain_FTBFS.dpatch patch for the new version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*********************************************************
 
2
 * Copyright (C) 1998 VMware, Inc. All rights reserved.
 
3
 *
 
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.
 
7
 *
 
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.
 
12
 *
 
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.
 
16
 *
 
17
 *********************************************************/
 
18
 
 
19
/*
 
20
 * imageUtil.h --
 
21
 *
 
22
 */
 
23
 
 
24
#ifndef _IMAGEUTIL_H_
 
25
#define _IMAGEUTIL_H_
 
26
 
 
27
#include "imageUtilTypes.h"
 
28
#include "dynbuf.h"
 
29
#include "unicodeTypes.h"
 
30
 
 
31
#ifdef _WIN32
 
32
 
 
33
typedef char Bool;
 
34
 
 
35
typedef struct tagDIBINFOHEADER {
 
36
   BITMAPINFOHEADER  bmiHeader;
 
37
   RGBQUAD           bmiColors[256];
 
38
   LPBYTE            bitmapBits;
 
39
} DIBINFOHEADER, FAR *LPDIBINFOHEADER, *PDIBINFOHEADER;
 
40
 
 
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,
 
46
                                                          unsigned int height);
 
47
 
 
48
#else
 
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
 
52
                          * Quartz.
 
53
                          */
 
54
#include <X11/Xlib.h>
 
55
#undef Bool                            // XXX conflict with vm_basic_types.h
 
56
#define XBool int
 
57
#undef Cursor
 
58
 
 
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
 
63
#endif
 
64
 
 
65
#define DWORD_ALIGN(x)             ((((x)+3) >> 2) << 2)
 
66
 
 
67
EXTERN Bool ImageUtil_ReadPNG(ImageInfo *image,
 
68
                              ConstUnicode pathName);
 
69
 
 
70
EXTERN Bool ImageUtil_WriteImage(const ImageInfo *image,
 
71
                                 ConstUnicode pathName,
 
72
                                 ImageType imageType);
 
73
 
 
74
EXTERN Bool ImageUtil_ReadPNGBuffer(ImageInfo *image,
 
75
                                    const unsigned char *imageData,
 
76
                                    size_t dataLen);
 
77
EXTERN Bool ImageUtil_ConstructPNGBuffer(const ImageInfo *image, DynBuf *imageData);
 
78
EXTERN Bool ImageUtil_ConstructPNGBufferEx(const ImageInfo *image,
 
79
                                           const ImagePngOptions *options,
 
80
                                           DynBuf *imageData);
 
81
EXTERN Bool ImageUtil_ConstructBMPBuffer(const ImageInfo *image, DynBuf *imageData);
 
82
EXTERN Bool ImageUtil_ConstructBuffer(const ImageInfo *image, ImageType imageType,
 
83
                                      DynBuf *imageData);
 
84
EXTERN void ImageUtil_FreeImageData(ImageInfo *image);
 
85
 
 
86
#endif // _IMAGEUTIL_H_