38 #define USE_PROTOTYPES
71 #define RLE_NOT_RLE -1
72 #define RLE_NO_SPACE -2
79 #define RLE_INIT_MAGIC 0x6487ED51L
86 #define RLE_CHECK_ALLOC( pgm, ptr, name )
87 ( !(ptr) ? rle_alloc_error( pgm, name ) : 0
)
122 #define RLE_SET_BIT(glob,bit)
123 ((glob).bits[((bit)&0xff
)/8
] |= (1
<<((bit)&0x7
)))
124 #define RLE_CLR_BIT(glob,bit)
125 ((glob).bits[((bit)&0xff
)/8
] &= ~(1
<<((bit)&0x7
)))
126 #define RLE_BIT(glob,bit)
127 ((glob).bits[((bit)&0xff
)/8
] & (1
<<((bit)&0x7
)))
234 extern unsigned int rle_getskip( rle_hdr *the_hdr );
253 extern rle_hdr *
rle_hdr_cp( rle_hdr *from_hdr,
315 extern void rle_skiprow( rle_hdr *the_hdr,
int nrow );
322 extern void rle_cp( rle_hdr *in_hdr, rle_hdr *out_hdr );
379 extern void bwdithermap(
int levels,
double gamma,
int bwmap[],
380 int divN[256],
int modN[256],
int magic[16][16] );
385 extern int ditherbw(
int x,
int y,
int val,
386 int divN[256],
int modN[256],
int magic[16][16] );
391 extern int dithergb(
int x,
int y,
int r,
int g,
int b,
392 int divN[256],
int modN[256],
int magic[16][16] );
397 extern void dithermap(
int levels,
double gamma,
int rgbmap[][3],
398 int divN[256],
int modN[256],
int magic[16][16] );
403 extern void make_square(
double N,
int divN[256],
int modN[256],
449 unsigned long pixels,
rle_pixel *colormap[3],
450 int colors,
int bits,
451 rle_pixel *rgbmap,
int fast,
int otherimages );
467 extern char *
cmd_name(
char **argv );
484 extern void hilbert_c2i(
int n,
int m,
int a[],
long int *r );
490 extern void hilbert_i2c(
int n,
int m,
long int r,
int a[] );
498 unsigned char *colormap[3],
500 unsigned long *dist_buf,
501 unsigned char *rgbmap );
506 extern int rle_alloc_error();
507 extern int rle_get_error();
510 extern void rle_debug();
511 extern int rle_get_setup();
512 extern void rle_get_setup_ok();
513 extern int rle_getrow();
516 extern unsigned int rle_getskip();
519 extern void rle_names();
520 extern rle_hdr *rle_hdr_cp();
521 extern rle_hdr *rle_hdr_init();
522 extern void rle_hdr_clear();
525 extern void rgb_to_bw();
526 extern void rle_puteof();
527 extern void rle_putrow();
528 extern void rle_put_init();
529 extern void rle_put_setup();
530 extern void rle_skiprow();
533 extern void rle_cp();
536 extern int rle_row_alloc();
537 extern void rle_row_free();
540 extern rle_pixel **buildmap();
543 extern char *rle_getcom();
546 extern char *rle_delcom();
547 extern char *rle_putcom();
550 extern void bwdithermap();
551 extern int ditherbw();
552 extern int dithergb();
553 extern void dithermap();
554 extern void magic4x4();
555 extern void make_square();
558 extern void float_to_exp();
561 extern FILE *rle_open_f();
562 extern FILE *rle_open_f_noexit();
563 extern void rle_close_f( );
566 extern int colorquant();
569 extern void rle_addhist();
572 extern char *cmd_name();
575 extern int scanargs();
578 extern void hilbert_c2i();
579 extern void hilbert_i2c();
582 extern void inv_cmap();
FILE * rle_open_f(char *prog_name, char *file_name, char *mode)
rle_hdr * rle_hdr_cp(rle_hdr *from_hdr, rle_hdr *to_hdr)
void rle_cp(rle_hdr *in_hdr, rle_hdr *the_hdr)
void make_square(double N, divN, modN, magic)
void rle_names(rle_hdr *the_hdr, const char *pgmname, const char *fname, int img_num)
void rle_debug(int on_off)
void rle_row_free(rle_hdr *the_hdr, rle_pixel **scanp)
char * cmd_name(char **argv)
void rle_close_f(FILE *fd)
int rle_get_setup(rle_hdr *the_hdr)
int rle_row_alloc(rle_hdr *the_hdr, rle_pixel ***scanp)
void hilbert_i2c(int n, int m, long int r, a)
void hilbert_c2i(int n, int m, a, long int *r)
int rle_getrow(rle_hdr *the_hdr, scanline)
int rle_get_error(int code, const char *pgmname, const char *fname)
void rgb_to_bw(rle_pixel *red_row, rle_pixel *green_row, rle_pixel *blue_row, rle_pixel *bw_row, int rowlen)
int scanargs(int argc, char **argv, const char *format,...)
void dithermap(int levels, double gamma, rgbmap, divN, modN, magic)
rle_pixel ** buildmap(rle_hdr *the_hdr, int minmap, double orig_gamma, double new_gamma)
void rle_puteof(rle_hdr *the_hdr)
void rle_putrow(rows, int rowlen, rle_hdr *the_hdr)
enum rle_dispatch dispatch
int colorquant(unsigned char *red, unsigned char *green, unsigned char *blue, unsigned long pixels, colormap, int colors, int bits, unsigned char *rgbmap, int flags, int accum_hist)
void float_to_exp(int count, float *floats, rle_pixel *pixels)
const char * rle_delcom(char *name, the_hdr) const
void rle_addhist(argv, rle_hdr *in_hdr, rle_hdr *out_hdr)
unsigned int rle_getskip(rle_hdr *the_hdr)
void inv_cmap(int colors, colormap, int bits, unsigned long *dist_buf,*rgbmap)
FILE * rle_open_f_noexit(char *prog_name, char *file_name, char *mode)
void rle_get_setup_ok(rle_hdr *the_hdr, const char *prog_name, const char *file_name)
void rle_skiprow(rle_hdr *the_hdr, int nrow)
char * rle_getcom(char *name, rle_hdr *the_hdr) const
int rle_alloc_error(char *pgm, char *name) const
void rle_put_init(rle_hdr *the_hdr)
int ditherbw(int x, int y, int val, divN, modN, magic)
void rle_put_setup(rle_hdr *the_hdr)
const char * rle_putcom(char *value, rle_hdr *the_hdr) const
void rle_hdr_clear(rle_hdr *the_hdr)
rle_hdr * rle_hdr_init(rle_hdr *the_hdr)
int dithergb(int x, int y, int r, int g, int b, int levels, divN, modN, magic)
void bwdithermap(int levels, double gamma, bwmap, divN, modN, magic)