pike.git
/
src
/
modules
/
Image
/
dct.c
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/modules/Image/dct.c:1:
-
/* $Id: dct.c,v 1.
13
1999/
04
/
22
12
:
40
:
29
mirar Exp $ */
+
/* $Id: dct.c,v 1.
14
1999/
06
/
18
19
:
19
:
20
mirar Exp $ */
/* **! module Image **! note
-
**! $Id: dct.c,v 1.
13
1999/
04
/
22
12
:
40
:
29
mirar Exp $
+
**! $Id: dct.c,v 1.
14
1999/
06
/
18
19
:
19
:
20
mirar Exp $
**! class Image */ #include "global.h" #include <math.h> #include <ctype.h> #include "stralloc.h" #include "global.h"
pike.git/src/modules/Image/dct.c:71:
void image_dct(INT32 args) { 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) error("
no
image\n
");
+
if (!THIS->img) error("
Called
Image.Image object is not initialized\n
");
;
fprintf(stderr,"%lu bytes, %lu bytes\n", (unsigned long)(sizeof(rgbd_group)*THIS->xsize*THIS->ysize), (unsigned long)(sizeof(rgb_group)*THIS->xsize*THIS->ysize+1)); if (!(area=malloc(sizeof(rgbd_group)*THIS->xsize*THIS->ysize+1)))
-
error("Out of
memory\n
");
+
resource_
error(
NULL,0,0,
"
memory",0,"
Out of
memory.\n
");
if (!(costbl=malloc(sizeof(double)*THIS->xsize+1))) { free(area);
-
error("Out of
memory\n
");
+
resource_
error(
NULL,0,0,
"
memory",0,"
Out of
memory.\n
");
} o=clone_object(image_program,0); img=(struct image*)(o->storage); *img=*THIS; if (args>=2 && sp[-args].type==T_INT && sp[1-args].type==T_INT) { img->xsize=MAXIMUM(1,sp[-args].u.integer); img->ysize=MAXIMUM(1,sp[1-args].u.integer); }
-
else error("
Illegal
arguments to image->dct()\n");
+
else
bad_arg_
error("
image->dct",sp-args,args,0,"",sp-args,
+
"Bad
arguments to image->dct()\n");
if (!(img->img=(rgb_group*)malloc(sizeof(rgb_group)* img->xsize*img->ysize+1))) { free(area); free(costbl); free_object(o);
-
error("Out of
memory\n
");
+
resource_
error(
NULL,0,0,
"
memory",0,"
Out of
memory.\n
");
} xsz2=THIS->xsize*2.0; ysz2=THIS->ysize*2.0; enh=(8.0/THIS->xsize)*(8.0/THIS->ysize); for (u=0; u<THIS->xsize; u++) { double d,z0;