ImagerTest.cm
Run ImagerPackage
&masterFont ← ImagerFont.Find["Xerox/PressFonts/Classic-MRR"]
&font18 ← ImagerFont.Scale[&masterFont, 18]
&font200 ← ImagerFont.Scale[&masterFont, 200]
&font400 ← ImagerFont.Scale[&masterFont, 400]
&triangle ← ImagerPath.MoveTo[[100, 250]]
&triangle ← ImagerPath.LineTo[&triangle, [250, 300]]
&triangle ← ImagerPath.LineTo[&triangle, [200, 400]]
&clip ← ImagerPath.MoveTo[[100, 100]]
&clip ← ImagerPath.LineTo[&clip, [400, 150]]
&clip ← ImagerPath.LineTo[&clip, [200, 300]]
&pa ← ImagerPixelArray.FromAIS["[Cyan]<AIS>NewParc.ais"]
&paTransform ← ImagerTransformation.Scale[1]
&skew ← ImagerTransformation.Create[1, .3, 0, 0, 1, 0]
&tileTransform ← ImagerTransformation.Scale[.25]
ImagerTransformation.PreRotate[&tileTransform, 33]
ImagerTransformation.PreMultiply[&tileTransform, &skew]
&lfDisplay ← ImagerFrameBuffer.LFDisplay[]
&lfDevice ← ImagerLFDeviceImpl.Create[&lfDisplay, 72]
&ctx ← ImagerRasterImpl.Create[&lfDevice]
&grayDisplay ← ImagerFrameBuffer.GrayScaleDisplay8[]
&grayDevice ← ImagerGrayDeviceImpl.Create[&grayDisplay]
&ctx ← ImagerRasterImpl.Create[&grayDevice]
&smoothGrayDisplay ← ImagerFrameBuffer.GrayScaleDisplay8[]
&smoothGrayDevice ← ImagerSmoothGrayDeviceImpl.Create[&smoothGrayDisplay]
&ctx ← ImagerRasterImpl.Create[&smoothGrayDevice]
&color24Device ← ImagerColor24DeviceImpl.Create[]
&ctx ← ImagerRasterImpl.Create[&color24Device]
&rgbWhite ← ImagerColor.MakeCIE[ImagerColor.CIEFromRGB[[1, 1, 1]]]
Imager.SetColor[&ctx, &rgbWhite]
Imager.SetGray[&ctx, 0]
Imager.MaskRectangle[&ctx, 0, 0, 2000, 2000]
Imager.SetGray[&ctx, 1]
&hornetParams ← ImagerPD.Hornet[]
&ctx ← ImagerPD.Create["Test.pd", &hornetParams]
&versatecParams ← ImagerPD.ColorVersatec[]
&ctx ← ImagerPD.Create["Test.pd", &versatecParams]
&ravenParams ← ImagerPD.Raven[]
&ctx ← ImagerPD.Create["Test.pd", &ravenParams]
PDFileWriter.EndPage[&ctx.data.device.data.pdState]
PDFileWriter.Close[&ctx.data.device.data.pdState]
Run ShortRationalImpl
Run IPXeroxWriterImpl
Run ImagerInterpressImpl
&ctx ← ImagerInterpressImpl.Open["///Users/Wyatt.pa/NewImager/Test.interpress"]
ImagerInterpressImpl.Close[&ctx]
Imager.ScaleT[&ctx, 0.0254/72]
Imager.TranslateT[&ctx, [10, 10]]
Imager.SetGray[&ctx, 1]
Imager.MaskRectangle[&ctx, 0, 0, 150, 100]
Imager.MaskRectangle[&ctx, 200, 20, 50, 200]
Imager.SetGray[&ctx, 0]
Imager.MaskRectangle[&ctx, 70, 50, 150, 20]
Imager.SetFont[&ctx, &font18]
Imager.SetGray[&ctx, 1]
Imager.SetXY[&ctx, [100, 53]]
Imager.ShowRope[&ctx, "This is a test!"]
Imager.SetStrokeWidth[&ctx, 20]
Imager.MaskStrokeClosed[&ctx, ImagerPath.MapTrajectory, &triangle]
&rgbColorOp ← ImagerColorImpl.RGBColorOperator[sMax: 255, sMin: 0]
&negColorOp ← ImagerColorImpl.RGBColorOperator[sMax: 0, sMin: 255]
&funnyColorOp ← ImagerColorImpl.RGBColorOperator[sMax: 255, sMin: 0]
&ygn ← ImagerPixelArray.FromAISSeparations["[Cyan]<AIS>ygn-red.ais", "[Cyan]<AIS>ygn-grn.ais", "[Cyan]<AIS>ygn-blu.ais"]
Imager.SetSampledColor[&ctx, &ygn, &paTransform, &rgbColorOp]
Imager.MaskRectangle[&ctx, 0, 0, 512, 499]
&botticelli ← ImagerPixelArray.FromAISSeparations["[Pixel]<Images>Lamming>botticelli-red.ais", "[Pixel]<Images>Lamming>botticelli-grn.ais", "[Pixel]<Images>Lamming>botticelli-blu.ais"]
Imager.SetSampledColor[&ctx, &botticelli, &paTransform, &rgbColorOp]
Imager.MaskRectangle[&ctx, 0, 0, 824, 824]
&triplane ← ImagerPixelArray.FromAISSeparations["[Pixel]<Images>Lamming>triplane-red.ais", "[Pixel]<Images>Lamming>triplane-grn.ais", "[Pixel]<Images>Lamming>triplane-blu.ais"]
Imager.SetSampledColor[&ctx, &triplane, &paTransform, &rgbColorOp]
Imager.MaskRectangle[&ctx, 0, 0, 532, 436]
&dotty ← ImagerPixelArray.FromAISSeparations["[Pixel]<Images>Lamming>dotty-red.ais", "[Pixel]<Images>Lamming>dotty-grn.ais", "[Pixel]<Images>Lamming>dotty-blu.ais"]
Imager.SetSampledColor[&ctx, &dotty, &paTransform, &rgbColorOp]
Imager.MaskRectangle[&ctx, 0, 0, 950, 790]
&Girl22 ← ImagerPixelArray.FromAISSeparations["[Cyan]<AIS>Girl22-red.ais", "[Cyan]<AIS>Girl22-green.ais", "[Cyan]<AIS>Girl22-blue.ais"]
Imager.SetSampledColor[&ctx, &Girl22, &paTransform, &rgbColorOp]
Imager.MaskRectangle[&ctx, 0, 0, 512, 512]
&Freckles ← ImagerPixelArray.FromAISSeparations["[Cyan]<AIS>Freckles-red.ais", "[Cyan]<AIS>Freckles-green.ais", "[Cyan]<AIS>Freckles-blue.ais"]
Imager.SetSampledColor[&ctx, &Freckles, &paTransform, &rgbColorOp]
Imager.MaskRectangle[&ctx, 0, 0, 512, 512]
&Baboon ← ImagerPixelArray.FromAISSeparations["[Cyan]<AIS>Baboon-red.ais", "[Cyan]<AIS>Baboon-green.ais", "[Cyan]<AIS>Baboon-blue.ais"]
Imager.SetSampledColor[&ctx, &Baboon, &paTransform, &rgbColorOp]
Imager.MaskRectangle[&ctx, 0, 0, 512, 512]
&grayColorOp ← ImagerColorImpl.GrayLinearColorOperator[sWhite: 255, sBlack: 0]
&grayColorOp ← ImagerColorImpl.GrayLinearColorOperator[sWhite: 220, sBlack: 30]
&grayColorOp ← ImagerColorImpl.GrayLinearColorOperator[sWhite: 190, sBlack: 50]
&train ← ImagerPixelArray.FromAIS["[Indigo]<PIC>train.press"]
Imager.SetSampledColor[&ctx, &train, &paTransform, &grayColorOp]
Imager.MaskRectangle[&ctx, 0, 0, 784, 784]
&earthAndMoon ← ImagerPixelArray.FromAISSeparations[ "[Pixel]<Images>Wyatt>1984CopyrightJPL>EarthAndMoon.lff-red.ais", "[Pixel]<Images>Wyatt>1984CopyrightJPL>EarthAndMoon.lff-green.ais", "[Pixel]<Images>Wyatt>1984CopyrightJPL>EarthAndMoon.lff-blue.ais"]
ImagerTransformation.PostScale2[&earthAndMoon.m, [1.25, 1]]
Imager.SetSampledColor[&ctx, &earthAndMoon, &paTransform, &rgbColorOp]
Imager.MaskRectangle[&ctx, 0, 0, 512*1.25, 486]
ImagerLFDeviceImpl.SetHalftone[&ctx.data.device, [10, 30, .5]]
ImagerLFDeviceImpl.SetHalftone[&ctx.data.device, [16.1, 26.56505, .5]]
Imager.MaskFill[&ctx, ImagerPath.MapTrajectory, &triangle]
Imager.ClipOutline[&ctx, ImagerPath.MapTrajectory, &clip]
Imager.ShowRope[&ctx, "ABCDEFGHIJKLMNOPQRSTUVWXYZ"]
Imager.ShowRope[&ctx, "abcdefghijklmnopqrstuvwxyz"]