/* ciitestpcl5printmodel.c */ /* Michael Plass, October 29, 1993 1:48 pm PDT */ /* --------------------------------- Date: 27-Oct-93 16:35:34 PDT Subject: would you like a test case for testing CII_MakeSampledBlack and CII_MaskBitmap? Message-ID: Originator: "Shiva Golbahar:ESCP10:Xerox", UniqueString: "27-Oct-93 16:35:34 PDT" To: Plass:PARC Reply-To: Shiva Golbahar From: Shiva Golbahar:ESCP10:Xerox Received: by jahan.cp10.es.xerox.com (4.1/SMI-4.1) id AA03016; Wed, 27 Oct 93 16:35:33 PDT Michael, I used the following to test the 4 PCL5 print models. Thought you might like to add it to your test cases in /printing10.1/CII. Shiva... --------------------------------- */ #include "cii.h" #include "cii_matrix.h" #define NULL ((void*)0) #define NIL ((void*)0) unsigned char patternBits[] = { 0x00, 0x00, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; unsigned char sourceBits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xF0, 0x00, 0x00, 0x07, 0xF0, 0x00, 0x00, 0x07, 0xF0, 0x00, 0x00, 0x07, 0xF0, 0x00, 0x00, 0x07, 0xF0, 0x00, 0x00, 0x07, 0xF0, 0x00, 0x00, 0x07, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; extern void run_pcl5printmodel(CII_Handle h) { float m[6]; float save[6]; CII_RectangleRep rect1 = {0.0, 0.0, 150.0, 150.0}; CII_RectangleRep rect2 = {150.0, 150.0, 150.0, 150.0}; CII_RasterRep pattern = { 0, 0, 7, 7, 1, 32, (long *)patternBits, 32-7, (void*)0 }; CII_RasterRep source = { 0, 0, 15, 15, 1, 32, (long *)sourceBits, 32-15, (void*)0 }; CII_Boolean clear; CII_Color color; CII_Color white; float delta = 34.0; float pixel[1]; CII_ColorOperator co = NULL; CII_SampleRange sampleRange; sampleRange.sWhite = 1.0; sampleRange.sBlack = 0.0; pixel[0] = 1.0; CII_MakeGrayColorOperator(h, &sampleRange, 0, NULL, &co); CII_MakeColor(h, co, 1, pixel, &white); CII_GetMatrix(h, m); CII_GetMatrix(h, save); CIU_ApplyPreTranslate(300.0, 300.0, m); CII_SetMatrix(h, m); CII_MaskRectangle(h, &rect1); CII_MaskRectangle(h, &rect2); CIU_ApplyPreTranslate(10.0*delta, 0.0, m); CII_SetMatrix(h, m); CII_MaskRectangle(h, &rect1); CII_MaskRectangle(h, &rect2); CIU_ApplyPreTranslate(0.0, 10.0*delta, m); CII_SetMatrix(h, m); CII_MaskRectangle(h, &rect1); CII_MaskRectangle(h, &rect2); CIU_ApplyPreTranslate(-10.0*delta, 0.0, m); CII_SetMatrix(h, m); CII_MaskRectangle(h, &rect1); CII_MaskRectangle(h, &rect2); CIU_ApplyPreTranslate(0.0, -10.0*delta, m); CIU_ApplyPreScale(10.0, m); CII_SetMatrix(h, m); /* InkMix = opaque; MaskMix = transparent (lower left) */ clear = 0; CII_MakeSampledBlack(h, &pattern, save, clear, &color); CII_SetColor(h, color); CIU_ApplyPreTranslate(7.5, 7.5, m); CII_SetMatrix(h, m); CII_MaskBitmap(h, &source, NIL); /* InkMix = transparent; MaskMix = transparent (lower right) */ clear = 1; CII_MakeSampledBlack(h, &pattern, save, clear, &color); CII_SetColor(h, color); CIU_ApplyPreTranslate(delta, 0.0, m); CII_SetMatrix(h, m); CII_MaskBitmap(h, &source, NIL); /* InkMix = opaque; MaskMix = opaque (upper right) */ clear = 0; CII_MakeSampledBlack(h, &pattern, save, clear, &color); CII_SetColor(h, color); CIU_ApplyPreTranslate(0.0, delta, m); CII_SetMatrix(h, m); CII_MaskBitmap(h, &source, white); /* InkMix = transparent; MaskMix = opaque (upper left) */ clear = 1; CII_MakeSampledBlack(h, &pattern, save, clear, &color); CII_SetColor(h, color); CIU_ApplyPreTranslate(-delta, 0.0, m); CII_SetMatrix(h, m); CII_MaskBitmap(h, &source, white); } CII_RES XR_run_ciitestpcl5printmodel() { CII_Handle dev = (CII_Handle)CII_TestDevice(); float t[6]; CII_GetInitialMatrix(dev, t); CIU_ApplyPreTranslate(-280.0, -200.0, t); CII_SetMatrix(dev, t); run_pcl5printmodel(dev); return CII_Destroy(dev); }