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

Revision 2, 3.0 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, 2003 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 __MNGEX_H
22 #define __MNGEX_H
23
24 #include "pngex.h"
25
26 typedef enum adv_mng_type_enum {
27         mng_vlc,
28         mng_lc,
29         mng_std
30 } adv_mng_type;
31
32 typedef struct adv_mng_write_struct {
33         adv_bool first; /**< First image flag. */
34
35         unsigned width; /**< Frame size in pixel. */
36         unsigned height; /**< Frame size in pixel. */
37         unsigned pixel; /**< Pixel size in bytes. */
38         unsigned line; /**< Scanline size in bytes. */
39
40         int scroll_x; /**< Initial position of the first image in the scroll buffer. */
41         int scroll_y; /**< Initial position of the first image in the scroll buffer. */
42         unsigned scroll_width; /**< Extra scroll buffer size in pixel. */
43         unsigned scroll_height; /**< Extra scroll buffer size in pixel. */
44
45         unsigned char* scroll_ptr; /**< Global image data. */
46
47         unsigned char* current_ptr; /**< Pointer at the current frame in the scroll buffer. */
48         int current_x; /**< Current scroll position. */
49         int current_y;
50
51         unsigned pal_size; /**< Palette size in bytes. */
52         unsigned char pal_ptr[256*3]; /**< Palette. */
53         adv_bool pal_used[256]; /**< Flag vector for the used entries in the palette. */
54
55         unsigned tick; /**< Last tick used. */
56
57         adv_mng_type type; /**< Type of the MNG stream. */
58         shrink_t level; /**< Compression level of the MNG stream. */
59         adv_bool reduce; /**< Try to reduce the images to 256 color. */
60         adv_bool expand; /**< Expand the images to 24 bit color. */
61         adv_bool has_header; /**< If the header was written. */
62 } adv_mng_write;
63
64 adv_bool mng_write_has_header(adv_mng_write* mng);
65 void mng_write_header(adv_mng_write* mng, adv_fz* f, unsigned* fc, unsigned width, unsigned height, unsigned frequency, int scroll_x, int scroll_y, unsigned scroll_width, unsigned scroll_height);
66 void mng_write_image(adv_mng_write* mng, adv_fz* f, unsigned* fc, unsigned width, unsigned height, unsigned pixel, unsigned char* img_ptr, unsigned img_scanline, unsigned char* pal_ptr, unsigned pal_size, int shift_x, int shift_y);
67 void mng_write_frame(adv_mng_write* mng, adv_fz* f, unsigned* fc, unsigned tick);
68 void mng_write_footer(adv_mng_write* mng, adv_fz* f, unsigned* fc);
69 adv_mng_write* mng_write_init(adv_mng_type type, shrink_t level, adv_bool reduce, adv_bool expand);
70 void mng_write_done(adv_mng_write* mng);
71
72 #endif
73
Note: See TracBrowser for help on using the browser.