25 fOut = fopen(fname, opt);
26 return fOut !=
nullptr;
80 static unsigned long masks[] = { 0x0000,
81 0x0001, 0x0003, 0x0007, 0x000F,
82 0x001F, 0x003F, 0x007F, 0x00FF,
83 0x01FF, 0x03FF, 0x07FF, 0x0FFF,
84 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF };
156 int ncol, i,
x,
y, disp,
Code, K;
158 std::vector<unsigned char> ScLine(Width);
163 if (Width <= 0 || Width > 4096 || Height <= 0 || Height > 4096) {
165 "\nGIFencode: incorrect image size: %d x %d\n", Width, Height);
169 if (Ncol <= 0 || Ncol > 256) {
170 fprintf(stderr,
"\nGIFencode: wrong number of colors: %d\n", Ncol);
214 for (i=0; i<Ncol; i++) {
219 for (; i<ncol; i++) {
241 for (
y=0;
y<Height;
y++) {
259 if (i == 0) disp = 1;
#define R(a, b, c, d, e, f, g, h, i)
virtual void get_scline(int y, int width, unsigned char *buf)=0
bool OpenFile(const char *fname, const char *opt="w+")
void put_byte(unsigned char b)
long GIFencode(int Width, int Height, int Ncol, unsigned char *R, unsigned char *G, unsigned char *B)
void char_out(unsigned char c)