colorToGreyscale.sml

  Download

More scripts: Raster

Syntax Highlighing:

comments, key words, predefined symbols, class members & methods, functions & classes
            
CLASS Raster r, g, b, o;
GetInputRaster(r);
GetInputRaster(g);
GetInputRaster(b);
GetOutputRaster(o, r.$Info.NumLins, r.$Info.NumCols, "8-bit unsigned");
Numeric lin, col;
for each r[lin, col] {
	o[lin, col] = .3 * r[lin, col] + .59 * g[lin, col] + .11 * b[lin, col];
}