OLD | NEW |
1 /* Copyright (C)2004 Landmark Graphics Corporation | 1 /* |
2 * Copyright (C)2005 Sun Microsystems, Inc. | 2 * Copyright (C)2011 D. R. Commander. All Rights Reserved. |
3 * | 3 * |
4 * This library is free software and may be redistributed and/or modified under | 4 * Redistribution and use in source and binary forms, with or without |
5 * the terms of the wxWindows Library License, Version 3.1 or (at your option) | 5 * modification, are permitted provided that the following conditions are met: |
6 * any later version. The full license is in the LICENSE.txt file included | |
7 * with this distribution. | |
8 * | 6 * |
9 * This library is distributed in the hope that it will be useful, | 7 * - Redistributions of source code must retain the above copyright notice, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 8 * this list of conditions and the following disclaimer. |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 9 * - Redistributions in binary form must reproduce the above copyright notice, |
12 * wxWindows Library License for more details. | 10 * this list of conditions and the following disclaimer in the documentation |
13 */ | 11 * and/or other materials provided with the distribution. |
14 | 12 * - Neither the name of the libjpeg-turbo Project nor the names of its |
15 // This provides rudimentary facilities for loading and saving true color | 13 * contributors may be used to endorse or promote products derived from this |
16 // BMP and PPM files | 14 * software without specific prior written permission. |
| 15 * |
| 16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", |
| 17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE |
| 20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 26 * POSSIBILITY OF SUCH DAMAGE. |
| 27 */ |
17 | 28 |
18 #ifndef __BMP_H__ | 29 #ifndef __BMP_H__ |
19 #define __BMP_H__ | 30 #define __BMP_H__ |
20 | 31 |
21 #define BMPPIXELFORMATS 6 | 32 #include "./turbojpeg.h" |
22 enum BMPPIXELFORMAT {BMP_RGB=0, BMP_RGBA, BMP_BGR, BMP_BGRA, BMP_ABGR, BMP_ARGB}
; | |
23 | 33 |
24 #ifdef __cplusplus | 34 int loadbmp(char *filename, unsigned char **buf, int *w, int *h, int pf, |
25 extern "C" { | 35 » int bottomup); |
26 #endif | |
27 | 36 |
28 // This will load a Windows bitmap from a file and return a buffer with the | 37 int savebmp(char *filename, unsigned char *buf, int w, int h, int pf, |
29 // specified pixel format, scanline alignment, and orientation. The width and | 38 » int bottomup); |
30 // height are returned in w and h. | |
31 | |
32 int loadbmp(char *filename, unsigned char **buf, int *w, int *h, | |
33 » enum BMPPIXELFORMAT f, int align, int dstbottomup); | |
34 | |
35 // This will save a buffer with the specified pixel format, pitch, orientation, | |
36 // width, and height as a 24-bit Windows bitmap or PPM (the filename determines | |
37 // which format to use) | |
38 | |
39 int savebmp(char *filename, unsigned char *buf, int w, int h, | |
40 » enum BMPPIXELFORMAT f, int srcpitch, int srcbottomup); | |
41 | 39 |
42 const char *bmpgeterr(void); | 40 const char *bmpgeterr(void); |
43 | 41 |
44 #ifdef __cplusplus | 42 #ifdef __cplusplus |
45 } | 43 } |
46 #endif | 44 #endif |
47 | 45 |
48 #endif | 46 #endif |
OLD | NEW |