root/morphix/trunk/cloop/advancecomp-1.9_create_compressed_fs/pngex.h

Revision 2, 2.5 kB (checked in by nextime, 2 years ago)

Initial import, branching from morphix svn

Line 
1 /*
2  * This file is part of the Advance project.
3  *
4  * Copyright (C) 2002 Andrea Mazzoleni
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19  */
20
21 #ifndef __PNGEX_H
22 #define __PNGEX_H
23
24 #include "except.h"
25 #include "compress.h"
26 #include "utility.h"
27
28 #include "lib/png.h"
29 #include "lib/error.h"
30
31 class error_png : public error {
32 public:
33         error_png() : error(error_unsupported_get() != 0) {
34                 operator<<(error_get());
35         }
36 };
37
38 void png_print_chunk(unsigned type, unsigned char* data, unsigned size);
39
40 void png_compress(
41         shrink_t level,
42         data_ptr& out_ptr, unsigned& out_size,
43         const unsigned char* img_ptr, unsigned img_scanline, unsigned img_pixel,
44         unsigned x, unsigned y, unsigned dx, unsigned dy
45 );
46 void png_compress_delta(
47         shrink_t level,
48         data_ptr& out_ptr, unsigned& out_size,
49         const unsigned char* img_ptr, unsigned img_scanline, unsigned img_pixel,
50         const unsigned char* prev_ptr, unsigned prev_scanline,
51         unsigned x, unsigned y, unsigned dx, unsigned dy
52 );
53 void png_compress_palette_delta(
54         data_ptr& out_ptr, unsigned& out_size,
55         const unsigned char* pal_ptr, unsigned pal_size,
56         const unsigned char* prev_ptr
57 );
58 void png_write(
59         adv_fz* f,
60         unsigned pix_width, unsigned pix_height, unsigned pix_pixel,
61         unsigned char* pix_ptr, unsigned pix_scanline,
62         unsigned char* pal_ptr, unsigned pal_size,
63         unsigned char* rns_ptr, unsigned rns_size,
64         shrink_t level
65 );
66 void png_convert_4(
67         unsigned pix_width, unsigned pix_height, unsigned pix_pixel, unsigned char* pix_ptr, unsigned pix_scanline,
68         unsigned char* pal_ptr, unsigned pal_size,
69         unsigned char** dst_ptr, unsigned* dst_pixel, unsigned* dst_scanline
70 );
71 void png_convert_3(
72         unsigned pix_width, unsigned pix_height, unsigned pix_pixel, unsigned char* pix_ptr, unsigned pix_scanline,
73         unsigned char* pal_ptr, unsigned pal_size,
74         unsigned char** dst_ptr, unsigned* dst_pixel, unsigned* dst_scanline
75 );
76
77 #endif
78
Note: See TracBrowser for help on using the browser.