scale.sml

  Download

More scripts: Raster

Syntax Highlighing:

comments, key words, predefined symbols, class members & methods, functions & classes
            
# scale.sml
# sample script: Getting Started
# scales a grayscale raster into full 0-255 range
#
raster A, B;
numeric offset, range;
GetInputRaster(A);
GetOutputRaster(B,NumLins(A),NumCols(A));
offset = GlobalMin(A);
range = GlobalMax(A) - offset;
B = (A - offset) * 255 / range;
CopySubobjects (A,B);