lbm2bin
diff 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 diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/image.h Sat Jul 15 13:26:32 2017 +0300 1.3 @@ -0,0 +1,54 @@ 1.4 +/* 1.5 +colcycle - color cycling image viewer 1.6 +Copyright (C) 2016 John Tsiombikas <nuclear@member.fsf.org> 1.7 + 1.8 +This program is free software: you can redistribute it and/or modify 1.9 +it under the terms of the GNU General Public License as published by 1.10 +the Free Software Foundation, either version 3 of the License, or 1.11 +(at your option) any later version. 1.12 + 1.13 +This program is distributed in the hope that it will be useful, 1.14 +but WITHOUT ANY WARRANTY; without even the implied warranty of 1.15 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1.16 +GNU General Public License for more details. 1.17 + 1.18 +You should have received a copy of the GNU General Public License 1.19 +along with this program. If not, see <http://www.gnu.org/licenses/>. 1.20 +*/ 1.21 +#ifndef IMAGE_H_ 1.22 +#define IMAGE_H_ 1.23 + 1.24 +enum cycle_mode { 1.25 + CYCLE_NORMAL = 0, 1.26 + CYCLE_UNUSED, /* ? */ 1.27 + CYCLE_REVERSE = 2, 1.28 + CYCLE_PINGPONG = 3, 1.29 + CYCLE_SINE_HALF = 4, /* sine -> [0, range/2] */ 1.30 + CYCLE_SINE = 5 /* sine -> [0, range] */ 1.31 +}; 1.32 + 1.33 +struct color { 1.34 + unsigned char r, g, b; 1.35 +}; 1.36 + 1.37 +struct colrange { 1.38 + int low, high; 1.39 + int cmode; 1.40 + unsigned int rate; 1.41 + struct colrange *next; 1.42 +}; 1.43 + 1.44 +struct image { 1.45 + int width, height; 1.46 + int bpp; 1.47 + struct color palette[256]; 1.48 + struct colrange *range; 1.49 + int num_ranges; 1.50 + unsigned char *pixels; 1.51 +}; 1.52 + 1.53 +int gen_test_image(struct image *img); 1.54 +int load_image(struct image *img, const char *fname); 1.55 +void destroy_image(struct image *img); 1.56 + 1.57 +#endif /* IMAGE_H_ */