ImageTwiddle.mesa
Last Edited by: Crow, April 4, 1989 11:16:11 am PDT
DIRECTORY Terminal, Rope, Imager, G3dRender;
Colors
SetNamedColor: PROC [imagerCtx: Imager.Context, color: Rope.ROPE];
SetRGBColor:
PROC [imagerCtx: Imager.Context, clr:
RGB];
Called to set color in imager contexts
Rotate8BitClrMap:
PROC [vt: Terminal.Virtual, firstValue, lastValue, duration:
NAT ← 0];
For far out cheap thrills with color map
Show8BitClrMap:
PROC [context: Context];
display color map values in top middle of screen
ShowMapOnLog:
PUBLIC PROC [context: Context, vt: Terminal.Virtual];
Print color map on log for context
LoadMultiRamps:
PROC [vt: Terminal.Virtual, colors:
LIST
OF
RGB];
load linear ramps between succesive colors in list, divide color map into roughly equal parts
ThresholdClrMap:
PROC [vt: Terminal.Virtual, levels:
NAT];
set color map to constant steps simulating restricted number of grey levels
ThresholdImage:
PROC [context: Context, levels:
NAT];
adjust pixel values over whole image to conform restricted number of grey levels
AdjustValueRamp:
PROC[context: Context, exponent:
RGB];
adjust pixel values over whole image to conform to ramp bent by exponent
AdjustSaturation:
PROC[context: Context, percent:
REAL];
adjust pixel values over whole image to change saturation of image
LoadOldStd8BitClrMap:
PUBLIC PROC [vt: Terminal.Virtual];
For backward compatibility with old AIS files, may be obsolete
SetUpTerrainColors:
PROC[vt: Terminal.Virtual];
Set up custom colormap for old terrain map images
Image manipulation
DitherImage:
PROC[dstContext, rgbContext: Context];
Dither a full-color image down to 8 bits using 6x6x6 cube color map
ScaleDownImage:
PROC[dstContext, srcContext: Context, strtchFctr:
REAL ← 1.0];
Scale image down to size given by viewports, uses Bresenham scaler. StrtchFctr scales source pixel values to expand or compress dynamic range