%ffp ctl(100):STATICTEXT, pos=(200,72),"",size=(200,10), fontcolor=black ForEveryTile:{ byte* buffer; byte value = 0; const int startclock = clock(); int endclock; //Create memory buffer if it isn't already created if(!i2 || i3 != scaleFactor) { //Allocate a memory block buffer = realloc(i2,X * Y * zmax); //Save the pointer to the memory block in a global variable i2 = buffer; i3 = scaleFactor; for(y = 0; y < Y; ++y) { for(x = 0; x < X; ++x) { for(z = 0; z < zmax; ++z) { //Read current pixel value and write it to the allocated memory memset(i2 + (((y * X) + x) * zmax) + z, src(x, y, z), 1); //tset(x,y,z,src(x,y,z)); } // for z } // for x if(updateProgress(y, Y * 2)) abort(); } // for y } // calloc? for(y = 0; y < Y; ++y) { for(x = 0; x < X; ++x) { for(z = 0; z < zmax; ++z) { // Read value in memory and write it to the current pixel memcpy(&value, i2 + (((y * X) + x) * zmax) + z, 1); //value=tget(x,y,z); pset(x, y, z, value); } // for z } // for x if(updateProgress(Y + y, Y * 2)) abort(); } // for y //Display calculation time endclock = clock() - startclock; setCtlTextv(100, "Preview: %d ms, Full Image: %.2f s", endclock, ((imageWidth*imageHeight)/((x_end-x_start)*(y_end-y_start))*endclock)/1000.0); return true; } OnFilterEnd:{ if(!doingProxy) { free(i2); } return true; }