/* GEM-View 3.00 PROCESSING Modul: Bild (physikalisch) verdoppeln (c) 22.10.1993 by Dieter Fiebelkorn Grner Weg 29a D-45768 Marl (GERMANY) */ #include #include "image.h" #include "moduls.h" unsigned long hdouble2(unsigned short); Image* gvw_main(PROC_Structure *procS, int verbose) { Image *image; Image *oimage; char *data; char *src, *dst1, *dst2; long width, height; long x, y, val; 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, 2 * 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->unalignwidth + 7) >> 3; height = (long)image->height * image->depth; src = data; dst1 = dst2 = oimage->data; dst2 += oimage->width >> 3; for (y = height; y > 0; y--) { for (x = width >> 1; x > 0; x--) *((unsigned long*)dst1)++ = *((unsigned long*)dst2)++ = hdouble2(*((unsigned short*)src)++); if (width & 0x01) { val = hdouble2(*((unsigned short*)src)++); *((unsigned short*)dst1)++ = *((unsigned short*)dst2)++ = *(unsigned short*)&val; } dst1 += oimage->width >> 3; dst2 += oimage->width >> 3; } return(oimage); }