I'm rotating huge image rasters (1+ GB) using a 3-shear algorithm. I rotate 'in-place' after reallocating the raster. A necessary first step is reorganizing the image in the new raster dimensions that will exist after the rotation. RGBA pixels byte packed into uint32.
The following code runs fine on rasters < 4 Gb. No issues.
When I run it on rasters > 4 Gb, memmove() crashes.
I was under the impression that 64 bit Linux could take on all size data structures.
Any ideas out there. I am at my wits end on this.
Any replies greatly appreciated.
Imagtek
****************************************************************
lbuf1 = (int32u *)realloc(*outrast, (longu)(Rcols*Rrows*4));
if( !lbuf1 )
return( -2 ); // insufficient memory
if( Rcols > icols ){ // fit icols,irows to new Rcols,Rrows
fprintf(stderr, "fitting data...");
il = lbuf1 + (longu)((irows-1) * icols);
ol = lbuf1 + (longu)((irows-1) * Rcols);
for(iy=1; iy<irows; ++iy){
memmove(ol, il, (longu)(icols * 4));
ol -= Rcols;
il -= icols;
}
fprintf(stderr, "done...");
}
***************************************************************