/* ======================================================================= This illustrates another use of 16-bit memory allocation, to build a 16-bit lookup table. This technique can considerably speed up filter exectution for mapping functions that are slow to calculate on a pixel-by-pixel basis. This code applies a gamma function of .707 to the image. For comparison, both 8-bit and 16 bit code are shown. The 8-bit code uses anonymous put/get cells for the table, while the the 16-bit code uses a table stored in a buffer. There is no need to reallocate the table size based on scaleFactor changes, so Martijn van der Lee's logic in that section has been eliminated. Bill MacBeth ======================================================================= */ %ffp ForEveryTile: { word *mapBuffer; word ch0Val; word ch1Val; word ch2Val; word wval; int ival; if ( imageMode==RGBMode ) { // Build 8-bit look-up table for ( i=0; i<=255; i++ ) { ival = 255-i; put(ival,i); } // Remap image for( y=y_start; y