You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1817 lines
71 KiB

1 month ago
  1. %!PS
  2. % Copyright (C) 2001-2023 Artifex Software, Inc.
  3. % All Rights Reserved.
  4. %
  5. % This software is provided AS-IS with no warranty, either express or
  6. % implied.
  7. %
  8. % This software is distributed under license and may not be copied,
  9. % modified or distributed except as expressly authorized under the terms
  10. % of the license contained in the file LICENSE in this distribution.
  11. %
  12. % Refer to licensing information at http://www.artifex.com or contact
  13. % Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
  14. % CA 94129, USA, for further information.
  15. %
  16. %
  17. % Tests for the image operators
  18. % Specifications for Image operator testing.
  19. %
  20. % 1. All 8 standard orientations (0, 90, 180, 270 degree rotations with
  21. % and without reflection); ditto those orientations perturbed by +/-
  22. % 10 degrees, and by 45 degrees.
  23. %
  24. % Enough space is provided around images on a test page to allow
  25. % these permutations to use the same page layout. This will make
  26. % test page construction easier and simplify page checking.
  27. %
  28. % 2. All 9 image types (ImageType 1 mask, ImageType 1 opaque,
  29. % ImageType 3 with all 3 InterleaveTypes and with unequal scaling
  30. % for InterleaveType 2 and 3, ImageType 4 with both range and
  31. % single-point matching).
  32. %
  33. % 3. DeviceGray, DeviceRGB, and DeviceN color, both direct and Indexed.
  34. % Indexed color will use the common pallete size of 256 colors.
  35. %
  36. % 4. For simple masks, both colored and uncolored Patterns.
  37. %
  38. % 5. CombineWithColor true and false; several different colors for the
  39. % true case (including black, white, other solid colors, halftones,
  40. % and patterns).
  41. %
  42. % 6. Source transparency true and false.
  43. %
  44. % 7. Texture transparency true and false.
  45. %
  46. % 8. Different RasterOp values.
  47. %
  48. % 9. For ImageType 4, different color keys (out-of-range, specific
  49. % color other than white, range without white).
  50. %
  51. % 10. String, file, and procedure data sources; for multi-component
  52. % color spaces, MultipleDataSources = true. This is tested by
  53. % constructing string data sources that are used as input to
  54. % SubFileDecode filter to create a filetype data source. These
  55. % filters are read into scratch strings for the procedure data
  56. % source case. The procedure data source scratch string length
  57. % does not match the raster width, and the width x height is
  58. % not an integer multiple of the string length.
  59. %
  60. % Also for the File case, the number of bytes consumed is
  61. % checked after the image operator to verify that the exact
  62. % amount of data is used. This is particularly important when
  63. % the currentfile is used as a source (possibly through a
  64. % filter.
  65. %
  66. % Image bytes per line are < 500 bytes to exercise direct and
  67. % buffer copy gs_image_next_planes mode with the default stream
  68. % buffer size of 512 bytes. Procedure string size is greater
  69. % than the image bytes per line for the same reason (sM and sD).
  70. %
  71. % Total string size is kept below 65535.
  72. /WidthRGB 83 def
  73. /HeightRGB 89 def
  74. %
  75. % 11. Banded and non-banded rendering. This can be tested by running
  76. % test files throuch with different page device parameters to
  77. % force banding vs. page mode.
  78. %
  79. % -------------------------------------------------------------------------
  80. %
  81. % Testing the RasterOp-related functions (5/6/7/8) is not necessary at this
  82. % time. They are well isolated logically.
  83. %
  84. % Testing orientation (1) and color masking (9) would be a good idea at some
  85. % point, because this code has broken many times in the past and has had a
  86. % long bug tail.
  87. %
  88. % The really important things to test are 2 (image type), 3/4 (color space --
  89. % but only with regard to number of components, plus DeviceN and simple masks
  90. % with a Pattern, which exercise special control paths), 10 (data source),
  91. % and 11 (banding modes).
  92. %
  93. % ==========================================================================
  94. %
  95. % Procedure to generate test mask data
  96. %
  97. % WM and HM must be defined prior to invocation
  98. % MaskGen -
  99. %
  100. % The mask data is stored into a string named /MaskData
  101. %
  102. % The mask consists of a "target". Bits past width WM are
  103. % filled with 1's to make sure that pad bits are ignored.
  104. %
  105. /MaskGen {
  106. /H8 HM 8 div def
  107. /X0 WM 2 div def
  108. /Y0 HM 2 div def
  109. /WB WM 7 add 8 div cvi def
  110. /MaskData WB HM mul string def
  111. /MB [ 128 64 32 16 8 4 2 1 ] def
  112. 0 1 HM 1 sub {
  113. /Y exch def
  114. 0 1 WB 1 sub {
  115. /B exch def % byte within the row
  116. /C B Y WB mul add def
  117. /P 0 def
  118. 0 1 7 {
  119. /b exch def % bit within the character
  120. /X b B 8 mul add def
  121. X WM lt
  122. { X Y eq
  123. X HM 1 sub Y sub eq or
  124. Y Y0 gt X X0 sub abs 2 le and or
  125. X X0 sub WM div dup mul Y Y0 sub HM div dup mul add sqrt 9 mul cvi 2 mod 1 eq or
  126. }
  127. { true } % pad bits are always set
  128. ifelse
  129. % stack: true if pixel is set
  130. {
  131. MB b get P or /P exch def
  132. } if
  133. } for % Bits within a byte
  134. MaskData C P put
  135. } for % Bytes within the row
  136. } for % Rows in the mask
  137. } bind def % MaskGen
  138. %
  139. % WM and HM must be defined prior to invocation
  140. % BPC MaskGenBPC -
  141. %
  142. % The mask data is stored into a string named /MaskData
  143. %
  144. % The mask consists of a "target". BPC is the size of the elements
  145. % in the MaskData string (must be 4, 8 or 12)
  146. %
  147. /MaskGenBPC {
  148. /BPC exch def
  149. /X0 WM 2 div def
  150. /Y0 HM 2 div def
  151. /WB WM BPC mul 7 add 8 div cvi def % Width in Bytes
  152. /MaskData WB HM mul string def
  153. 0 1 HM 1 sub {
  154. /Y exch def
  155. 0 1 WM 1 sub {
  156. /X exch def
  157. MaskData % Target string
  158. X Y eq
  159. X HM 1 sub Y sub eq or
  160. Y Y0 gt X X0 sub abs 2 le and or
  161. X X0 sub WM div dup mul Y Y0 sub HM div dup mul add sqrt 9 mul cvi 2 mod 1 eq or
  162. X BPC mul 8 div Y WB mul add exch
  163. [
  164. { } % BPC = 0
  165. { { 1 } { 0 } ifelse put4bit } % BPC = 4
  166. { { 255 } { 0 } ifelse exch cvi exch put } % BPC = 8
  167. { { 1 } { 0 } ifelse put12bit } % BPC = 12
  168. ] BPC 4 div cvi get exec
  169. } for
  170. } for % Rows in the mask
  171. } bind def
  172. % -----------------------------------------------------------------------
  173. % Procedure to generate image data
  174. %
  175. % WD and HD must be defined prior to invocation
  176. % { proc } ImageGen -
  177. %
  178. % The procedure is called once for each pixel
  179. % Local definitions are R, G, B, X and Y
  180. % Example: Generate RGB Chunky pixel data (single data source) BPC = 8
  181. % /WD WidthRGB def
  182. % /HD HeightRGB def
  183. % /RGBData WD HD mul 3 mul string def
  184. % { X Y WD mul add 3 mul RGBData
  185. % dup 2 index R 255 mul cvi put
  186. % dup 2 index 1 add G 255 mul cvi put
  187. % exch 2 add B 255 mul cvi put
  188. % } ImageGen
  189. /ImageGen {
  190. gsave
  191. 0 1 HD 1 sub {
  192. /Y exch def
  193. 0 1 WD 1 sub {
  194. /X exch def
  195. /D X WD 2 div sub WD div dup mul Y HD 2 div sub HD div dup mul add sqrt def
  196. /D D .6 div def
  197. /A X WD 2 div sub Y HD 2 div sub atan 360 div def
  198. A % Hue
  199. .7 D .3 sub .60 div sub % Saturation
  200. dup 0.05 lt
  201. { .95 D .8 sub 3 mul sub 3 mul cvi 3 div sqrt } % Level once Saturation < 0
  202. { .7 D .25 sub .75 div add } % Level inside
  203. ifelse
  204. X WD 2 div gt Y HD 2 div sub abs 2 le and { pop 0 } if % asymmetric marker
  205. sethsbcolor
  206. currentrgbcolor /B exch def /G exch def /R exch def
  207. dup exec
  208. } for
  209. } for
  210. pop % discard the procedure
  211. grestore
  212. } bind def
  213. % -----------------------------------------------------------------------
  214. %
  215. % Procedures for ImageMatrix creation
  216. /IMLRTB { [ WD 0 0 HD neg 0 HD ] } def
  217. /IMLRBT { [ WD 0 0 HD 0 0 ] } def
  218. /IMRLTB { [ WD neg 0 0 HD neg WD HD ] } def
  219. /IMRLBT { [ WD neg 0 0 HD WD 0 ] } def
  220. % -----------------------------------------------------------------------
  221. %
  222. % Procedure to make invocation of image operators more concise
  223. %
  224. % YY, SX, SY, WD and HD should be defined prior to invocation
  225. % X matrix source decode DoImageMask -
  226. %
  227. /DoImageMask {
  228. gsave
  229. /D exch def
  230. /S exch def
  231. /M exch def
  232. /XX 1 index def
  233. YY translate SX SY scale
  234. 0 setlinewidth 0 0 moveto 1 0 lineto 1 1 lineto 0 1 lineto 0 0 lineto stroke
  235. .5 .5 translate
  236. IR rotate
  237. -.5 -.5 translate
  238. <<
  239. /ImageType 1
  240. /Width WM
  241. /Height HM
  242. /ImageMatrix M
  243. /MultipleDataSources false
  244. /DataSource S
  245. /Decode D
  246. /BitsPerComponent 1
  247. >>
  248. imagemask
  249. grestore
  250. } bind def
  251. % YY, SX, SY, WD and HD should be defined prior to invocation
  252. % X Y BPC matrix source multi decode DoImage1 -
  253. %
  254. /DoImage1 {
  255. gsave
  256. CSpace setcolorspace
  257. /D exch def
  258. /MS exch def
  259. /S exch def % May be an array of sources
  260. /M exch def
  261. /BPC exch def
  262. /XX 1 index def
  263. YY translate SX SY scale
  264. 0 setlinewidth 0 0 moveto 1 0 lineto 1 1 lineto 0 1 lineto 0 0 lineto stroke
  265. .5 .5 translate
  266. IR rotate
  267. -.5 -.5 translate
  268. <<
  269. /ImageType 1
  270. /Width WD
  271. /Height HD
  272. /ImageMatrix M
  273. /MultipleDataSources MS
  274. /DataSource S
  275. /BitsPerComponent BPC
  276. /Decode D
  277. >>
  278. image
  279. grestore
  280. } bind def
  281. % YY, SX, SY, WD and HD should be defined prior to invocation
  282. % X Y BPC matrix source multi decode MaskColor DoImage4 -
  283. %
  284. /DoImage4 {
  285. gsave
  286. CSpace setcolorspace
  287. /MC exch def
  288. /D exch def
  289. /MS exch def
  290. /S exch def % May be an array of sources
  291. /M exch def
  292. /BPC exch def
  293. /XX 1 index def
  294. YY translate SX SY scale
  295. 0 setlinewidth 0 0 moveto 1 0 lineto 1 1 lineto 0 1 lineto 0 0 lineto stroke
  296. .5 .5 translate
  297. IR rotate
  298. -.5 -.5 translate
  299. <<
  300. /ImageType 4
  301. /Width WD
  302. /Height HD
  303. /ImageMatrix M
  304. /MultipleDataSources MS
  305. /DataSource S
  306. /BitsPerComponent BPC
  307. /Decode D
  308. /MaskColor MC
  309. >>
  310. image
  311. grestore
  312. } bind def
  313. % YY, SX, SY, W, HD (Data) WM, HM (Mask) should be defined prior to invocation
  314. % (IT is InterleaveType)
  315. % X Y BPC matrix source multi MaskDecode DataDecode IT DoImage3 -
  316. %
  317. /DoImage3 {
  318. gsave
  319. CSpace setcolorspace
  320. /IT exch def
  321. /DD exch def
  322. /DM exch def
  323. /MS exch def
  324. /S exch def % May be an array of sources - For InterleaveType 3
  325. % S[0] is the Mask DataSource
  326. /M exch def
  327. /BPC exch def
  328. /XX 1 index def
  329. YY translate SX SY scale
  330. 0 setlinewidth 0 0 moveto 1 0 lineto 1 1 lineto 0 1 lineto 0 0 lineto stroke
  331. .5 .5 translate
  332. IR rotate
  333. -.5 -.5 translate
  334. /DataImage
  335. <<
  336. /ImageType 1
  337. /Width WD
  338. /Height HD
  339. /ImageMatrix M
  340. /MultipleDataSources MS
  341. /DataSource IT 3 ne { S } { S 1 get exec } ifelse
  342. /BitsPerComponent BPC
  343. /Decode DD
  344. >>
  345. def
  346. /MaskImage
  347. <<
  348. /ImageType 1
  349. /Width WM
  350. /Height HM
  351. /ImageMatrix % construct the mask matrix using signs from the DataImage matrix
  352. /M0 M 0 get WD abs div cvi def
  353. /M3 M 3 get HD abs div cvi def
  354. /M4 M 4 get WD abs div cvi def
  355. /M5 M 5 get HD abs div cvi def
  356. [ WM M0 mul 0 0 HM M3 mul WM M4 mul HM M5 mul ]
  357. IT 3 eq {
  358. /DataSource S 0 get exec % DataSource only allowed for InterleaveType 3
  359. } if
  360. /BitsPerComponent IT 1 eq { BPC } { 1 } ifelse
  361. /Decode DM
  362. >>
  363. def
  364. <<
  365. /ImageType 3
  366. /DataDict DataImage
  367. /MaskDict MaskImage
  368. /InterleaveType IT
  369. >>
  370. image
  371. grestore
  372. } bind def
  373. % -----------------------------------------------------------------------
  374. %
  375. /Helvetica-Bold findfont 20 scalefont /TitleFont exch def
  376. /FontSize 10 def
  377. /Helvetica-Narrow findfont FontSize scalefont /LegendFont exch def
  378. /blockshow { % like "show" but '\n' causes new-line
  379. dup = flush %DEBUG
  380. currentpoint /showY exch def /showX exch def
  381. {
  382. dup 10 ne
  383. { 1 string dup 0 4 -1 roll put show }
  384. { pop showX showY FontSize sub dup /showY exch def moveto }
  385. ifelse
  386. } forall
  387. } bind def
  388. /TX 013 def % Title left X
  389. /SX 036 def
  390. /XA 060 def
  391. /XB XA SX 1.5 mul add def
  392. /XC XA SX 3.0 mul add def
  393. /XD XA SX 4.5 mul add def
  394. /XE XA SX 6.0 mul add def
  395. /XF XA SX 7.5 mul add def
  396. /XG XA SX 9.0 mul add def
  397. /XH XA SX 10.5 mul add def
  398. /XI XA SX 12.0 mul add def
  399. /XJ XA SX 13.5 mul add def
  400. /BY 036 def % Bottom Title Top line
  401. /SY 037 def
  402. /YA 050 def
  403. /YB YA SY 1.8 mul add def
  404. /YC YA SY 3.6 mul add def
  405. /YD YA SY 5.4 mul add def
  406. /YE YA SY 7.2 mul add def
  407. /YF YA SY 9.0 mul add def
  408. /YG YA SY 10.8 mul add def
  409. /YH YA SY 12.6 mul add def
  410. /YI YA SY 14.4 mul add def
  411. /YJ YA SY 16.2 mul add def
  412. /YK YA SY 18.0 mul add def
  413. % -----------------------------------------------------------------------
  414. %
  415. % Utility procedures to support storing 4 and 12 bit elements in
  416. % strings.
  417. %
  418. % <string> <index> <value> put##bit -
  419. %
  420. % <index> will have a fractional part ( .5 ) if the element
  421. % starts on a 4-bit boundary.
  422. %
  423. % <value> is between 0 and 1 and is scaled 0 to 15 (4bit) or
  424. % 0 to 4095 (12 bit)
  425. /put4bit {
  426. 15 mul cvi
  427. exch dup cvi dup 3 1 roll eq 3 -1 roll exch
  428. { % integer index means high nibble.
  429. 16 mul put
  430. }
  431. { % low nibble -- combine with high nibble
  432. 2 index 2 index get or put
  433. }
  434. ifelse
  435. } bind def
  436. /put12bit {
  437. 1 index cvi /I exch def
  438. 2 index /S exch def
  439. 4095 mul cvi
  440. exch dup dup cvi eq
  441. { % integer index means high byte is aligned
  442. cvi exch 3 copy 16 div cvi put
  443. exch 1 add exch 15 and 16 mul put
  444. }
  445. { % low nibble -- combine with high nibble
  446. cvi exch 3 copy 2 index 2 index get exch 256 div cvi or put
  447. 255 and exch 1 add exch put
  448. }
  449. ifelse
  450. } bind def
  451. % -----------------------------------------------------------------------
  452. %
  453. % Procedures to use generated string data as procedure or files
  454. /WD WidthRGB def
  455. /HD HeightRGB def
  456. /sM WidthRGB 2 mul 1 sub string def % long enough to hold more than one mask line
  457. /sD WidthRGB 7 mul 1 sub string def % long enough to hold more than one 12 bit RGB line
  458. % worst case is 12bit ImageType3 InterleaveType 1 == 48 bits
  459. /MaskDProc {
  460. /FM MaskData dup length () /SubFileDecode filter def
  461. { { FM sM readstring pop } }
  462. } bind def
  463. /FileTailString (12345) def % Marker string to check file data usage
  464. /AppendFileTail { % <string> AppendFileTail <string_with_tail> <original_length>
  465. dup length FileTailString length add string
  466. dup 0 3 index putinterval
  467. dup 2 index length FileTailString putinterval
  468. exch length
  469. } bind def
  470. /MaskDFile {
  471. MaskData dup length () /SubFileDecode filter
  472. /MDF 1 index def
  473. } bind def
  474. /RGBDProc {
  475. /FD RGBData dup length () /SubFileDecode filter def
  476. { { FD sD readstring pop } }
  477. } bind def
  478. /RGBDFile {
  479. RGBData dup length () /SubFileDecode filter
  480. /RGBDF 1 index def
  481. } bind def
  482. /sR WidthRGB 2 mul 1 sub string def % long enough to hold more than one line of 12 bit data
  483. /sG WidthRGB 2 mul 1 sub string def
  484. /sB WidthRGB 2 mul 1 sub string def
  485. /RDProc {
  486. /FR RData dup length () /SubFileDecode filter def
  487. { FR sR readstring pop }
  488. } bind def
  489. /GDProc {
  490. /FG GData dup length () /SubFileDecode filter def
  491. { FG sG readstring pop }
  492. } bind def
  493. /BDProc {
  494. /FB BData dup length () /SubFileDecode filter def
  495. { FB sB readstring pop }
  496. } bind def
  497. /RDFile {
  498. RData dup length () /SubFileDecode filter
  499. /RDF 1 index def
  500. } bind def
  501. /GDFile {
  502. GData dup length () /SubFileDecode filter
  503. /GDF 1 index def
  504. } bind def
  505. /BDFile {
  506. BData dup length () /SubFileDecode filter
  507. /BDF 1 index def
  508. } bind def
  509. % -----------------------------------------------------------------------
  510. %
  511. % Procedure to handle fileposition. Ghostscript has a private
  512. % operator .fileposition that works when fileposition does not
  513. %
  514. % <file> tryfilepos
  515. % Returns: fileposition true if successful
  516. % 0 false if not
  517. /tryfilepos {
  518. /.fileposition where
  519. { pop /.fileposition load } % most likely to succeed
  520. { /fileposition load }
  521. ifelse
  522. stopped
  523. { pop 0 false }
  524. { true }
  525. ifelse
  526. } bind def
  527. % -----------------------------------------------------------------------
  528. %
  529. % Procedure to provide =only operator if not present. Suggested
  530. % by Alex Cherepanov to use =print operator present on some Adobe
  531. % implementations.
  532. /=only where
  533. { pop }
  534. { /=print where { pop /=print load } { /print load } ifelse
  535. /=only exch def
  536. }
  537. ifelse
  538. % -----------------------------------------------------------------------
  539. %
  540. % Procedure to make sure that the file is at the EOF.
  541. % added above (string == FileTailString.
  542. %
  543. % If not, it will mark the image area with a red "F"
  544. %
  545. % <string> <title> <file> CheckFileTail - XX is the horizontal position
  546. % YY is the vertical position
  547. % SX,SY determine size of "F" if fail
  548. /CheckFileTail {
  549. dup
  550. status not dup % status false says no longer valid
  551. { (Unexpected EOF: XX,YY=) print XX =only (,) print YY = false }
  552. { 1 index tryfilepos not exch 5 index length ne or dup
  553. { 3 index print ( fileposition = ) print
  554. 2 index tryfilepos pop =only
  555. ( doesn't match expected = ) print 4 index length = flush
  556. }
  557. if
  558. }
  559. ifelse
  560. or
  561. {
  562. gsave .8 0 0 setrgbcolor
  563. SX 4 div setlinewidth
  564. XX YY moveto 0 SY rlineto SX 0 rlineto stroke
  565. XX YY SY .5 mul add moveto SX .5 mul 0 rlineto stroke
  566. grestore
  567. }
  568. if
  569. pop pop pop
  570. } bind def
  571. /CSpaceName { % - CSpaceName <string>
  572. CSpace dup type /arraytype eq { 0 get } if
  573. 15 string cvs
  574. } bind def
  575. % -----------------------------------------------------------------------
  576. %
  577. % tests
  578. /CheckImage {
  579. /IR 0 def
  580. /CSpace /DeviceRGB def
  581. % Use an unusual (unpleasant?) underlying color
  582. .6 .95 .4 setrgbcolor clippath fill
  583. 0 0 0 setrgbcolor
  584. TitleFont setfont
  585. 200 760 moveto (Image Type 3 Tests) show
  586. 200 740 moveto (Rotation Angle = ) show IR 3 string cvs show
  587. 170 720 moveto (Colorspace = ) show CSpaceName show
  588. LegendFont setfont
  589. .4 .1 .7 setrgbcolor % contrasting color for stencil masking
  590. /SX SX 2 mul def /SY SY 2 mul def
  591. /YY 780 SY sub def
  592. MaskGen
  593. TX IMLRTB MaskData [1 0] DoImageMask
  594. /RGBData WD HD mul 3 mul string def
  595. { X Y WD mul add 3 mul RGBData
  596. dup 2 index R 255 mul cvi put
  597. dup 2 index 1 add G 255 mul cvi put
  598. exch 2 add B 255 mul cvi put
  599. } ImageGen
  600. % X BPC matrix source multi decode
  601. XI 8 IMLRTB RGBData false [0 1 0 1 0 1] DoImage1
  602. /SX SX 2 div def /SY SY 2 div def
  603. showpage
  604. } def
  605. % -----------------------------------------------------------------------
  606. %
  607. % Type 1 and Type 4 Tests
  608. % /CSpace and /IR are defined in order to generate various pages
  609. /T1T4Tests { %
  610. % Use an unusual (unpleasant?) underlying color
  611. .6 .95 .4 setrgbcolor clippath fill
  612. 0 0 0 setrgbcolor
  613. TitleFont setfont
  614. 120 760 moveto (Image Type 1 and ImageType 4 Tests) show
  615. 200 740 moveto (Rotation Angle = ) show IR 3 string cvs show
  616. 170 720 moveto (Colorspace = ) show CSpaceName show
  617. LegendFont setfont
  618. XA BY moveto (Decode\nInverted) blockshow
  619. XB BY moveto ( IMLRTB\nDS=string) blockshow
  620. XC BY moveto ( IMLRBT\nDS=string) blockshow
  621. XD BY moveto ( IMRLTB\nDS=string) blockshow
  622. XE BY moveto ( IMRLBT\nDS=string) blockshow
  623. XF BY moveto (IMLRTB\nDS=proc) blockshow
  624. XG BY moveto (IMLRTB\nDS=file) blockshow
  625. XH BY moveto ( Multi\nDS=string) blockshow
  626. XI BY moveto ( Multi\nDS=proc) blockshow
  627. XJ BY moveto ( Multi\nDS=file) blockshow
  628. .4 .1 .7 setrgbcolor % contrasting color for stencil masking
  629. /WM WD def
  630. /HM HD def
  631. /SX SX 2 mul def /SY SY 2 mul def
  632. /YY 780 SY sub def
  633. MaskGen
  634. TX IMLRTB MaskData [1 0] DoImageMask
  635. /RGBData WD HD mul 3 mul string def
  636. { X Y WD mul add 3 mul RGBData
  637. dup 2 index R 255 mul cvi put
  638. dup 2 index 1 add G 255 mul cvi put
  639. exch 2 add B 255 mul cvi put
  640. } ImageGen
  641. % X BPC matrix source multi decode
  642. XI 8 IMLRTB RGBData false [0 1 0 1 0 1] DoImage1
  643. /SX SX 2 div def /SY SY 2 div def
  644. % ----------------------------------------------------------------------
  645. % Type 1 Stencil Mask Images
  646. /YY YA def
  647. TX YA SY add moveto (\nType 1\nStencil\nMask) blockshow
  648. MaskGen
  649. % X matrix source decode
  650. XA IMLRTB MaskData [0 1] DoImageMask
  651. XB IMLRTB MaskData [1 0] DoImageMask
  652. XC IMLRBT MaskData [1 0] DoImageMask
  653. XD IMRLTB MaskData [1 0] DoImageMask
  654. XE IMRLBT MaskData [1 0] DoImageMask
  655. XF IMLRTB MaskDProc [1 0] DoImageMask
  656. XG IMLRTB MaskDFile [1 0] DoImageMask
  657. MaskData (Mask) MDF CheckFileTail % Check that the correct amount of data was consumed
  658. % ----------------------------------------------------------------------
  659. % Type 1 RGB Single Data Sources, BPC==8
  660. /YY YB def
  661. TX YY SY add moveto (\nType 1\nRGB\nBPC=8) blockshow
  662. /RGBData WD HD mul 3 mul string def
  663. { X Y WD mul add 3 mul RGBData
  664. dup 2 index R 255 mul cvi put
  665. dup 2 index 1 add G 255 mul cvi put
  666. exch 2 add B 255 mul cvi put
  667. } ImageGen
  668. % X BPC matrix source multi decode
  669. XA 8 IMLRTB RGBData false [1 0 1 0 1 0] DoImage1
  670. XB 8 IMLRTB RGBData false [0 1 0 1 0 1] DoImage1
  671. XC 8 IMLRBT RGBData false [0 1 0 1 0 1] DoImage1
  672. XD 8 IMRLTB RGBData false [0 1 0 1 0 1] DoImage1
  673. XE 8 IMRLBT RGBData false [0 1 0 1 0 1] DoImage1
  674. XF 8 IMLRTB RGBDProc false [0 1 0 1 0 1] DoImage1
  675. XG 8 IMLRTB RGBDFile false [0 1 0 1 0 1] DoImage1
  676. RGBData (RGB) RGBDF CheckFileTail % Check that the correct amount of data was consumed
  677. % ----------------------------------------------------------------------
  678. % Type 1 RGB Multiple Data Sources, BPC==8
  679. WD HD mul /RData 1 index string def
  680. /GData 1 index string def
  681. /BData exch string def
  682. { X Y WD mul add
  683. RData 1 index R 255 mul cvi put
  684. GData 1 index G 255 mul cvi put
  685. BData exch B 255 mul cvi put
  686. } ImageGen
  687. % X BPC matrix source multi decode
  688. XH 8 IMLRTB [ RData GData BData ] true [0 1 0 1 0 1] DoImage1
  689. XI 8 IMLRTB [ RDProc GDProc BDProc ] true [0 1 0 1 0 1] DoImage1
  690. XJ 8 IMLRTB [ RDFile GDFile BDFile ] true [0 1 0 1 0 1] DoImage1
  691. RData (Red) RDF CheckFileTail % Check that the correct amount of data was consumed
  692. GData (Grn) GDF CheckFileTail % Check that the correct amount of data was consumed
  693. BData (Blu) BDF CheckFileTail % Check that the correct amount of data was consumed
  694. % ----------------------------------------------------------------------
  695. % Type 4 RGB Single Data Sources, BPC==8, mask black
  696. /YY YE def
  697. TX YY SY add moveto (\nType 4\nBPC=8\nmask=black) blockshow
  698. % X BPC matrix source multi decode MaskColor
  699. XA 8 IMLRTB RGBData false [1 0 1 0 1 0] [ 000 000 000 ] DoImage4
  700. XB 8 IMLRTB RGBData false [0 1 0 1 0 1] [ 000 000 000 ] DoImage4
  701. XC 8 IMLRBT RGBData false [0 1 0 1 0 1] [ 000 000 000 ] DoImage4
  702. XD 8 IMRLTB RGBData false [0 1 0 1 0 1] [ 000 000 000 ] DoImage4
  703. XE 8 IMRLBT RGBData false [0 1 0 1 0 1] [ 000 000 000 ] DoImage4
  704. XF 8 IMLRTB RGBDProc false [0 1 0 1 0 1] [ 000 000 000 ] DoImage4
  705. XG 8 IMLRTB RGBDFile false [0 1 0 1 0 1] [ 000 000 000 ] DoImage4
  706. RGBData (RGB) RGBDF CheckFileTail % Check that the correct amount of data was consumed
  707. % ----------------------------------------------------------------------
  708. % Type 4 RGB Multiple Data Sources, BPC==8, mask black
  709. % X BPC matrix source multi decode MaskColor
  710. XH 8 IMLRTB [ RData GData BData ] true [0 1 0 1 0 1] [ 000 000 000 ] DoImage4
  711. XI 8 IMLRTB [ RDProc GDProc BDProc ] true [0 1 0 1 0 1] [ 000 000 000 ] DoImage4
  712. XJ 8 IMLRTB [ RDFile GDFile BDFile ] true [0 1 0 1 0 1] [ 000 000 000 ] DoImage4
  713. RData (Red) RDF CheckFileTail % Check that the correct amount of data was consumed
  714. GData (Grn) GDF CheckFileTail % Check that the correct amount of data was consumed
  715. BData (Blu) BDF CheckFileTail % Check that the correct amount of data was consumed
  716. % ----------------------------------------------------------------------
  717. % Type 4 RGB Single Data Sources, BPC==8, mask white
  718. /YY YF def
  719. TX YY SY add moveto (\nType 4\nBPC=8\nmask=white) blockshow
  720. % X BPC matrix source multi decode MaskColor
  721. XA 8 IMLRTB RGBData false [1 0 1 0 1 0] [ 255 255 255 ] DoImage4
  722. gsave .5 .2 .2 setrgbcolor XB YY SX 13 mul SY rectfill grestore
  723. XB 8 IMLRTB RGBData false [0 1 0 1 0 1] [ 255 255 255 ] DoImage4
  724. XC 8 IMLRBT RGBData false [0 1 0 1 0 1] [ 255 255 255 ] DoImage4
  725. XD 8 IMRLTB RGBData false [0 1 0 1 0 1] [ 255 255 255 ] DoImage4
  726. XE 8 IMRLBT RGBData false [0 1 0 1 0 1] [ 255 255 255 ] DoImage4
  727. XF 8 IMLRTB RGBDProc false [0 1 0 1 0 1] [ 255 255 255 ] DoImage4
  728. XG 8 IMLRTB RGBDFile false [0 1 0 1 0 1] [ 255 255 255 ] DoImage4
  729. RGBData (RGB) RGBDF CheckFileTail % Check that the correct amount of data was consumed
  730. % ----------------------------------------------------------------------
  731. % Type 4 RGB Multiple Data Sources, BPC==8, mask white
  732. % X BPC matrix source multi decode MaskColor
  733. XH 8 IMLRTB [ RData GData BData ] true [0 1 0 1 0 1] [ 255 255 255 ] DoImage4
  734. XI 8 IMLRTB [ RDProc GDProc BDProc ] true [0 1 0 1 0 1] [ 255 255 255 ] DoImage4
  735. XJ 8 IMLRTB [ RDFile GDFile BDFile ] true [0 1 0 1 0 1] [ 255 255 255 ] DoImage4
  736. RData (Red) RDF CheckFileTail % Check that the correct amount of data was consumed
  737. GData (Grn) GDF CheckFileTail % Check that the correct amount of data was consumed
  738. BData (Blu) BDF CheckFileTail % Check that the correct amount of data was consumed
  739. % ----------------------------------------------------------------------
  740. % Type 4 RGB Single Data Sources, BPC==8, mask gray
  741. /YY YG def
  742. TX YY SY add moveto (\nType 4\nBPC=8\nmask=gray) blockshow
  743. % X BPC matrix source multi decode MaskColor
  744. XA 8 IMLRTB RGBData false [1 0 1 0 1 0] [ 147 147 147 ] DoImage4
  745. XB 8 IMLRTB RGBData false [0 1 0 1 0 1] [ 147 147 147 ] DoImage4
  746. XC 8 IMLRBT RGBData false [0 1 0 1 0 1] [ 147 147 147 ] DoImage4
  747. XD 8 IMRLTB RGBData false [0 1 0 1 0 1] [ 147 147 147 ] DoImage4
  748. XE 8 IMRLBT RGBData false [0 1 0 1 0 1] [ 147 147 147 ] DoImage4
  749. XF 8 IMLRTB RGBDProc false [0 1 0 1 0 1] [ 147 147 147 ] DoImage4
  750. XG 8 IMLRTB RGBDFile false [0 1 0 1 0 1] [ 147 147 147 ] DoImage4
  751. RGBData (RGB) RGBDF CheckFileTail % Check that the correct amount of data was consumed
  752. % ----------------------------------------------------------------------
  753. % Type 4 RGB Multiple Data Sources, BPC==8, mask gray
  754. % X BPC matrix source multi decode MaskColor
  755. XH 8 IMLRTB [ RData GData BData ] true [0 1 0 1 0 1] [ 147 147 147 ] DoImage4
  756. XI 8 IMLRTB [ RDProc GDProc BDProc ] true [0 1 0 1 0 1] [ 147 147 147 ] DoImage4
  757. XJ 8 IMLRTB [ RDFile GDFile BDFile ] true [0 1 0 1 0 1] [ 147 147 147 ] DoImage4
  758. RData (Red) RDF CheckFileTail % Check that the correct amount of data was consumed
  759. GData (Grn) GDF CheckFileTail % Check that the correct amount of data was consumed
  760. BData (Blu) BDF CheckFileTail % Check that the correct amount of data was consumed
  761. % ----------------------------------------------------------------------
  762. % Type 4 RGB Single Data Sources, BPC==8, mask range
  763. /YY YH def
  764. TX YY SY add moveto (\nType 4\nBPC=8\nmask range) blockshow
  765. % X BPC matrix source multi decode MaskColor
  766. XA 8 IMLRTB RGBData false [1 0 1 0 1 0] [ 020 200 020 200 020 200 ] DoImage4
  767. XB 8 IMLRTB RGBData false [0 1 0 1 0 1] [ 020 200 020 200 020 200 ] DoImage4
  768. XC 8 IMLRBT RGBData false [0 1 0 1 0 1] [ 020 200 020 200 020 200 ] DoImage4
  769. XD 8 IMRLTB RGBData false [0 1 0 1 0 1] [ 020 200 020 200 020 200 ] DoImage4
  770. XE 8 IMRLBT RGBData false [0 1 0 1 0 1] [ 020 200 020 200 020 200 ] DoImage4
  771. XF 8 IMLRTB RGBDProc false [0 1 0 1 0 1] [ 020 200 020 200 020 200 ] DoImage4
  772. XG 8 IMLRTB RGBDFile false [0 1 0 1 0 1] [ 020 200 020 200 020 200 ] DoImage4
  773. RGBData (RGB) RGBDF CheckFileTail % Check that the correct amount of data was consumed
  774. % ----------------------------------------------------------------------
  775. % Type 4 RGB Multiple Data Sources, BPC==8, mask range
  776. % X Y SX SY BPC matrix source multi decode MaskColor
  777. XH 8 IMLRTB [ RData GData BData ] true [0 1 0 1 0 1] [ 020 200 020 200 020 200 ] DoImage4
  778. XI 8 IMLRTB [ RDProc GDProc BDProc ] true [0 1 0 1 0 1] [ 020 200 020 200 020 200 ] DoImage4
  779. XJ 8 IMLRTB [ RDFile GDFile BDFile ] true [0 1 0 1 0 1] [ 020 200 020 200 020 200 ] DoImage4
  780. RData (Red) RDF CheckFileTail % Check that the correct amount of data was consumed
  781. GData (Grn) GDF CheckFileTail % Check that the correct amount of data was consumed
  782. BData (Blu) BDF CheckFileTail % Check that the correct amount of data was consumed
  783. % ----------------------------------------------------------------------
  784. % Type 1 RGB Single Data Sources, BPC==12
  785. /YY YC def
  786. TX YY SY add moveto (\nType 1\nRGB\nBPC=12) blockshow
  787. /RGBData WD 36 mul 7 add 8 div cvi HD mul string def
  788. {
  789. X 36 mul 8 div Y WD 36 mul 7 add 8 div cvi mul add
  790. RGBData 1 index R put12bit
  791. RGBData 1 index 1.5 add G put12bit
  792. RGBData exch 3 add B put12bit
  793. } ImageGen
  794. % X BPC matrix source multi decode
  795. XA 12 IMLRTB RGBData false [1 0 1 0 1 0] DoImage1
  796. XB 12 IMLRTB RGBData false [0 1 0 1 0 1] DoImage1
  797. XC 12 IMLRBT RGBData false [0 1 0 1 0 1] DoImage1
  798. XD 12 IMRLTB RGBData false [0 1 0 1 0 1] DoImage1
  799. XE 12 IMRLBT RGBData false [0 1 0 1 0 1] DoImage1
  800. XF 12 IMLRTB RGBDProc false [0 1 0 1 0 1] DoImage1
  801. XG 12 IMLRTB RGBDFile false [0 1 0 1 0 1] DoImage1
  802. RGBData (RGB) RGBDF CheckFileTail % Check that the correct amount of data was consumed
  803. % ----------------------------------------------------------------------
  804. % Type 1 RGB Multiple Data Sources, BPC==12
  805. WD 3 mul 1 add 2 div cvi HD mul /RData 1 index string def
  806. /GData 1 index string def
  807. /BData exch string def
  808. {
  809. X 3 mul 2 div Y WD 3 mul 1 add 2 div cvi mul add
  810. RData 1 index R put12bit
  811. GData 1 index G put12bit
  812. BData exch B put12bit
  813. } ImageGen
  814. % X BPC matrix source multi decode
  815. XH 12 IMLRTB [ RData GData BData ] true [0 1 0 1 0 1] DoImage1
  816. XI 12 IMLRTB [ RDProc GDProc BDProc ] true [0 1 0 1 0 1] DoImage1
  817. XJ 12 IMLRTB [ RDFile GDFile BDFile ] true [0 1 0 1 0 1] DoImage1
  818. RData (Red) RDF CheckFileTail % Check that the correct amount of data was consumed
  819. GData (Grn) GDF CheckFileTail % Check that the correct amount of data was consumed
  820. BData (Blu) BDF CheckFileTail % Check that the correct amount of data was consumed
  821. % ----------------------------------------------------------------------
  822. % Type 4 RGB Single Data Sources, BPC==12, mask range
  823. /YY YI def
  824. TX YY SY add moveto (\nType 4\nBPC=12\nmask range) blockshow
  825. % X BPC matrix source multi decode MaskColor
  826. XA 12 IMLRTB RGBData false [1 0 1 0 1 0] [ 300 3000 300 3000 300 3000 ] DoImage4
  827. XB 12 IMLRTB RGBData false [0 1 0 1 0 1] [ 300 3000 300 3000 300 3000 ] DoImage4
  828. XC 12 IMLRBT RGBData false [0 1 0 1 0 1] [ 300 3000 300 3000 300 3000 ] DoImage4
  829. XD 12 IMRLTB RGBData false [0 1 0 1 0 1] [ 300 3000 300 3000 300 3000 ] DoImage4
  830. XE 12 IMRLBT RGBData false [0 1 0 1 0 1] [ 300 3000 300 3000 300 3000 ] DoImage4
  831. XF 12 IMLRTB RGBDProc false [0 1 0 1 0 1] [ 300 3000 300 3000 300 3000 ] DoImage4
  832. XG 12 IMLRTB RGBDFile false [0 1 0 1 0 1] [ 300 3000 300 3000 300 3000 ] DoImage4
  833. RGBData (RGB) RGBDF CheckFileTail % Check that the correct amount of data was consumed
  834. % ----------------------------------------------------------------------
  835. % Type 4 RGB Multiple Data Sources, BPC==12, mask range
  836. % X BPC matrix source multi decode MaskColor
  837. XH 12 IMLRTB [ RData GData BData ] true [0 1 0 1 0 1] [ 300 3000 300 3000 300 3000 ] DoImage4
  838. XI 12 IMLRTB [ RDProc GDProc BDProc ] true [0 1 0 1 0 1] [ 300 3000 300 3000 300 3000 ] DoImage4
  839. XJ 12 IMLRTB [ RDFile GDFile BDFile ] true [0 1 0 1 0 1] [ 300 3000 300 3000 300 3000 ] DoImage4
  840. RData (Red) RDF CheckFileTail % Check that the correct amount of data was consumed
  841. GData (Grn) GDF CheckFileTail % Check that the correct amount of data was consumed
  842. BData (Blu) BDF CheckFileTail % Check that the correct amount of data was consumed
  843. % ----------------------------------------------------------------------
  844. % Type 1 RGB Single Data Sources, BPC==4
  845. /YY YD def
  846. TX YY SY add moveto (\nType 1\nRGB\nBPC=4) blockshow
  847. /RGBData WD 12 mul 7 add 8 div cvi HD mul string def
  848. {
  849. X 12 mul 8 div Y WD 12 mul 7 add 8 div cvi mul add
  850. RGBData 1 index R put4bit
  851. RGBData 1 index 0.5 add G put4bit
  852. RGBData exch 1.0 add B put4bit
  853. } ImageGen
  854. % X BPC matrix source multi decode
  855. XA 4 IMLRTB RGBData false [1 0 1 0 1 0] DoImage1
  856. XB 4 IMLRTB RGBData false [0 1 0 1 0 1] DoImage1
  857. XC 4 IMLRBT RGBData false [0 1 0 1 0 1] DoImage1
  858. XD 4 IMRLTB RGBData false [0 1 0 1 0 1] DoImage1
  859. XE 4 IMRLBT RGBData false [0 1 0 1 0 1] DoImage1
  860. XF 4 IMLRTB RGBDProc false [0 1 0 1 0 1] DoImage1
  861. XG 4 IMLRTB RGBDFile false [0 1 0 1 0 1] DoImage1
  862. RGBData (RGB) RGBDF CheckFileTail % Check that the correct amount of data was consumed
  863. % ----------------------------------------------------------------------
  864. % Type 1 RGB Multiple Data Sources, BPC==4
  865. WD 1 add 2 div cvi HD mul /RData 1 index string def
  866. /GData 1 index string def
  867. /BData exch string def
  868. {
  869. X 2 div Y WD 1 add 2 div cvi mul add
  870. RData 1 index R put4bit
  871. GData 1 index G put4bit
  872. BData exch B put4bit
  873. } ImageGen
  874. % X BPC matrix source multi decode
  875. XH 4 IMLRTB [ RData GData BData ] true [0 1 0 1 0 1] DoImage1
  876. XI 4 IMLRTB [ RDProc GDProc BDProc ] true [0 1 0 1 0 1] DoImage1
  877. XJ 4 IMLRTB [ RDFile GDFile BDFile ] true [0 1 0 1 0 1] DoImage1
  878. RData (Red) RDF CheckFileTail % Check that the correct amount of data was consumed
  879. GData (Grn) GDF CheckFileTail % Check that the correct amount of data was consumed
  880. BData (Blu) BDF CheckFileTail % Check that the correct amount of data was consumed
  881. % ----------------------------------------------------------------------
  882. % Type 4 RGB Single Data Sources, BPC==4, mask range
  883. /YY YJ def
  884. TX YY SY add moveto (\nType 4\nBPC=4\nmask range) blockshow
  885. % X BPC matrix source multi decode MaskColor
  886. XA 4 IMLRTB RGBData false [1 0 1 0 1 0] [ 1 10 1 10 1 10 ] DoImage4
  887. XB 4 IMLRTB RGBData false [0 1 0 1 0 1] [ 1 10 1 10 1 10 ] DoImage4
  888. XC 4 IMLRBT RGBData false [0 1 0 1 0 1] [ 1 10 1 10 1 10 ] DoImage4
  889. XD 4 IMRLTB RGBData false [0 1 0 1 0 1] [ 1 10 1 10 1 10 ] DoImage4
  890. XE 4 IMRLBT RGBData false [0 1 0 1 0 1] [ 1 10 1 10 1 10 ] DoImage4
  891. XF 4 IMLRTB RGBDProc false [0 1 0 1 0 1] [ 1 10 1 10 1 10 ] DoImage4
  892. XG 4 IMLRTB RGBDFile false [0 1 0 1 0 1] [ 1 10 1 10 1 10 ] DoImage4
  893. RGBData (RGB) RGBDF CheckFileTail % Check that the correct amount of data was consumed
  894. % ----------------------------------------------------------------------
  895. % Type 4 RGB Multiple Data Sources, BPC==4, mask range
  896. % X BPC matrix source multi decode MaskColor
  897. XH 4 IMLRTB [ RData GData BData ] true [0 1 0 1 0 1] [ 1 10 1 10 1 10 ] DoImage4
  898. XI 4 IMLRTB [ RDProc GDProc BDProc ] true [0 1 0 1 0 1] [ 1 10 1 10 1 10 ] DoImage4
  899. XJ 4 IMLRTB [ RDFile GDFile BDFile ] true [0 1 0 1 0 1] [ 1 10 1 10 1 10 ] DoImage4
  900. RData (Red) RDF CheckFileTail % Check that the correct amount of data was consumed
  901. GData (Grn) GDF CheckFileTail % Check that the correct amount of data was consumed
  902. BData (Blu) BDF CheckFileTail % Check that the correct amount of data was consumed
  903. showpage
  904. } bind def % T1T4Tests
  905. % -----------------------------------------------------------------------
  906. %
  907. % Type 3 Tests
  908. /T3Tests {
  909. % Use an unusual (unpleasant?) underlying color
  910. .6 .95 .4 setrgbcolor clippath fill
  911. 0 0 0 setrgbcolor
  912. TitleFont setfont
  913. 200 760 moveto (Image Type 3 Tests) show
  914. 200 740 moveto (Rotation Angle = ) show IR 3 string cvs show
  915. 170 720 moveto (Colorspace = ) show CSpaceName show
  916. LegendFont setfont
  917. .4 .1 .7 setrgbcolor % contrasting color for stencil masking
  918. /WM WD def
  919. /HM HD def
  920. /SX SX 2 mul def /SY SY 2 mul def
  921. /YY 780 SY sub def
  922. MaskGen
  923. XA IMLRTB MaskData [1 0] DoImageMask
  924. /RGBData WD HD mul 3 mul string def
  925. { X Y WD mul add 3 mul RGBData
  926. dup 2 index R 255 mul cvi put
  927. dup 2 index 1 add G 255 mul cvi put
  928. exch 2 add B 255 mul cvi put
  929. } ImageGen
  930. % X BPC matrix source multi decode
  931. XH 8 IMLRTB RGBData false [0 1 0 1 0 1] DoImage1
  932. /SX SX 2 div def /SY SY 2 div def
  933. % ----------------------------------------------------------------------
  934. % InterleaveType 1, BPC==8, WM=WD, HM=HD
  935. % IT 1 is what GS calls "chunky pixel"
  936. /YY YA def
  937. TX YY SY add moveto (\nIntType 1\nBPC=8) blockshow
  938. % Generate the MaskData first
  939. 8 MaskGenBPC
  940. % Generate the Data Image (uses the MaskData)
  941. /RGBData WD HD mul 4 mul string def
  942. { X Y WD mul add 4 mul % 4 bytes Mask,Red,Green,Blue
  943. RGBData
  944. dup 2 index MaskData X Y WB mul add get put
  945. dup 2 index 1 add R 255 mul cvi put
  946. dup 2 index 2 add G 255 mul cvi put
  947. exch 3 add B 255 mul cvi put
  948. }
  949. ImageGen
  950. % X BPC matrix source multi MaskDecode DataDecode IT DoImage3 -
  951. XA 8 IMLRTB RGBData false [0 1] [1 0 1 0 1 0] 1 DoImage3
  952. XB 8 IMLRTB RGBData false [1 0] [1 0 1 0 1 0] 1 DoImage3
  953. XC 8 IMLRTB RGBData false [0 1] [0 1 0 1 0 1] 1 DoImage3
  954. XD 8 IMLRTB RGBData false [1 0] [0 1 0 1 0 1] 1 DoImage3
  955. XE 8 IMLRBT RGBData false [1 0] [0 1 0 1 0 1] 1 DoImage3
  956. XF 8 IMRLTB RGBData false [1 0] [0 1 0 1 0 1] 1 DoImage3
  957. XG 8 IMRLBT RGBData false [1 0] [0 1 0 1 0 1] 1 DoImage3
  958. XH 8 IMLRTB RGBDProc false [1 0] [0 1 0 1 0 1] 1 DoImage3
  959. XI 8 IMLRTB RGBDFile false [1 0] [0 1 0 1 0 1] 1 DoImage3
  960. RGBData (RGB) RGBDF CheckFileTail % Check that the correct amount of data was consumed
  961. % ----------------------------------------------------------------------
  962. % InterleaveType 1, BPC==12, WM=WD, HM=HD
  963. % IT 1 is what GS calls "chunky pixel"
  964. /YY YB def
  965. TX YY SY add moveto (\nIntType 1\nBPC=12) blockshow
  966. % Generate the MaskData first
  967. 12 MaskGenBPC
  968. % Generate the Data Image (uses the MaskData)
  969. /RGBData WD HD mul 6 mul string def
  970. { X Y WD mul add 6 mul % 6 bytes Mask,Red,Green,Blue
  971. RGBData
  972. dup 2 index
  973. MaskData X 1.5 mul .5 add cvi
  974. Y WB mul add get % get the aligned mask byte (hi or lo)
  975. 0 eq { 0 } { 1 } ifelse
  976. put12bit
  977. dup 2 index 1.5 add R put12bit
  978. dup 2 index 3.0 add G put12bit
  979. exch 4.5 add B put12bit
  980. }
  981. ImageGen
  982. % X BPC matrix source multi MaskDecode DataDecode IT DoImage3 -
  983. XA 12 IMLRTB RGBData false [0 1] [1 0 1 0 1 0] 1 DoImage3
  984. XB 12 IMLRTB RGBData false [1 0] [1 0 1 0 1 0] 1 DoImage3
  985. XC 12 IMLRTB RGBData false [0 1] [0 1 0 1 0 1] 1 DoImage3
  986. XD 12 IMLRTB RGBData false [1 0] [0 1 0 1 0 1] 1 DoImage3
  987. XE 12 IMLRBT RGBData false [1 0] [0 1 0 1 0 1] 1 DoImage3
  988. XF 12 IMRLTB RGBData false [1 0] [0 1 0 1 0 1] 1 DoImage3
  989. XG 12 IMRLBT RGBData false [1 0] [0 1 0 1 0 1] 1 DoImage3
  990. XH 12 IMLRTB RGBDProc false [1 0] [0 1 0 1 0 1] 1 DoImage3
  991. XI 12 IMLRTB RGBDFile false [1 0] [0 1 0 1 0 1] 1 DoImage3
  992. RGBData (RGB) RGBDF CheckFileTail % Check that the correct amount of data was consumed
  993. % ----------------------------------------------------------------------
  994. % InterleaveType 1, BPC==4, WM=WD, HM=HD
  995. % IT 1 is what GS calls "chunky pixel"
  996. /YY YC def
  997. TX YY SY add moveto (\nIntType 1\nBPC=4) blockshow
  998. % Generate the MaskData first
  999. 4 MaskGenBPC
  1000. % Generate the Data Image (uses the MaskData)
  1001. /RGBData WD HD mul 2 mul string def
  1002. { X Y WD mul add 2 mul % 2 bytes Mask,Red,Green,Blue
  1003. RGBData
  1004. dup 2 index MaskData X 2 div cvi Y WB mul add get
  1005. X 1 and 0 eq { 128 div cvi } { 1 and } ifelse
  1006. put4bit
  1007. dup 2 index 0.5 add R put4bit
  1008. dup 2 index 1.0 add G put4bit
  1009. exch 1.5 add B put4bit
  1010. }
  1011. ImageGen
  1012. % X BPC matrix source multi MaskDecode DataDecode IT DoImage3 -
  1013. XA 4 IMLRTB RGBData false [0 1] [1 0 1 0 1 0] 1 DoImage3
  1014. XB 4 IMLRTB RGBData false [1 0] [1 0 1 0 1 0] 1 DoImage3
  1015. XC 4 IMLRTB RGBData false [0 1] [0 1 0 1 0 1] 1 DoImage3
  1016. XD 4 IMLRTB RGBData false [1 0] [0 1 0 1 0 1] 1 DoImage3
  1017. XE 4 IMLRBT RGBData false [1 0] [0 1 0 1 0 1] 1 DoImage3
  1018. XF 4 IMRLTB RGBData false [1 0] [0 1 0 1 0 1] 1 DoImage3
  1019. XG 4 IMRLBT RGBData false [1 0] [0 1 0 1 0 1] 1 DoImage3
  1020. XH 4 IMLRTB RGBDProc false [1 0] [0 1 0 1 0 1] 1 DoImage3
  1021. XI 4 IMLRTB RGBDFile false [1 0] [0 1 0 1 0 1] 1 DoImage3
  1022. RGBData (RGB) RGBDF CheckFileTail % Check that the correct amount of data was consumed
  1023. % ----------------------------------------------------------------------
  1024. % InterleaveType 2, BPC==8, WM=WD, HM=HD
  1025. % IT 2 is line interleave -- Mask line follwoed by Data line
  1026. % RGB Image Data must be chunky (MultipleDatasources==false).
  1027. /YY YD def
  1028. TX YY SY add moveto (\nIntType 2\nBPC=8) blockshow
  1029. % Generate the MaskData first
  1030. MaskGen
  1031. % Generate the Data Image (uses the MaskData)
  1032. /BPL WD 3 mul WB add cvi def % BytesPerLine
  1033. /RGBData BPL HD mul string def
  1034. { X 3 mul Y BPL mul add WB add % 3 bytes Red,Green,Blue + Mask Bytes
  1035. X 0 eq {
  1036. RGBData 1 index WB sub
  1037. MaskData Y WB mul WB getinterval
  1038. putinterval
  1039. } if
  1040. RGBData
  1041. dup 2 index R 255 mul cvi put
  1042. dup 2 index 1 add G 255 mul cvi put
  1043. exch 2 add B 255 mul cvi put
  1044. }
  1045. ImageGen
  1046. % X BPC matrix source multi MaskDecode DataDecode IT DoImage3 -
  1047. XA 8 IMLRTB RGBData false [0 1] [1 0 1 0 1 0] 2 DoImage3
  1048. XB 8 IMLRTB RGBData false [1 0] [1 0 1 0 1 0] 2 DoImage3
  1049. XC 8 IMLRTB RGBData false [0 1] [0 1 0 1 0 1] 2 DoImage3
  1050. XD 8 IMLRTB RGBData false [1 0] [0 1 0 1 0 1] 2 DoImage3
  1051. XE 8 IMLRBT RGBData false [1 0] [0 1 0 1 0 1] 2 DoImage3
  1052. XF 8 IMRLTB RGBData false [1 0] [0 1 0 1 0 1] 2 DoImage3
  1053. XG 8 IMRLBT RGBData false [1 0] [0 1 0 1 0 1] 2 DoImage3
  1054. XH 8 IMLRTB RGBDProc false [1 0] [0 1 0 1 0 1] 2 DoImage3
  1055. XI 8 IMLRTB RGBDFile false [1 0] [0 1 0 1 0 1] 2 DoImage3
  1056. RGBData (RGB) RGBDF CheckFileTail % Check that the correct amount of data was consumed
  1057. % ----------------------------------------------------------------------
  1058. % InterleaveType 2, BPC==12, WM=WD, HM=HD
  1059. /YY YE def
  1060. TX YY SY add moveto (\nIntType 2\nBPC=12) blockshow
  1061. % Generate the Data Image (uses the MaskData)
  1062. /BPL WD 36 mul 7 add 8 div cvi WB add def % BytesPerLine
  1063. /RGBData BPL HD mul string def
  1064. { X 36 mul 8 div Y BPL mul add WB add
  1065. X 0 eq {
  1066. RGBData 1 index WB sub cvi
  1067. MaskData Y WB mul WB getinterval
  1068. putinterval
  1069. } if
  1070. RGBData
  1071. dup 2 index R put12bit
  1072. dup 2 index 1.5 add G put12bit
  1073. exch 3.0 add B put12bit
  1074. }
  1075. ImageGen
  1076. % X BPC matrix source multi MaskDecode DataDecode IT DoImage3 -
  1077. XA 12 IMLRTB RGBData false [0 1] [1 0 1 0 1 0] 2 DoImage3
  1078. XB 12 IMLRTB RGBData false [1 0] [1 0 1 0 1 0] 2 DoImage3
  1079. XC 12 IMLRTB RGBData false [0 1] [0 1 0 1 0 1] 2 DoImage3
  1080. XD 12 IMLRTB RGBData false [1 0] [0 1 0 1 0 1] 2 DoImage3
  1081. XE 12 IMLRBT RGBData false [1 0] [0 1 0 1 0 1] 2 DoImage3
  1082. XF 12 IMRLTB RGBData false [1 0] [0 1 0 1 0 1] 2 DoImage3
  1083. XG 12 IMRLBT RGBData false [1 0] [0 1 0 1 0 1] 2 DoImage3
  1084. XH 12 IMLRTB RGBDProc false [1 0] [0 1 0 1 0 1] 2 DoImage3
  1085. XI 12 IMLRTB RGBDFile false [1 0] [0 1 0 1 0 1] 2 DoImage3
  1086. RGBData (RGB) RGBDF CheckFileTail % Check that the correct amount of data was consumed
  1087. % ----------------------------------------------------------------------
  1088. % InterleaveType 2, BPC==4, WM=WD, HM=HD
  1089. /YY YF def
  1090. TX YY SY add moveto (\nIntType 2\nBPC=4) blockshow
  1091. % Generate the Data Image (uses the MaskData)
  1092. /BPL WD 12 mul 7 add 8 div cvi WB add def % BytesPerLine
  1093. /RGBData BPL HD mul string def
  1094. { X 12 mul 8 div Y BPL mul add WB add
  1095. X 0 eq {
  1096. RGBData 1 index WB sub cvi
  1097. MaskData Y WB mul WB getinterval
  1098. putinterval
  1099. } if
  1100. RGBData
  1101. dup 2 index R put4bit
  1102. dup 2 index 0.5 add G put4bit
  1103. exch 1.0 add B put4bit
  1104. }
  1105. ImageGen
  1106. % X BPC matrix source multi MaskDecode DataDecode IT DoImage3 -
  1107. XA 4 IMLRTB RGBData false [0 1] [1 0 1 0 1 0] 2 DoImage3
  1108. XB 4 IMLRTB RGBData false [1 0] [1 0 1 0 1 0] 2 DoImage3
  1109. XC 4 IMLRTB RGBData false [0 1] [0 1 0 1 0 1] 2 DoImage3
  1110. XD 4 IMLRTB RGBData false [1 0] [0 1 0 1 0 1] 2 DoImage3
  1111. XE 4 IMLRBT RGBData false [1 0] [0 1 0 1 0 1] 2 DoImage3
  1112. XF 4 IMRLTB RGBData false [1 0] [0 1 0 1 0 1] 2 DoImage3
  1113. XG 4 IMRLBT RGBData false [1 0] [0 1 0 1 0 1] 2 DoImage3
  1114. XH 4 IMLRTB RGBDProc false [1 0] [0 1 0 1 0 1] 2 DoImage3
  1115. XI 4 IMLRTB RGBDFile false [1 0] [0 1 0 1 0 1] 2 DoImage3
  1116. RGBData (RGB) RGBDF CheckFileTail % Check that the correct amount of data was consumed
  1117. % ----------------------------------------------------------------------
  1118. % InterleaveType 2, BPC==8, WM=.6*WD, HM=HD/2
  1119. % IT 2 is line interleave -- Mask line follwoed by Data line
  1120. % RGB Image Data must be chunky (MultipleDatasources==false).
  1121. /YY YG def
  1122. TX YY SY add moveto (\nIntType 2\nBPC=8\nWM=.6*WD\nHM=HD/2) blockshow
  1123. % Generate the MaskData first
  1124. /WM WD .6 mul cvi def
  1125. /HM HD 2 div cvi def
  1126. /saveHD HD def
  1127. /HD HM 2 mul def % make HD even for this exercise
  1128. MaskGen
  1129. % Generate the Data Image (uses the MaskData)
  1130. /BPL WD 3 mul def % BytesPerLine RGB Data
  1131. /RGBData BPL HD mul WB HM mul add string def
  1132. { X 3 mul Y BPL mul add Y 2 div cvi 1 add WB mul add % 3 bytes Red,Green,Blue + Mask
  1133. X 0 eq Y 1 and 0 eq and { % Do one row of Mask every other image row
  1134. RGBData 1 index WB sub
  1135. MaskData Y 2 div cvi WB mul WB getinterval
  1136. putinterval
  1137. } if
  1138. RGBData
  1139. dup 2 index R 255 mul cvi put
  1140. dup 2 index 1 add G 255 mul cvi put
  1141. exch 2 add B 255 mul cvi put
  1142. }
  1143. ImageGen
  1144. %DEBUG /xx (xx) (w) file def
  1145. %DEBUG 0 1 HM 1 sub { MaskData exch WB mul WB getinterval xx exch writehexstring xx (\n) writestring } for
  1146. %DEBUG xx (----------------------------------------------------------------\n) writestring
  1147. %DEBUG 0 2 HD 1 sub {
  1148. %DEBUG RGBData 1 index BPL mul 2 index 2 div cvi WB mul add
  1149. %DEBUG WB getinterval xx exch writehexstring xx (\n) writestring
  1150. %DEBUG RGBData 1 index BPL mul 2 index 2 div cvi 1 add WB mul add
  1151. %DEBUG BPL getinterval xx exch writehexstring xx (\n) writestring
  1152. %DEBUG RGBData 1 index 1 add BPL mul 2 index 2 div cvi 1 add WB mul add
  1153. %DEBUG BPL getinterval xx exch writehexstring xx (\n) writestring
  1154. %DEBUG pop
  1155. %DEBUG } for
  1156. %DEBUG xx closefile
  1157. % X BPC matrix source multi MaskDecode DataDecode IT DoImage3 -
  1158. XA 8 IMLRTB RGBData false [0 1] [1 0 1 0 1 0] 2 DoImage3
  1159. XB 8 IMLRTB RGBData false [1 0] [1 0 1 0 1 0] 2 DoImage3
  1160. XC 8 IMLRTB RGBData false [0 1] [0 1 0 1 0 1] 2 DoImage3
  1161. XD 8 IMLRTB RGBData false [1 0] [0 1 0 1 0 1] 2 DoImage3
  1162. XE 8 IMLRBT RGBData false [1 0] [0 1 0 1 0 1] 2 DoImage3
  1163. XF 8 IMRLTB RGBData false [1 0] [0 1 0 1 0 1] 2 DoImage3
  1164. XG 8 IMRLBT RGBData false [1 0] [0 1 0 1 0 1] 2 DoImage3
  1165. XH 8 IMLRTB RGBDProc false [1 0] [0 1 0 1 0 1] 2 DoImage3
  1166. XI 8 IMLRTB RGBDFile false [1 0] [0 1 0 1 0 1] 2 DoImage3
  1167. RGBData (RGB) RGBDF CheckFileTail % Check that the correct amount of data was consumed
  1168. /HD saveHD def % put odd HD back
  1169. % ----------------------------------------------------------------------
  1170. % InterleaveType 2, BPC==8, WM=1.3*WD, HM=2*HD
  1171. % IT 2 is line interleave -- Mask line follwoed by Data line
  1172. % RGB Image Data must be chunky (MultipleDatasources==false).
  1173. /YY YH def
  1174. TX YY SY add moveto (\nIntType 2\nBPC=8\nWM=1.3*WD\nHM=2*HD) blockshow
  1175. % Generate the MaskData first
  1176. /WM WD 1.3 mul cvi def
  1177. /HM HD 2 mul def
  1178. MaskGen
  1179. % Generate the Data Image (uses the MaskData)
  1180. /HR HM HD div cvi def
  1181. /BPL WD 3 mul WB HR mul add cvi def % BytesPerLine
  1182. /RGBData BPL HD mul string def
  1183. { X 3 mul Y BPL mul add WB HR mul add % 3 bytes Red,Green,Blue + Mask Bytes
  1184. X 0 eq { % Do HM/HD rows of Mask
  1185. RGBData 1 index WB HR mul sub
  1186. MaskData Y WB HR mul mul WB HR mul getinterval
  1187. putinterval
  1188. } if
  1189. RGBData
  1190. dup 2 index R 255 mul cvi put
  1191. dup 2 index 1 add G 255 mul cvi put
  1192. exch 2 add B 255 mul cvi put
  1193. }
  1194. ImageGen
  1195. % X BPC matrix source multi MaskDecode DataDecode IT DoImage3 -
  1196. XA 8 IMLRTB RGBData false [0 1] [1 0 1 0 1 0] 2 DoImage3
  1197. XB 8 IMLRTB RGBData false [1 0] [1 0 1 0 1 0] 2 DoImage3
  1198. XC 8 IMLRTB RGBData false [0 1] [0 1 0 1 0 1] 2 DoImage3
  1199. XD 8 IMLRTB RGBData false [1 0] [0 1 0 1 0 1] 2 DoImage3
  1200. XE 8 IMLRBT RGBData false [1 0] [0 1 0 1 0 1] 2 DoImage3
  1201. XF 8 IMRLTB RGBData false [1 0] [0 1 0 1 0 1] 2 DoImage3
  1202. XG 8 IMRLBT RGBData false [1 0] [0 1 0 1 0 1] 2 DoImage3
  1203. XH 8 IMLRTB RGBDProc false [1 0] [0 1 0 1 0 1] 2 DoImage3
  1204. XI 8 IMLRTB RGBDFile false [1 0] [0 1 0 1 0 1] 2 DoImage3
  1205. RGBData (RGB) RGBDF CheckFileTail % Check that the correct amount of data was consumed
  1206. % ----------------------------------------------------------------------
  1207. % InterleaveType 2, BPC==12, WM=1.3*WD, HM=2*HD
  1208. /YY YI def
  1209. TX YY SY add moveto (\nIntType 2\nBPC=12\nWM=1.3*WD\nHM=2*HD) blockshow
  1210. % Generate the Data Image (uses the MaskData)
  1211. /HR HM HD div cvi def
  1212. /BPL WD 36 mul 7 add 8 div cvi WB HR mul add def % BytesPerLine
  1213. /RGBData BPL HD mul string def
  1214. { X 36 mul 8 div Y BPL mul add WB HR mul add
  1215. X 0 eq {
  1216. RGBData 1 index WB HR mul sub cvi
  1217. MaskData Y WB HR mul mul WB HR mul getinterval
  1218. putinterval
  1219. } if
  1220. RGBData
  1221. dup 2 index R put12bit
  1222. dup 2 index 1.5 add G put12bit
  1223. exch 3.0 add B put12bit
  1224. }
  1225. ImageGen
  1226. % X BPC matrix source multi MaskDecode DataDecode IT DoImage3 -
  1227. XA 12 IMLRTB RGBData false [0 1] [1 0 1 0 1 0] 2 DoImage3
  1228. XB 12 IMLRTB RGBData false [1 0] [1 0 1 0 1 0] 2 DoImage3
  1229. XC 12 IMLRTB RGBData false [0 1] [0 1 0 1 0 1] 2 DoImage3
  1230. XD 12 IMLRTB RGBData false [1 0] [0 1 0 1 0 1] 2 DoImage3
  1231. XE 12 IMLRBT RGBData false [1 0] [0 1 0 1 0 1] 2 DoImage3
  1232. XF 12 IMRLTB RGBData false [1 0] [0 1 0 1 0 1] 2 DoImage3
  1233. XG 12 IMRLBT RGBData false [1 0] [0 1 0 1 0 1] 2 DoImage3
  1234. XH 12 IMLRTB RGBDProc false [1 0] [0 1 0 1 0 1] 2 DoImage3
  1235. XI 12 IMLRTB RGBDFile false [1 0] [0 1 0 1 0 1] 2 DoImage3
  1236. RGBData (RGB) RGBDF CheckFileTail % Check that the correct amount of data was consumed
  1237. % ----------------------------------------------------------------------
  1238. % InterleaveType 2, BPC==4, WM=1.3*WD, HM=2*HD
  1239. /YY YJ def
  1240. TX YY SY add moveto (\nIntType 2\nBPC=4\nWM=1.3*WD\nHM=2*HD) blockshow
  1241. % Generate the Data Image (uses the MaskData)
  1242. /HR HM HD div cvi def
  1243. /BPL WD 12 mul 7 add 8 div cvi WB HR mul add def % BytesPerLine
  1244. /RGBData BPL HD mul string def
  1245. { X 12 mul 8 div Y BPL mul add WB HR mul add
  1246. X 0 eq {
  1247. RGBData 1 index WB HR mul sub cvi
  1248. MaskData Y WB HR mul mul WB HR mul getinterval
  1249. putinterval
  1250. } if
  1251. RGBData
  1252. dup 2 index R put4bit
  1253. dup 2 index 0.5 add G put4bit
  1254. exch 1.0 add B put4bit
  1255. }
  1256. ImageGen
  1257. % X BPC matrix source multi MaskDecode DataDecode IT DoImage3 -
  1258. XA 4 IMLRTB RGBData false [0 1] [1 0 1 0 1 0] 2 DoImage3
  1259. XB 4 IMLRTB RGBData false [1 0] [1 0 1 0 1 0] 2 DoImage3
  1260. XC 4 IMLRTB RGBData false [0 1] [0 1 0 1 0 1] 2 DoImage3
  1261. XD 4 IMLRTB RGBData false [1 0] [0 1 0 1 0 1] 2 DoImage3
  1262. XE 4 IMLRBT RGBData false [1 0] [0 1 0 1 0 1] 2 DoImage3
  1263. XF 4 IMRLTB RGBData false [1 0] [0 1 0 1 0 1] 2 DoImage3
  1264. XG 4 IMRLBT RGBData false [1 0] [0 1 0 1 0 1] 2 DoImage3
  1265. XH 4 IMLRTB RGBDProc false [1 0] [0 1 0 1 0 1] 2 DoImage3
  1266. XI 4 IMLRTB RGBDFile false [1 0] [0 1 0 1 0 1] 2 DoImage3
  1267. RGBData (RGB) RGBDF CheckFileTail % Check that the correct amount of data was consumed
  1268. showpage
  1269. % ----------------------------------------------------------------------
  1270. % Use an unusual (unpleasant?) underlying color
  1271. .6 .95 .4 setrgbcolor clippath fill
  1272. 0 0 0 setrgbcolor
  1273. TitleFont setfont
  1274. 200 760 moveto (Image Type 3 Tests) show
  1275. 200 740 moveto (Rotation Angle = ) show IR 3 string cvs show
  1276. 200 720 moveto (InterleaveType 3) show
  1277. 170 700 moveto (Colorspace = ) show CSpaceName show
  1278. LegendFont setfont
  1279. .4 .1 .7 setrgbcolor % contrasting color for stencil masking
  1280. % ----------------------------------------------------------------------
  1281. % InterleaveType 3, BPC==8, WM=WD, HM=HD
  1282. % IT 3 is line interleave -- Mask and Data in separate sources
  1283. % RGB Image Data chunky (MultipleDatasources==false).
  1284. /YY YA def
  1285. TX YY SY add moveto (BPC=8\nMulti\nfalse) blockshow
  1286. % Generate the MaskData first
  1287. /WM WD def
  1288. /HM HD def
  1289. MaskGen
  1290. % Generate the Data Image
  1291. /RGBData WD HD mul 3 mul string def
  1292. { X Y WD mul add 3 mul RGBData
  1293. dup 2 index R 255 mul cvi put
  1294. dup 2 index 1 add G 255 mul cvi put
  1295. exch 2 add B 255 mul cvi put
  1296. } ImageGen
  1297. % X BPC matrix source multi MaskDecode DataDecode IT DoImage3 -
  1298. XA 8 IMLRTB [ MaskData RGBData ] false [0 1] [1 0 1 0 1 0] 3 DoImage3
  1299. XB 8 IMLRTB [ MaskData RGBData ] false [1 0] [1 0 1 0 1 0] 3 DoImage3
  1300. XC 8 IMLRTB [ MaskData RGBData ] false [0 1] [0 1 0 1 0 1] 3 DoImage3
  1301. XD 8 IMLRTB [ MaskData RGBData ] false [1 0] [0 1 0 1 0 1] 3 DoImage3
  1302. XE 8 IMLRBT [ MaskData RGBData ] false [1 0] [0 1 0 1 0 1] 3 DoImage3
  1303. XF 8 IMRLTB [ MaskData RGBData ] false [1 0] [0 1 0 1 0 1] 3 DoImage3
  1304. XG 8 IMRLBT [ MaskData RGBData ] false [1 0] [0 1 0 1 0 1] 3 DoImage3
  1305. XH 8 IMLRTB [ MaskDProc RGBDProc ] false [1 0] [0 1 0 1 0 1] 3 DoImage3
  1306. XI 8 IMLRTB [ MaskDFile RGBDFile ] false [1 0] [0 1 0 1 0 1] 3 DoImage3
  1307. MaskData (Mask) MDF CheckFileTail % Check that the correct amount of data was consumed
  1308. RGBData (RGB) RGBDF CheckFileTail % Check that the correct amount of data was consumed
  1309. % ----------------------------------------------------------------------
  1310. % InterleaveType 3, BPC==12, WM=WD, HM=HD
  1311. /YY YB def
  1312. TX YY SY add moveto (BPC=12\nMulti\nfalse) blockshow
  1313. /RGBData WD 36 mul 7 add 8 div cvi HD mul string def
  1314. {
  1315. X 36 mul 8 div Y WD 36 mul 7 add 8 div cvi mul add
  1316. RGBData 1 index R put12bit
  1317. RGBData 1 index 1.5 add G put12bit
  1318. RGBData exch 3 add B put12bit
  1319. } ImageGen
  1320. % X BPC matrix source multi MaskDecode DataDecode IT DoImage3 -
  1321. XA 12 IMLRTB [ MaskData RGBData ] false [0 1] [1 0 1 0 1 0] 3 DoImage3
  1322. XB 12 IMLRTB [ MaskData RGBData ] false [1 0] [1 0 1 0 1 0] 3 DoImage3
  1323. XC 12 IMLRTB [ MaskData RGBData ] false [0 1] [0 1 0 1 0 1] 3 DoImage3
  1324. XD 12 IMLRTB [ MaskData RGBData ] false [1 0] [0 1 0 1 0 1] 3 DoImage3
  1325. XE 12 IMLRBT [ MaskData RGBData ] false [1 0] [0 1 0 1 0 1] 3 DoImage3
  1326. XF 12 IMRLTB [ MaskData RGBData ] false [1 0] [0 1 0 1 0 1] 3 DoImage3
  1327. XG 12 IMRLBT [ MaskData RGBData ] false [1 0] [0 1 0 1 0 1] 3 DoImage3
  1328. XH 12 IMLRTB [ MaskDProc RGBDProc ] false [1 0] [0 1 0 1 0 1] 3 DoImage3
  1329. XI 12 IMLRTB [ MaskDFile RGBDFile ] false [1 0] [0 1 0 1 0 1] 3 DoImage3
  1330. MaskData (Mask) MDF CheckFileTail % Check that the correct amount of data was consumed
  1331. RGBData (RGB) RGBDF CheckFileTail % Check that the correct amount of data was consumed
  1332. % ----------------------------------------------------------------------
  1333. % InterleaveType 3, BPC==4, WM=WD, HM=HD
  1334. /YY YC def
  1335. TX YY SY add moveto (BPC=4\nMulti\nfalse) blockshow
  1336. /RGBData WD 12 mul 7 add 8 div cvi HD mul string def
  1337. {
  1338. X 12 mul 8 div Y WD 12 mul 7 add 8 div cvi mul add
  1339. RGBData 1 index R put4bit
  1340. RGBData 1 index 0.5 add G put4bit
  1341. RGBData exch 1.0 add B put4bit
  1342. } ImageGen
  1343. % X BPC matrix source multi MaskDecode DataDecode IT DoImage3 -
  1344. XA 4 IMLRTB [ MaskData RGBData ] false [0 1] [1 0 1 0 1 0] 3 DoImage3
  1345. XB 4 IMLRTB [ MaskData RGBData ] false [1 0] [1 0 1 0 1 0] 3 DoImage3
  1346. XC 4 IMLRTB [ MaskData RGBData ] false [0 1] [0 1 0 1 0 1] 3 DoImage3
  1347. XD 4 IMLRTB [ MaskData RGBData ] false [1 0] [0 1 0 1 0 1] 3 DoImage3
  1348. XE 4 IMLRBT [ MaskData RGBData ] false [1 0] [0 1 0 1 0 1] 3 DoImage3
  1349. XF 4 IMRLTB [ MaskData RGBData ] false [1 0] [0 1 0 1 0 1] 3 DoImage3
  1350. XG 4 IMRLBT [ MaskData RGBData ] false [1 0] [0 1 0 1 0 1] 3 DoImage3
  1351. XH 4 IMLRTB [ MaskDProc RGBDProc ] false [1 0] [0 1 0 1 0 1] 3 DoImage3
  1352. XI 4 IMLRTB [ MaskDFile RGBDFile ] false [1 0] [0 1 0 1 0 1] 3 DoImage3
  1353. MaskData (Mask) MDF CheckFileTail % Check that the correct amount of data was consumed
  1354. RGBData (RGB) RGBDF CheckFileTail % Check that the correct amount of data was consumed
  1355. % ----------------------------------------------------------------------
  1356. % InterleaveType 3, BPC==8, WM=WD, HM=HD
  1357. % IT 3 is line interleave -- Mask and Data in separate sources
  1358. % RGB Image Data seprate (MultipleDatasources==true).
  1359. /YY YA def
  1360. TX YY SY add moveto (BPC=8\nMulti\ntrue) blockshow
  1361. % Generate the MaskData first
  1362. MaskGen
  1363. % Generate the Data Image
  1364. WD HD mul /RData 1 index string def
  1365. /GData 1 index string def
  1366. /BData exch string def
  1367. { X Y WD mul add
  1368. RData 1 index R 255 mul cvi put
  1369. GData 1 index G 255 mul cvi put
  1370. BData exch B 255 mul cvi put
  1371. } ImageGen
  1372. % X BPC matrix source multi MaskDecode DataDecode IT DoImage3 -
  1373. XA 8 IMLRTB [ MaskData [RData GData BData] ] true [0 1] [1 0 1 0 1 0] 3 DoImage3
  1374. XB 8 IMLRTB [ MaskData [RData GData BData] ] true [1 0] [1 0 1 0 1 0] 3 DoImage3
  1375. XC 8 IMLRTB [ MaskData [RData GData BData] ] true [0 1] [0 1 0 1 0 1] 3 DoImage3
  1376. XD 8 IMLRTB [ MaskData [RData GData BData] ] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1377. XE 8 IMLRBT [ MaskData [RData GData BData] ] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1378. XF 8 IMRLTB [ MaskData [RData GData BData] ] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1379. XG 8 IMRLBT [ MaskData [RData GData BData] ] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1380. XH 8 IMLRTB [ MaskDProc [RDProc GDProc BDProc]] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1381. XI 8 IMLRTB [ MaskDFile [RDFile GDFile BDFile]] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1382. MaskData (Mask) MDF CheckFileTail % Check that the correct amount of data was consumed
  1383. RData (Red) RDF CheckFileTail % Check that the correct amount of data was consumed
  1384. GData (Grn) GDF CheckFileTail % Check that the correct amount of data was consumed
  1385. BData (Blu) BDF CheckFileTail % Check that the correct amount of data was consumed
  1386. % ----------------------------------------------------------------------
  1387. % InterleaveType 3, BPC==8, WM=WD, HM=HD
  1388. % IT 3 is line interleave -- Mask and Data in separate sources
  1389. % RGB Image Data seprate (MultipleDatasources==true).
  1390. /YY YD def
  1391. TX YY SY add moveto (BPC=8\nMulti\ntrue) blockshow
  1392. % Generate the MaskData first
  1393. MaskGen
  1394. % Generate the Data Image
  1395. WD HD mul /RData 1 index string def
  1396. /GData 1 index string def
  1397. /BData exch string def
  1398. { X Y WD mul add
  1399. RData 1 index R 255 mul cvi put
  1400. GData 1 index G 255 mul cvi put
  1401. BData exch B 255 mul cvi put
  1402. } ImageGen
  1403. % X BPC matrix source multi MaskDecode DataDecode IT DoImage3 -
  1404. XA 8 IMLRTB [ MaskData [RData GData BData] ] true [0 1] [1 0 1 0 1 0] 3 DoImage3
  1405. XB 8 IMLRTB [ MaskData [RData GData BData] ] true [1 0] [1 0 1 0 1 0] 3 DoImage3
  1406. XC 8 IMLRTB [ MaskData [RData GData BData] ] true [0 1] [0 1 0 1 0 1] 3 DoImage3
  1407. XD 8 IMLRTB [ MaskData [RData GData BData] ] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1408. XE 8 IMLRBT [ MaskData [RData GData BData] ] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1409. XF 8 IMRLTB [ MaskData [RData GData BData] ] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1410. XG 8 IMRLBT [ MaskData [RData GData BData] ] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1411. XH 8 IMLRTB [ MaskDProc [RDProc GDProc BDProc]] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1412. XI 8 IMLRTB [ MaskDFile [RDFile GDFile BDFile]] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1413. MaskData (Mask) MDF CheckFileTail % Check that the correct amount of data was consumed
  1414. RData (Red) RDF CheckFileTail % Check that the correct amount of data was consumed
  1415. GData (Grn) GDF CheckFileTail % Check that the correct amount of data was consumed
  1416. BData (Blu) BDF CheckFileTail % Check that the correct amount of data was consumed
  1417. % ----------------------------------------------------------------------
  1418. % InterleaveType 3, BPC==12, WM=WD, HM=HD
  1419. /YY YE def
  1420. TX YY SY add moveto (BPC=12\nMulti\ntrue) blockshow
  1421. WD 3 mul 1 add 2 div cvi HD mul /RData 1 index string def
  1422. /GData 1 index string def
  1423. /BData exch string def
  1424. {
  1425. X 3 mul 2 div Y WD 3 mul 1 add 2 div cvi mul add
  1426. RData 1 index R put12bit
  1427. GData 1 index G put12bit
  1428. BData exch B put12bit
  1429. } ImageGen
  1430. % X BPC matrix source multi MaskDecode DataDecode IT DoImage3 -
  1431. XA 12 IMLRTB [ MaskData [RData GData BData] ] true [0 1] [1 0 1 0 1 0] 3 DoImage3
  1432. XB 12 IMLRTB [ MaskData [RData GData BData] ] true [1 0] [1 0 1 0 1 0] 3 DoImage3
  1433. XC 12 IMLRTB [ MaskData [RData GData BData] ] true [0 1] [0 1 0 1 0 1] 3 DoImage3
  1434. XD 12 IMLRTB [ MaskData [RData GData BData] ] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1435. XE 12 IMLRBT [ MaskData [RData GData BData] ] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1436. XF 12 IMRLTB [ MaskData [RData GData BData] ] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1437. XG 12 IMRLBT [ MaskData [RData GData BData] ] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1438. XH 12 IMLRTB [ MaskDProc [RDProc GDProc BDProc]] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1439. XI 12 IMLRTB [ MaskDFile [RDFile GDFile BDFile]] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1440. MaskData (Mask) MDF CheckFileTail % Check that the correct amount of data was consumed
  1441. RData (Red) RDF CheckFileTail % Check that the correct amount of data was consumed
  1442. GData (Grn) GDF CheckFileTail % Check that the correct amount of data was consumed
  1443. BData (Blu) BDF CheckFileTail % Check that the correct amount of data was consumed
  1444. % ----------------------------------------------------------------------
  1445. % InterleaveType 3, BPC==4, WM=WD, HM=HD
  1446. /YY YF def
  1447. TX YY SY add moveto (BPC=4\nMulti\ntrue) blockshow
  1448. WD 1 add 2 div cvi HD mul /RData 1 index string def
  1449. /GData 1 index string def
  1450. /BData exch string def
  1451. {
  1452. X 2 div Y WD 1 add 2 div cvi mul add
  1453. RData 1 index R put4bit
  1454. GData 1 index G put4bit
  1455. BData exch B put4bit
  1456. } ImageGen
  1457. % X BPC matrix source multi MaskDecode DataDecode IT DoImage3 -
  1458. XA 4 IMLRTB [ MaskData [RData GData BData] ] true [0 1] [1 0 1 0 1 0] 3 DoImage3
  1459. XB 4 IMLRTB [ MaskData [RData GData BData] ] true [1 0] [1 0 1 0 1 0] 3 DoImage3
  1460. XC 4 IMLRTB [ MaskData [RData GData BData] ] true [0 1] [0 1 0 1 0 1] 3 DoImage3
  1461. XD 4 IMLRTB [ MaskData [RData GData BData] ] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1462. XE 4 IMLRBT [ MaskData [RData GData BData] ] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1463. XF 4 IMRLTB [ MaskData [RData GData BData] ] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1464. XG 4 IMRLBT [ MaskData [RData GData BData] ] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1465. XH 4 IMLRTB [ MaskDProc [RDProc GDProc BDProc]] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1466. XI 4 IMLRTB [ MaskDFile [RDFile GDFile BDFile]] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1467. MaskData (Mask) MDF CheckFileTail % Check that the correct amount of data was consumed
  1468. RData (Red) RDF CheckFileTail % Check that the correct amount of data was consumed
  1469. GData (Grn) GDF CheckFileTail % Check that the correct amount of data was consumed
  1470. BData (Blu) BDF CheckFileTail % Check that the correct amount of data was consumed
  1471. % ----------------------------------------------------------------------
  1472. % InterleaveType 3, BPC==8, WM=.9*WD, HM=1.1*HD
  1473. % IT 3 is line interleave -- Mask and Data in separate sources
  1474. % RGB Image Data seprate (MultipleDatasources==true).
  1475. /YY YG def
  1476. TX YY SY add moveto (BPC=8\nMulti\ntrue\nWM=.9*WD\nHM=1.1*HD) blockshow
  1477. /WM 0.9 WD mul cvi def
  1478. /HM 1.1 HD mul cvi def
  1479. % Generate the MaskData first
  1480. MaskGen
  1481. % Generate the Data Image
  1482. WD HD mul /RData 1 index string def
  1483. /GData 1 index string def
  1484. /BData exch string def
  1485. { X Y WD mul add
  1486. RData 1 index R 255 mul cvi put
  1487. GData 1 index G 255 mul cvi put
  1488. BData exch B 255 mul cvi put
  1489. } ImageGen
  1490. % X BPC matrix source multi MaskDecode DataDecode IT DoImage3 -
  1491. XA 8 IMLRTB [ MaskData [RData GData BData] ] true [0 1] [1 0 1 0 1 0] 3 DoImage3
  1492. XB 8 IMLRTB [ MaskData [RData GData BData] ] true [1 0] [1 0 1 0 1 0] 3 DoImage3
  1493. XC 8 IMLRTB [ MaskData [RData GData BData] ] true [0 1] [0 1 0 1 0 1] 3 DoImage3
  1494. XD 8 IMLRTB [ MaskData [RData GData BData] ] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1495. XE 8 IMLRBT [ MaskData [RData GData BData] ] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1496. XF 8 IMRLTB [ MaskData [RData GData BData] ] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1497. XG 8 IMRLBT [ MaskData [RData GData BData] ] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1498. XH 8 IMLRTB [ MaskDProc [RDProc GDProc BDProc]] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1499. XI 8 IMLRTB [ MaskDFile [RDFile GDFile BDFile]] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1500. MaskData (Mask) MDF CheckFileTail % Check that the correct amount of data was consumed
  1501. RData (Red) RDF CheckFileTail % Check that the correct amount of data was consumed
  1502. GData (Grn) GDF CheckFileTail % Check that the correct amount of data was consumed
  1503. BData (Blu) BDF CheckFileTail % Check that the correct amount of data was consumed
  1504. % ----------------------------------------------------------------------
  1505. % InterleaveType 3, BPC==12, WM=WD, HM=HD
  1506. /YY YI def
  1507. TX YY SY add moveto (BPC=12\nMulti\ntrue\nWM=.9*WD\nHM=1.1*HD) blockshow
  1508. WD 3 mul 1 add 2 div cvi HD mul /RData 1 index string def
  1509. /GData 1 index string def
  1510. /BData exch string def
  1511. {
  1512. X 3 mul 2 div Y WD 3 mul 1 add 2 div cvi mul add
  1513. RData 1 index R put12bit
  1514. GData 1 index G put12bit
  1515. BData exch B put12bit
  1516. } ImageGen
  1517. % X BPC matrix source multi MaskDecode DataDecode IT DoImage3 -
  1518. XA 12 IMLRTB [ MaskData [RData GData BData] ] true [0 1] [1 0 1 0 1 0] 3 DoImage3
  1519. XB 12 IMLRTB [ MaskData [RData GData BData] ] true [1 0] [1 0 1 0 1 0] 3 DoImage3
  1520. XC 12 IMLRTB [ MaskData [RData GData BData] ] true [0 1] [0 1 0 1 0 1] 3 DoImage3
  1521. XD 12 IMLRTB [ MaskData [RData GData BData] ] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1522. XE 12 IMLRBT [ MaskData [RData GData BData] ] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1523. XF 12 IMRLTB [ MaskData [RData GData BData] ] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1524. XG 12 IMRLBT [ MaskData [RData GData BData] ] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1525. XH 12 IMLRTB [ MaskDProc [RDProc GDProc BDProc]] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1526. XI 12 IMLRTB [ MaskDFile [RDFile GDFile BDFile]] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1527. MaskData (Mask) MDF CheckFileTail % Check that the correct amount of data was consumed
  1528. RData (Red) RDF CheckFileTail % Check that the correct amount of data was consumed
  1529. GData (Grn) GDF CheckFileTail % Check that the correct amount of data was consumed
  1530. BData (Blu) BDF CheckFileTail % Check that the correct amount of data was consumed
  1531. % ----------------------------------------------------------------------
  1532. % InterleaveType 3, BPC==4, WM=WD, HM=HD
  1533. /YY YJ def
  1534. TX YY SY add moveto (BPC=4\nMulti\ntrue\nWM=.9*WD\nHM=1.1*HD) blockshow
  1535. WD 1 add 2 div cvi HD mul /RData 1 index string def
  1536. /GData 1 index string def
  1537. /BData exch string def
  1538. {
  1539. X 2 div Y WD 1 add 2 div cvi mul add
  1540. RData 1 index R put4bit
  1541. GData 1 index G put4bit
  1542. BData exch B put4bit
  1543. } ImageGen
  1544. % X BPC matrix source multi MaskDecode DataDecode IT DoImage3 -
  1545. XA 4 IMLRTB [ MaskData [RData GData BData] ] true [0 1] [1 0 1 0 1 0] 3 DoImage3
  1546. XB 4 IMLRTB [ MaskData [RData GData BData] ] true [1 0] [1 0 1 0 1 0] 3 DoImage3
  1547. XC 4 IMLRTB [ MaskData [RData GData BData] ] true [0 1] [0 1 0 1 0 1] 3 DoImage3
  1548. XD 4 IMLRTB [ MaskData [RData GData BData] ] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1549. XE 4 IMLRBT [ MaskData [RData GData BData] ] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1550. XF 4 IMRLTB [ MaskData [RData GData BData] ] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1551. XG 4 IMRLBT [ MaskData [RData GData BData] ] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1552. XH 4 IMLRTB [ MaskDProc [RDProc GDProc BDProc]] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1553. XI 4 IMLRTB [ MaskDFile [RDFile GDFile BDFile]] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1554. MaskData (Mask) MDF CheckFileTail % Check that the correct amount of data was consumed
  1555. RData (Red) RDF CheckFileTail % Check that the correct amount of data was consumed
  1556. GData (Grn) GDF CheckFileTail % Check that the correct amount of data was consumed
  1557. BData (Blu) BDF CheckFileTail % Check that the correct amount of data was consumed
  1558. % ----------------------------------------------------------------------
  1559. % InterleaveType 3, BPC==8, WM=1.1*WD, HM=.9*HD
  1560. % IT 3 is line interleave -- Mask and Data in separate sources
  1561. % RGB Image Data seprate (MultipleDatasources==true).
  1562. /YY YH def
  1563. TX YY SY add moveto (BPC=8\nMulti\ntrue\nWM=1.1*WD\nHM=.9*HD) blockshow
  1564. /WM 1.1 WD mul cvi def
  1565. /HM 0.9 HD mul cvi def
  1566. % Generate the MaskData first
  1567. MaskGen
  1568. % Generate the Data Image
  1569. WD HD mul /RData 1 index string def
  1570. /GData 1 index string def
  1571. /BData exch string def
  1572. { X Y WD mul add
  1573. RData 1 index R 255 mul cvi put
  1574. GData 1 index G 255 mul cvi put
  1575. BData exch B 255 mul cvi put
  1576. } ImageGen
  1577. % X BPC matrix source multi MaskDecode DataDecode IT DoImage3 -
  1578. XA 8 IMLRTB [ MaskData [RData GData BData] ] true [0 1] [1 0 1 0 1 0] 3 DoImage3
  1579. XB 8 IMLRTB [ MaskData [RData GData BData] ] true [1 0] [1 0 1 0 1 0] 3 DoImage3
  1580. XC 8 IMLRTB [ MaskData [RData GData BData] ] true [0 1] [0 1 0 1 0 1] 3 DoImage3
  1581. XD 8 IMLRTB [ MaskData [RData GData BData] ] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1582. XE 8 IMLRBT [ MaskData [RData GData BData] ] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1583. XF 8 IMRLTB [ MaskData [RData GData BData] ] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1584. XG 8 IMRLBT [ MaskData [RData GData BData] ] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1585. XH 8 IMLRTB [ MaskDProc [RDProc GDProc BDProc]] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1586. XI 8 IMLRTB [ MaskDFile [RDFile GDFile BDFile]] true [1 0] [0 1 0 1 0 1] 3 DoImage3
  1587. MaskData (Mask) MDF CheckFileTail % Check that the correct amount of data was consumed
  1588. RData (Red) RDF CheckFileTail % Check that the correct amount of data was consumed
  1589. GData (Grn) GDF CheckFileTail % Check that the correct amount of data was consumed
  1590. BData (Blu) BDF CheckFileTail % Check that the correct amount of data was consumed
  1591. showpage
  1592. } bind def % T3Tests
  1593. % ----------------------------------------------------------------------
  1594. % Do the various rotations
  1595. %
  1596. /CSpace /DeviceRGB def
  1597. [ 0 10 -10 45 90 180 270 ]
  1598. pop [ 0 ] % delete this line to enable tests
  1599. { /IR exch def T1T4Tests } forall
  1600. [ 0 10 -10 45 90 180 270 ]
  1601. pop [ 0 ] % delete this line to enable tests
  1602. { /IR exch def T3Tests } forall
  1603. /CSpace [ /DeviceN [/Blue /Red /Green] /DeviceRGB { } ] def
  1604. [ 0 10 -10 45 90 180 270 ]
  1605. pop [ 0 ] % delete this line to enable tests
  1606. { /IR exch def T1T4Tests } forall
  1607. [ 0 10 -10 45 90 180 270 ]
  1608. pop [ 0 ] % delete this line to enable tests
  1609. { /IR exch def T3Tests } forall