lbm2bin

view src/image.h @ 0:bfd8aa2ca393

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 15 Jul 2017 13:26:32 +0300
parents
children
line source
1 /*
2 colcycle - color cycling image viewer
3 Copyright (C) 2016 John Tsiombikas <nuclear@member.fsf.org>
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #ifndef IMAGE_H_
19 #define IMAGE_H_
21 enum cycle_mode {
22 CYCLE_NORMAL = 0,
23 CYCLE_UNUSED, /* ? */
24 CYCLE_REVERSE = 2,
25 CYCLE_PINGPONG = 3,
26 CYCLE_SINE_HALF = 4, /* sine -> [0, range/2] */
27 CYCLE_SINE = 5 /* sine -> [0, range] */
28 };
30 struct color {
31 unsigned char r, g, b;
32 };
34 struct colrange {
35 int low, high;
36 int cmode;
37 unsigned int rate;
38 struct colrange *next;
39 };
41 struct image {
42 int width, height;
43 int bpp;
44 struct color palette[256];
45 struct colrange *range;
46 int num_ranges;
47 unsigned char *pixels;
48 };
50 int gen_test_image(struct image *img);
51 int load_image(struct image *img, const char *fname);
52 void destroy_image(struct image *img);
54 #endif /* IMAGE_H_ */