#include <stdio.h>
#include "rle.h"
#include "rletogif.h"
Go to the source code of this file.
Definition at line 160 of file rletogif.c.
163 fprintf(stderr,
"%s\n",
s);
int get_color_bits |
( |
char ** |
comments | ) |
|
Definition at line 134 of file rletogif.c.
137 int i, color_bits, num_colors;
140 if (
comments == NULL)
return (color_bits);
142 if (!strncmp(
comments[i],
"color_map_length=",17)) {
143 num_colors = atoi(&(
comments[i][17]));
144 for (color_bits = 1; num_colors >> color_bits; color_bits++);
145 if (num_colors == (1<<(color_bits-1))) color_bits--;
149 if ((color_bits < 0) || (color_bits > 8))
150 error(
"invalid number of color bits");
Definition at line 154 of file rletogif.c.
static gif_pixel ** scanbuf
void main |
( |
int |
argc, |
|
|
argv |
|
|
) |
| |
Definition at line 48 of file rletogif.c.
52 char *outfname = NULL,
59 if (
scanargs( argc, argv,
"% o%-outfile.gif!s infile.rle%s",
60 &oflag, &outfname, &infname ) == 0 )
81 for ( i = 0; i < (1 << color_bits); i++ )
int getpixel(int x, int y)
void rle_row_free(rle_hdr *the_hdr, rle_pixel **scanp)
int scanargs(int argc, char **argv, const char *format,...)
static gif_pixel ** scanbuf
void rle_names(rle_hdr *the_hdr, const char *pgmname, const char *fname, int img_num)
FILE * rle_open_f(const char *prog_name, const char *f_name, const char *mode)
char * cmd_name(char **argv)
void rle_get_setup_ok(rle_hdr *the_hdr, const char *prog_name, const char *file_name)
rle_hdr * rle_hdr_init(rle_hdr *the_hdr)
const char* MY_NAME = "rletogif" |