DIRECTORY ImagerSource: CEDAR DEFINITIONS = BEGIN Color: TYPE[2]; red, green, blue, magenta, cyan, yellow, black, white: Color; IntensityToColor: PROC [intensity: REAL] RETURNS [Color]; HSVToColor: PROC [h, s, v: REAL] RETURNS [Color]; RGBToColor: PROC [r, g, b: REAL] RETURNS [Color]; ColorToIntensity: PROC [color: Color] RETURNS [intensity: REAL]; ColorToHSV: PROC [color: Color] RETURNS [h, s, v: REAL]; ColorToRGB: PROC [color: Color] RETURNS [r, g, b: REAL]; Sampled Sources SampledSource: TYPE = ImagerBasic.SampledSource; SampleSequence: TYPE = ImagerBasic.SampleSequence; ColorModel: TYPE = ImagerBasic.ColorModel; ColorModelRec: TYPE = RECORD [colorModelProc: ColorModelProc, colorModelData: REF _ NIL]; ColorModelProc: TYPE = PROC [sample: LONG CARDINAL, colorModelData: REF] RETURNS [Color]; RegisterColorModel: PROC [colorModel: ColorModel, colorModelRec: ColorModelRec]; FindColorModel: PROC [colorModel: ColorModel] RETURNS [ColorModelRec]; END. ~ImagerSource.mesa This provides utilities for dealing with colors and sampled images Last Edited by: Crow, May 11, 1983 1:39 pm Constant Sources A uniform color. Functional colors. Making new colors. These procedures will SIGNAL Runtime.BoundsFault for any argument not in [0..1]; resuming the signal will perform arg _ MAX[0,MIN[1,arg]]. Deciphering colors. A client of the Imager may keep a sampled source in a form appropriate for its own use; it only needs to provide a way to extract a set of evenly-spaced samples along an arbitrary line segment. The sample values are interpreted according to a color model, which simply tells how to map the sample values into constant colors. There are some predefined color models; the client is free to create others. Predefined color models: $OneBitPerPixelGray $EightBitPerPixelGray $StandardColorMap $Identity -- no translation needed ΚΟ˜head™J™BJ™šœ™Jšœ™—IunitšΟk ˜ Kšœ˜Jšœ˜J˜šΟb™™Lšœœ˜—J™™Jšœ=˜=—J˜šœž™žJšΟnœœ œœ˜9JšŸ œœ œœ˜1JšŸ œœ œœ˜1—™JšŸœœœ œ˜@JšŸ œœœ œ˜8JšŸ œœœ œ˜8J˜—šž˜JšœΑ™Α™ΡLšœœ˜0Lšœœ˜2Lšœ œ˜*Lš œœœ2œœ˜YLšŸœœœ œœœœ ˜YLšŸœœ8˜PLšŸœœœ˜FJ˜™Jšœ™Jšœ™Jšœ™Jšœ Οc™"J™————Jšœ˜——…—Ζ