30 int width,
int height,
32 int newwidth,
int newheight,
35 float sx, sy, sz, dx, dy, dz;
36 int src_bpr, dest_bpr, src_bpl, dest_bpl, xstop, ystop, zstop;
37 int x, y, z, offset, i;
39 (
unsigned char*) malloc((
size_t)newwidth*newheight*nc*newlayers);
41 dx = ((float)width)/((float)newwidth);
42 dy = ((float)height)/((float)newheight);
43 dz = ((float)layers)/((float)newlayers);
45 dest_bpr = newwidth * nc;
46 src_bpl = src_bpr * height;
47 dest_bpl = dest_bpr * newheight;
49 zstop = newlayers * dest_bpl;
53 for (z = 0; z < zstop; z += dest_bpl) {
55 for (y = 0; y < ystop; y += dest_bpr) {
57 for (x = 0; x < xstop; x += nc) {
58 offset = ((int)sz)*src_bpl + ((int)sy)*src_bpr + ((int)sx)*nc;
59 for (i = 0; i < nc; i++) dest[x+y+z+i] = src[offset+i];
unsigned char * simage_resize3d(unsigned char *src, int width, int height, int nc, int layers, int newwidth, int newheight, int newlayers)
Windows specific information.