static int initialize (struct filter *f, struct initdata *i) { inhermisc (f, i); /*in/out coloring modes looks better in iter modes. This also saves some memory in truecolor. */ if (f->data != NULL) destroypalette ((struct palette *) f->data); f->data = createpalette (0, 65536, i->image->bytesperpixel <= 1 ? SMALLITER : LARGEITER, 0, 65536, NULL, NULL, NULL, NULL, NULL); if (!inherimage (f, i, TOUCHIMAGE | NEWIMAGE, 0, 0, (struct palette *) f->data, 0, 0)) return 0; return (f->previous->action->initialize (f->previous, i)); }
static int initialize (struct filter *f, struct initdata *i) { struct stereogramdata *s = (struct stereogramdata *) f->data; inhermisc (f, i); if (s->savedpalette == NULL) s->savedpalette = clonepalette (i->image->palette); mkstereogrampalette (i->image->palette); if (!inherimage (f, i, TOUCHIMAGE, i->image->width / 2, (i->image->height) / 2, s->palette, i->image->pixelwidth * 2, i->image->pixelheight * 2)) return 0; setfractalpalette (f, s->savedpalette); return (f->previous->action->initialize (f->previous, i)); }
static int initialize(struct filter *f, struct initdata *i) { struct antidata *s = (struct antidata *) f->data; if (i->image->width * i->image->height * i->image->bytesperpixel * 2 * 16 > 15 * 1024 * 1024) { s->shift = 1; } else { s->shift = 2; } inhermisc(f, i); if (!inherimage (f, i, TOUCHIMAGE | IMAGEDATA, (int) (((unsigned int) i->image->width) << s->shift), (int) (((unsigned int) i->image->height) << s->shift), NULL, 0, 0)) return 0; if (i->image == NULL) { return 0; } return (f->previous->action->initialize(f->previous, i)); }