DIRECTORY Imager, ImagerDefault, Rope, Scaled; ImagerDefaultImpl: CEDAR PROGRAM IMPORTS Imager EXPORTS Imager, ImagerDefault = BEGIN OPEN ImagerDefault; NotImplemented: PUBLIC ERROR = CODE; NotImplementedForThisDevice: PUBLIC ERROR = CODE; MaskStroke: PUBLIC PROC [context: Context, path: Path] = { ERROR NotImplemented }; MaskFill: PUBLIC PROC [context: Context, path: Path] = { ERROR NotImplemented }; MaskPixel: PUBLIC PROC [context: Context, pixelArray: PixelArray] = { ERROR NotImplemented }; MaskThinLine: PUBLIC PROC [context: Context, p0, p1: FixedVec] = { ERROR NotImplemented }; MaskThinStroke: PUBLIC PROC [context: Context, path: Path] = { ERROR NotImplemented }; MaskRectangle: PUBLIC PROC [context: Context, r: Rectangle] = { ERROR NotImplemented }; ClipArea: PUBLIC PROC [context: Context, path: Path, exclude: BOOLEAN] = { ERROR NotImplemented }; ClipRectangle: PUBLIC PROC [context: Context, r: Rectangle, exclude: BOOLEAN] = { ERROR NotImplemented }; TestRectangle: PUBLIC PROC [context: Context, r: Rectangle] RETURNS [Visibility] = { ERROR NotImplemented }; TestPoint: PUBLIC PROC [context: Context, p: FixedVec] RETURNS [BOOLEAN] = { ERROR NotImplemented }; MaskChar: PUBLIC PROC [context: Context, char: CHAR] = { ERROR NotImplemented }; MaskCharacters: PUBLIC PROC [context: Context, characters: REF, start: INT _ 0, length: INT _ LAST[INT]] = { ERROR NotImplemented }; MaskCharSeq: PUBLIC PROC [context: Context, length: NAT, charPtr: LONG POINTER TO CHAR, charIncrement: NAT, deltaXptr: LONG POINTER TO FIXED, deltaXincrement: NAT, deltaYptr: LONG POINTER TO FIXED, deltaYincrement: NAT] = { ERROR NotImplemented }; NewTransformation: PUBLIC PROC [context: Context] = { ERROR NotImplemented }; NewSource: PUBLIC PROC [context: Context] = { ERROR NotImplemented }; NewFont: PUBLIC PROC [context: Context] = { ERROR NotImplemented }; NewPage: PUBLIC PROC [context: Context] = { ERROR NotImplemented }; Destroy: PUBLIC PROC [context: Context] = { ERROR NotImplemented }; VideoInvertStroke: PUBLIC PROC [context: Context, path: Path] = { ERROR NotImplementedForThisDevice }; VideoInvertArea: PUBLIC PROC [context: Context, path: Path] = { ERROR NotImplementedForThisDevice }; VideoInvertPixels: PUBLIC PROC [context: Context, pixelArray: PixelArray] = { ERROR NotImplementedForThisDevice }; VideoInvertThinLine: PUBLIC PROC [context: Context, p0, p1: FixedVec] = { ERROR NotImplementedForThisDevice }; VideoInvertRectangle: PUBLIC PROC [context: Context, r: Rectangle] = { ERROR NotImplementedForThisDevice }; GetImage: PUBLIC PROC [context: Context] RETURNS [SampledSource] = { ERROR NotImplementedForThisDevice }; GetMutableImage: PUBLIC PROC [context: Context] RETURNS [SampledSource] = { ERROR NotImplementedForThisDevice }; MakeCompatibleContext: PUBLIC PROC [context: Context, boundary: Rectangle] RETURNS [Context] = { ERROR NotImplementedForThisDevice }; MaskConstantRuns: PUBLIC PROC [context: Context, sMin, sSize: CARDINAL, map: PROC[PROC[s, fMin, fSize: CARDINAL]]] = { color: Imager.Color _ context.currentSource.constantSource; RunProc: PROC[s, fMin, fSize: CARDINAL] = { FOR f: CARDINAL IN [fMin..fMin+fSize] DO context.procs.MaskSinglePixel[context, color, s, f]; ENDLOOP; }; IF context.currentSource.sampledSource # NIL THEN ERROR; map[RunProc]; }; MaskSampledRuns: PUBLIC PROC [context: Context, samples: SampleSequence, sMin, sSize: CARDINAL, map: PROC[PROC[s, fMin, fSize: CARDINAL]]] = { sampledSource: Imager.SampledSource _ context.currentSource.sampledSource; IF sampledSource = NIL THEN ERROR ELSE { colorModelRec: Imager.ColorModelRec _ Imager.FindColorModel[sampledSource.colorModel]; RunProc: PROC[s, fMin, fSize: CARDINAL] = { FOR f: CARDINAL IN [fMin..fMin+fSize] DO pixelValue: LONG CARDINAL _ samples.seq[f-fMin]; color: Imager.Color _ colorModelRec.colorModelProc[pixelValue, colorModelRec.colorModelData]; context.procs.MaskSinglePixel[context, color, s, f]; ENDLOOP; }; map[RunProc]; }; }; MaskConstantPixels: PUBLIC PROC [context: Context, mask: PixelSequence, sMin, sSize: CARDINAL, map: PROC[PROC[s, fMin, fSize: CARDINAL]]] = { color: Imager.Color _ context.currentSource.constantSource; RunProc: PROC[s, fMin, fSize: CARDINAL] = { FOR f: CARDINAL IN [fMin..fMin+fSize] DO IF mask.seq[f-fMin] = 1 THEN context.procs.MaskSinglePixel[context, color, s, f]; ENDLOOP; }; IF context.currentSource.sampledSource # NIL THEN ERROR; map[RunProc]; }; MaskSampledPixels: PUBLIC PROC [context: Context, mask: PixelSequence, samples: SampleSequence, sMin, sSize: CARDINAL, map: PROC[PROC[s, fMin, fSize: CARDINAL]]] = { sampledSource: Imager.SampledSource _ context.currentSource.sampledSource; IF sampledSource = NIL THEN ERROR ELSE { colorModelRec: Imager.ColorModelRec _ Imager.FindColorModel[sampledSource.colorModel]; RunProc: PROC[s, fMin, fSize: CARDINAL] = { FOR f: CARDINAL IN [fMin..fMin+fSize] DO IF mask.seq[f-fMin] = 1 THEN { pixelValue: LONG CARDINAL _ samples.seq[f-fMin]; color: Imager.Color _ colorModelRec.colorModelProc[pixelValue, colorModelRec.colorModelData]; context.procs.MaskSinglePixel[context, color, s, f]; }; ENDLOOP; }; map[RunProc]; }; }; MaskSinglePixel: PUBLIC PROC [context: Context, pixelValue: Color, s, f: CARDINAL] = { ERROR NotImplemented }; DefaultProcs: PUBLIC PROC RETURNS [Procs] = { RETURN [NEW[Imager.ProcsRec _ [ MaskStroke: ImagerDefault.MaskStroke, MaskFill: ImagerDefault.MaskFill, MaskThinLine: ImagerDefault.MaskThinLine, MaskThinStroke: ImagerDefault.MaskThinStroke, MaskRectangle: ImagerDefault.MaskRectangle, ClipArea: ImagerDefault.ClipArea, ClipRectangle: ImagerDefault.ClipRectangle, TestRectangle: ImagerDefault.TestRectangle, TestPoint: ImagerDefault.TestPoint, MaskChar: ImagerDefault.MaskChar, MaskCharacters: ImagerDefault.MaskCharacters, MaskCharSeq: ImagerDefault.MaskCharSeq, NewTransformation: ImagerDefault.NewTransformation, NewSource: ImagerDefault.NewSource, NewFont: ImagerDefault.NewFont, NewPage: ImagerDefault.NewPage, Destroy: ImagerDefault.Destroy, VideoInvertStroke: ImagerDefault.VideoInvertStroke, VideoInvertArea: ImagerDefault.VideoInvertArea, VideoInvertPixels: ImagerDefault.VideoInvertPixels, VideoInvertThinLine: ImagerDefault.VideoInvertThinLine, VideoInvertRectangle: ImagerDefault.VideoInvertRectangle, GetImage: ImagerDefault.GetImage, GetMutableImage: ImagerDefault.GetMutableImage, MakeCompatibleContext: ImagerDefault.MakeCompatibleContext, MaskConstantRuns: ImagerDefault.MaskConstantRuns, MaskSampledRuns: ImagerDefault.MaskSampledRuns, MaskConstantPixels: ImagerDefault.MaskConstantPixels, MaskSampledPixels: ImagerDefault.MaskSampledPixels, MaskSinglePixel: ImagerDefault.MaskSinglePixel ]]]; }; END. ŠImagerDefaultImpl.mesa Created April 8, 1983 Last Edit By: Plass, April 8, 1983 7:38 pm Last Edited by: Crow, May 28, 1983 4:39 pm Κ;˜Jšœ™J™™ J™—J™*JšΟk œ%˜.šœ ˜ Jšœ˜Jšœ˜Jšœœœ˜Jšœœœœ˜$Jšœœœœ˜1unitšΟn œœœ#˜:Jšœ˜Jšœ˜—šžœœœ#˜8Jšœ˜Jšœ˜—šž œœœ/˜EJšœ˜Jšœ˜—šž œœœ)˜BJšœ˜Jšœ˜—šžœœœ#˜>Jšœ˜Jšœ˜—šž œœœ%˜?Jšœ˜Jšœ˜—šžœœœ)œ˜JJšœ˜Jšœ˜—šž œœœ+œ˜QJšœ˜Jšœ˜—šž œœœ"œ˜TJšœ˜Jšœ˜—š ž œœœ!œœ˜LJšœ˜Jšœ˜—šžœœœœ˜8Jšœ˜Jšœ˜—šžœœœ œ œœœœ˜lJšœ˜Jšœ˜—š&ž œœœœ œœœœœ œœœœœ œœœœœ˜ίJšœ˜Jšœ˜—šžœœœ˜5Jšœ˜Jšœ˜—šž œœœ˜-Jšœ˜Jšœ˜—šžœœœ˜+Jšœ˜Jšœ˜—šžœœœ˜+Jšœ˜Jšœ˜—šžœœœ˜+Jšœ˜Jšœ˜—šžœœœ#˜AJšœ˜!Jšœ˜—šžœœœ#˜?Jšœ˜!Jšœ˜—šžœœœ/˜MJšœ˜!Jšœ˜—šžœœœ)˜IJšœ˜!Jšœ˜—šžœœœ%˜FJšœ˜!Jšœ˜—šžœœœœ˜DJšœ˜!Jšœ˜—šžœœœœ˜KJšœ˜!Jšœ˜—šžœœœ)œ˜`Jšœ˜!Jšœ˜—šžœœœ!œœœœ˜vJšœ;˜;šœ œœ˜+šœœœ˜(Jšœ4˜4Jšœ˜—Jšœ˜—Jšœ'œœœ˜8Jšœ ˜ Jšœ˜—šžœœœ:œœœœ˜ŽJšœJ˜JJšœœœ˜!šœ˜JšœV˜Všœ œœ˜+šœœœ˜(Jšœ œœ˜0Jšœ]˜]Jšœ4˜4Jšœ˜—Jšœ˜—Jšœ ˜ J˜—Jšœ˜—šžœœœ6œœœœ˜Jšœ;˜;šœ œœ˜+šœœœ˜(Jšœœ5˜QJšœ˜—Jšœ˜—Jšœ'œœœ˜8Jšœ ˜ Jšœ˜—šžœœœOœœœœ˜₯JšœJ˜JJšœœœ˜!šœ˜JšœV˜Všœ œœ˜+šœœœ˜(šœœ˜Jšœ œœ˜0Jšœ]˜]Jšœ4˜4J˜—Jšœ˜—Jšœ˜—Jšœ ˜ J˜—Jšœ˜—šžœœœ-œ˜VJšœ˜Jšœ˜—šž œœœœ ˜-šœœ˜Jšœ%˜%Jšœ!˜!Jšœ)˜)Jšœ-˜-Jšœ+˜+Jšœ!˜!Jšœ+˜+Jšœ+˜+Jšœ#˜#Jšœ!˜!Jšœ-˜-Jšœ'˜'Jšœ3˜3Jšœ#˜#Jšœ˜Jšœ˜Jšœ˜Jšœ3˜3Jšœ/˜/Jšœ3˜3Jšœ7˜7Jšœ9˜9Jšœ!˜!Jšœ/˜/Jšœ;˜;Jšœ1˜1Jšœ/˜/Jšœ5˜5Jšœ3˜3Jšœœ˜.Jšœ˜—Jšœ˜—Kšœ˜—J˜—…—φ"»