/* GEM-View 3.00 PROCESSING Modul: Bild vertikal verdoppeln (verzerren) (c) 22.10.1993 by Dieter Fiebelkorn Grner Weg 29a D-45768 Marl (GERMANY) */ #include #include "image.h" #include "moduls.h" Image* gvw_main(PROC_Structure *procS, int verbose) { Image *image; Image *oimage; char *data; char *src, *dst1, *dst2; long width, height; long x, y; image = procS->image; if (image == NULL) { procS->events.alert(1, "[3][ | No image for process! | ][ Abort ]"); return(NULL); } data = image->data; if (data == NULL) { procS->events.alert(1, "[3][ | No data in image! | ][ Abort ]"); return(NULL); } oimage = procS->images.newGEMImage(image->title, image->unalignwidth, 2 * image->height, image->depth); if (oimage == NULL) { procS->events.alert(1, "[3][ | Not enough for new image! | ][ Abort ]"); return(NULL); } for (x = (long)image->rgb.used - 1; x >= 0; x--) { oimage->rgb.red [x] = image->rgb.red [x]; oimage->rgb.green[x] = image->rgb.green[x]; oimage->rgb.blue [x] = image->rgb.blue [x]; } oimage->rgb.used = image->rgb.used; width = (long)image->width >> 4; height = (long)image->height * image->depth; src = data; dst1 = dst2 = oimage->data; ((short*)dst2) += width; for (y = height; y > 0; y--) { for (x = width; x > 0; x--) *((unsigned short*)dst1)++ = *((unsigned short*)dst2)++ = *((unsigned short*)src)++; ((short*)dst1) += width; ((short*)dst2) += width; } return(oimage); }