DIRECTORY Terminal, Rope, Imager, G3dRender; ImageTwiddle: CEDAR DEFINITIONS ~ BEGIN Context: TYPE ~ G3dRender.Context; RGB: TYPE ~ G3dRender.RGB; SetNamedColor: PROC [imagerCtx: Imager.Context, color: Rope.ROPE]; SetRGBColor: PROC [imagerCtx: Imager.Context, clr: RGB]; Rotate8BitClrMap: PROC [vt: Terminal.Virtual, firstValue, lastValue, duration: NAT _ 0]; Show8BitClrMap: PROC [context: Context]; ShowMapOnLog: PUBLIC PROC [context: Context, vt: Terminal.Virtual]; LoadMultiRamps: PROC [vt: Terminal.Virtual, colors: LIST OF RGB]; ThresholdClrMap: PROC [vt: Terminal.Virtual, levels: NAT]; ThresholdImage: PROC [context: Context, levels: NAT]; AdjustValueRamp: PROC[context: Context, exponent: RGB]; AdjustSaturation: PROC[context: Context, percent: REAL]; LoadOldStd8BitClrMap: PUBLIC PROC [vt: Terminal.Virtual]; SetUpTerrainColors: PROC[vt: Terminal.Virtual]; DitherImage: PROC[dstContext, rgbContext: Context]; ScaleDownImage: PROC[dstContext, srcContext: Context, strtchFctr: REAL _ 1.0]; END. πImageTwiddle.mesa Last Edited by: Crow, April 4, 1989 11:16:11 am PDT Types Colors Called to set color in imager contexts For far out cheap thrills with color map display color map values in top middle of screen Print color map on log for context load linear ramps between succesive colors in list, divide color map into roughly equal parts set color map to constant steps simulating restricted number of grey levels adjust pixel values over whole image to conform restricted number of grey levels adjust pixel values over whole image to conform to ramp bent by exponent adjust pixel values over whole image to change saturation of image For backward compatibility with old AIS files, may be obsolete Set up custom colormap for old terrain map images Image manipulation Dither a full-color image down to 8 bits using 6x6x6 cube color map Scale image down to size given by viewports, uses Bresenham scaler. StrtchFctr scales source pixel values to expand or compress dynamic range ΚΙ˜headšœ™Jšœ3™3IdefaultšΟk œ#˜,—head2šœœ ˜Jšœ˜—head3šΠbi™Iunitšœ œ˜"Jšœœ œ˜—šΟb™IašΟn œœ)œ˜Bš  œœ"œ˜8P™'—š œœ9œ˜XP™*—š œœ˜(P™2—š  œ œ*˜CP™#—š  œœ œœœ˜AP™_—š œœ œ˜:P™M—š œœœ˜5P™R—š œœœ˜7P™J—š œœœ˜8P™D—š œ œ˜9P™@—š œœ˜/P™1——šŸ™š  œœ"˜3J™D—š œœ.œ˜NJšœ™—J˜—Jšœ˜—…—π ©