pike.git / src / modules / Image / dct.c

version» Context lines:

pike.git/src/modules/Image/dct.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: dct.c,v 1.23 2002/10/21 17:06:13 marcus Exp $ + || $Id: dct.c,v 1.24 2003/08/20 22:26:32 nilsson Exp $   */      /*   **! module Image   **! class Image   */      #include "global.h"      #include <math.h>
pike.git/src/modules/Image/dct.c:79:    rgbd_group *area,*val;    struct object *o;    struct image *img;    INT32 x,y,u,v;    double xsz2,ysz2,enh,xp,yp,dx,dy;    double *costbl;    rgb_group *pix;       if (!THIS->img) Pike_error("Called Image.Image object is not initialized\n");;    + #ifdef DCT_DEBUG    fprintf(stderr,"%lu bytes, %lu bytes\n",    DO_NOT_WARN((unsigned long)(sizeof(rgbd_group)*THIS->xsize*THIS->ysize)),    DO_NOT_WARN((unsigned long)(sizeof(rgb_group)*THIS->xsize*THIS->ysize+1))); -  + #endif       if (!(area=malloc(sizeof(rgbd_group)*THIS->xsize*THIS->ysize+1)))    resource_error(NULL,0,0,"memory",0,"Out of memory.\n");       if (!(costbl=malloc(sizeof(double)*THIS->xsize+1)))    {    free(area);    resource_error(NULL,0,0,"memory",0,"Out of memory.\n");    }   
pike.git/src/modules/Image/dct.c:152:    sum.g += (float)(pix->g*z);    sum.b += (float)(pix->b*z);    pix++;    }    }    sum.r *= (float)d;    sum.g *= (float)d;    sum.b *= (float)d;    area[u+v*THIS->xsize]=sum;    } + #ifdef DCT_DEBUG    fprintf(stderr,"."); fflush(stderr); -  + #endif    } -  + #ifdef DCT_DEBUG    fprintf(stderr,"\n"); -  + #endif       dx=((double)(THIS->xsize-1))/(img->xsize);    dy=((double)(THIS->ysize-1))/(img->ysize);       pix=img->img;    for (y=0,yp=0; y<img->ysize; y++,yp+=dy)    {    double z0;    rgbd_group sum;   
pike.git/src/modules/Image/dct.c:194:    }    }    sum.r *= (float)enh;    sum.g *= (float)enh;    sum.b *= (float)enh;    pix->r=testrange((DOUBLE_TO_INT(sum.r+0.5)));    pix->g=testrange((DOUBLE_TO_INT(sum.g+0.5)));    pix->b=testrange((DOUBLE_TO_INT(sum.b+0.5)));    pix++;    } + #ifdef DCT_DEBUG    fprintf(stderr,"."); fflush(stderr); -  + #endif    }       free(area);    free(costbl);       pop_n_elems(args);    push_object(o);   }