-- ImagerFunctionDeviceTest.cm
-- Mik Lamming - October 7, 1985 11:35:12 am PDT
Last edited by: Mik Lamming - November 1, 1985 1:27:46 pm PST
bringover [Cedar]<CedarChest6.0>Top>ImagerViewer.df
bringover [Cedar]<CedarChest6.0>Top>AIS.df
bringover [Cedar]<CedarChest6.0>Top>Interpress.df
bringover /ivy/lamming/top/PixelmapFuns.df
copy ///fonts/xerox/xc1-1-1-0/ITCBauhausMRRc0.sd ← /cyan/imaging/fonts/ITCBauhausMRRc0.sd
copy ///fonts/xerox/xc1-1-1-0/ITCBauhausBRRc0.sd ← /cyan/imaging/fonts/ITCBauhausBRRc0.sd
copy ///fonts/xerox/xc1-1-1-0/ITCBerkeleyMRRc0.sd ← /cyan/imaging/fonts/ITCBerkeleyMRRc0.sd
copy ///fonts/xerox/xc1-1-1-0/ITCBerkeleyBRRc0.sd ← /cyan/imaging/fonts/ITCBerkeleyBRRc0.sd
copy ///fonts/xerox/xc1-1-1-0/ITCBerkeleyMIRc0.sd ← /cyan/imaging/fonts/ITCBerkeleyMIRc0.sd
copy ///fonts/xerox/xc1-1-1-0/FlemishScriptIIMRRc0.sd ← /cyan/imaging/fonts/FlemishScriptIIMRRc0.sd
colordisplay 8 on
run aisimpl
run pixelmapopsimpl
run ImagerFunctionDeviceImpl
run ImagerAlpha4DeviceImpl
run ImagerViewerimpl
run InterpressPackage
run PixelMapFunsImpl
← &sSize ← 800
← &fSize ← 800
← &scale ← &sSize / 500.0;
← &vc ← ImagerViewer.Create[[name:"vc", column:color, iconic:FALSE], pixels]
← ImagerViewer.Clear[&vc]
← &aisStem ← "BirdletCut"
← &aisRed ← Rope.Cat[&aisStem, "-red.ais"];
← &aisGrn ← Rope.Cat[&aisStem, "-grn.ais"];
← &aisBlu ← Rope.Cat[&aisStem, "-blu.ais"];
← &aisARed ← Rope.Cat[&aisStem, "-Ared.ais"];
← &aisAGrn ← Rope.Cat[&aisStem, "-Agrn.ais"];
← &aisABlu ← Rope.Cat[&aisStem, "-Ablu.ais"];
← &aisAlpha ← Rope.Cat[&aisStem, "-alpha.ais"];
← &bgStem ← "Driplet"
← &bgRed ← Rope.Cat[&bgStem, "-red.ais"];
← &bgGrn ← Rope.Cat[&bgStem, "-grn.ais"];
← &bgBlu ← Rope.Cat[&bgStem, "-blu.ais"];
← &bgARed ← Rope.Cat[&bgStem, "-Ared.ais"];
← &bgAGrn ← Rope.Cat[&bgStem, "-Agrn.ais"];
← &bgABlu ← Rope.Cat[&bgStem, "-Ablu.ais"];
← &bgAlpha ← Rope.Cat[&bgStem, "-alpha.ais"];
-- calculate a vignette for an alpha channel
← &temp ← PixelMapFunsImpl.LoadAIS[&bgRed];
← &bgH ← &temp.sSize
← &bgW ← &temp.fSize
← &temp.refRep.ref ← NIL;
← PixelMapFunsImpl.StoreAIS[PixelMapFunsImpl.Ellipse[&bgH, &bgW, 255, 0, 0.4, 0.85], &bgAlpha]
← ImagerAlpha4DeviceImpl.PremultiplyAIS[&bgRed, &bgGrn, &bgBlu, &bgAlpha, &bgARed, &bgAGrn, &bgABlu]
← &temp ← PixelMapFunsImpl.LoadAIS[&aisRed];
← &aisH ← &temp.sSize
← &aisW ← &temp.fSize
← &temp.refRep.ref ← NIL;
-- normalise the ais files for the alpha channel
← ImagerAlpha4DeviceImpl.PremultiplyAIS[&aisRed, &aisGrn, &aisBlu, &aisAlpha, &aisARed, &aisAGrn, &aisABlu]
-- make a pixel array from the color
← &pa ← ImagerAlpha4Device.MakePixelArrayFromAIS[&bgARed, &bgAGrn, &bgABlu, &bgAlpha];
← &pb ← ImagerAlpha4Device.MakePixelArrayFromAIS[&aisARed, &aisAGrn, &aisABlu, &aisAlpha];
-- create the alpha device
← &pms ← ImagerFunctionDeviceImpl.MakePMS[4,&fSize,&sSize]
← &c ← ImagerAlpha4Device.Create[&pms, ImagerFunctionDeviceImpl.LikeScreen[&sSize], 1]
-- set up font
← &fontH ← 120 * &scale
← &f ← ImagerFont.Scale[ImagerFont.Find["Xerox/xc1-1-1-0/FlemishScriptIIMRRc0"], &fontH]
-- ← &f ← ImagerFont.Scale[ImagerFont.Find["Xerox/PressFonts/TimesRoman-MRR"], &fontH]
← Imager.SetFont[&c, &f];
← &top ← &sSize-&fontH/3
← &left ← 30 * &scale
← Imager.SetColor[&c, ImagerAlpha4Device.MakeConstantColor[ImagerColor.ColorFromRGB[[0.5,0.6,1],NIL], 1]]
← Imager.MaskRectangle[&c, [0,0,&fSize,&sSize]]
← Imager.SetSampledColor[&c, &pa, ImagerTransformation.Scale[RealOps.Float[&fSize]/&bgW], NIL]
← Imager.MaskRectangle[&c, [0,0,&fSize,&sSize]]
← Imager.TranslateT[&c, [10*&scale, -20*&scale]];
← Imager.SetColor[&c, ImagerAlpha4Device.MakeConstantColor[ImagerColor.ColorFromRGB[[0,0,0],NIL], 0.25]]
← Imager.SetXY[&c, [&left+(110 * &scale), &top-&fontH]]
← Imager.ShowRope[&c, "Real"];
← Imager.SetXY[&c, [&left+(60 * &scale), &top-&fontH*2]]
← Imager.ShowRope[&c, "shadows?"];
← Imager.TranslateT[&c, [-10*&scale, 10*&scale]];
← Imager.SetColor[&c, ImagerAlpha4Device.MakeConstantColor[ImagerColor.ColorFromRGB[[1,0,0],NIL], 1]]
← Imager.SetXY[&c, [&left+(110 * &scale), &top-&fontH]]
← Imager.ShowRope[&c, "Real"];
← Imager.SetXY[&c, [&left+(60 * &scale), &top-&fontH*2]]
← Imager.ShowRope[&c, "shadows?"];
← Imager.ScaleT[&c, 0.3];
← Imager.TranslateT[&c, [&aisW*2, &aisH*2]];
← Imager.SetSampledColor[&c, &pb, ImagerTransformation.Scale[RealOps.Float[&fSize]/&aisW], NIL]
← Imager.MaskRectangle[&c, [0,0,&fSize,&sSize]]
← &pa2 ← ImagerOps.PixelArrayFromPixelMaps[&pms, ImagerTransformation.Invert[m: ImagerFunctionDeviceImpl.LikeScreen[&sSize]]]
← Imager.SetSampledColor[&vc, &pa2, NIL, ImagerColorOperator.RGBLinearColorModel[255]]
← Imager.MaskRectangle[&vc, [0,0,&fSize,&sSize]]
← &ipf ← ImagerInterpress.Create["Transparent.ip"];
← &ipc ← ImagerInterpressBackdoor.GetContext[&ipf];
← Imager.ScaleT[&ipc, 0.00035277778]
← &pa2 ← ImagerOps.PixelArrayFromPixelMaps[&pms, ImagerTransformation.Invert[m: ImagerFunctionDeviceImpl.LikeScreen[&sSize]]]
← Imager.SetSampledColor[&ipc, &pa2, NIL, ImagerColorOperator.RGBLinearColorModel[255]]
← Imager.MaskRectangle[&ipc, [0,0,&fSize,&sSize]]
← ImagerInterpressBackdoor.NewPage[&ipf, &ipc, TRUE];
← ImagerInterpress.Close[&ipf]
InterpressToPD transparent.pd ←transparent.ip color400
← PixelMapFunsImpl.StoreAIS[&pms.first, "GirlAndBird-red.ais"]
← PixelMapFunsImpl.StoreAIS[&pms.rest.first, "GirlAndBird-grn.ais"]
← PixelMapFunsImpl.StoreAIS[&pms.rest.rest.first, "GirlAndBird-blu.ais"]