nuclear@2: /* nuclear@2: colcycle - color cycling image viewer nuclear@2: Copyright (C) 2016 John Tsiombikas nuclear@2: nuclear@2: This program is free software: you can redistribute it and/or modify nuclear@2: it under the terms of the GNU General Public License as published by nuclear@2: the Free Software Foundation, either version 3 of the License, or nuclear@2: (at your option) any later version. nuclear@2: nuclear@2: This program is distributed in the hope that it will be useful, nuclear@2: but WITHOUT ANY WARRANTY; without even the implied warranty of nuclear@2: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the nuclear@2: GNU General Public License for more details. nuclear@2: nuclear@2: You should have received a copy of the GNU General Public License nuclear@2: along with this program. If not, see . nuclear@2: */ nuclear@2: #ifndef IMAGE_H_ nuclear@2: #define IMAGE_H_ nuclear@2: nuclear@2: enum cycle_mode { nuclear@2: CYCLE_NORMAL = 0, nuclear@2: CYCLE_UNUSED, /* ? */ nuclear@2: CYCLE_REVERSE = 2, nuclear@2: CYCLE_PINGPONG = 3, nuclear@2: CYCLE_SINE_HALF = 4, /* sine -> [0, range/2] */ nuclear@2: CYCLE_SINE = 5 /* sine -> [0, range] */ nuclear@2: }; nuclear@2: nuclear@2: struct color { nuclear@2: unsigned char r, g, b; nuclear@2: }; nuclear@2: nuclear@2: struct colrange { nuclear@2: int low, high; nuclear@2: int cmode; nuclear@2: unsigned int rate; nuclear@2: struct colrange *next; nuclear@2: }; nuclear@2: nuclear@2: struct image { nuclear@2: int width, height; nuclear@2: int bpp; nuclear@2: struct color palette[256]; nuclear@2: struct colrange *range; nuclear@2: int num_ranges; nuclear@2: unsigned char *pixels; nuclear@2: }; nuclear@2: nuclear@2: int colc_gen_test_image(struct image *img); nuclear@2: int colc_load_image(struct image *img, const char *fname); nuclear@2: void colc_destroy_image(struct image *img); nuclear@2: nuclear@2: #endif /* IMAGE_H_ */