home *** CD-ROM | disk | FTP | other *** search
- head 1.4;
- branch ;
- access ;
- symbols beta10:1.3;
- locks death:1.4;
- comment @# @;
-
-
- 1.4
- date 93.04.04.23.30.54; author death; state Exp;
- branches ;
- next 1.3;
-
- 1.3
- date 93.01.09.21.07.34; author death; state Exp;
- branches ;
- next 1.2;
-
- 1.2
- date 93.01.01.11.51.40; author death; state Exp;
- branches ;
- next 1.1;
-
- 1.1
- date 92.12.31.15.35.08; author death; state Exp;
- branches ;
- next ;
-
-
- desc
- @@
-
-
- 1.4
- log
- @Sun Apr 4 23:30:54 PDT 1993
- @
- text
- @%BEGIN Patterns
-
- %%%%%%%%%%%%%
- % Notes:
- % qdpat is an 8 byte hex string, like <AA55AA55AA55AA55>
- % clut-info is a hex string of RGB byte triples for color lookup
- % pict2pat is either of:
- % qdpat [r g b] 2
- % qdpat num clut-info bitdepth left top width height
- % destwidth destheight packedflag bitmap-string 1
- % See the common routine usePattern for how much of this is used
- %%%%%%%%%%%%%
-
-
- %%%%%%%%%%%%%
- % Name: GetPatGrey
- % Syntax: qdpat GetPatGrey num
- % About: Given a hex string representing 8 bytes of data, assume it is a
- % quickdraw B&W pattern. Calculate what percentage of the pixels
- % are black, and return the % grey
- %%%%%%%%%%%%%
- /GetPatGrey
- {
- /QDpattern exch def
- /darkness 0 def
- %
- % for each byte of pattern, convert to value between 0 and 1 and sum
- % This is not completely accurate, but works well enough (it counts #'s, not bits)
- %
- 0 1 7
- {
- /patByte exch def
- /darkness
- QDpattern patByte get
- 255 div darkness add
- def
- }
- for
- %
- % Compute the average shade and push
- %
- darkness 8 div
- }
- def
-
- %%%%%%%%%%%%%
- % Name: FillQDPatDict
- % Syntax: qdpat 0 FillQDPatDict -
- % pict2pat FillQDPatDict -
- % About: Store pattern info we are passed. This assumes an appropriate
- % dictionary has been opened and is on the stack.
- %%%%%%%%%%%%%
- /FillQDPatDict
- {
- begin
- /QDPatType exch def
- QDPatType 0 eq
- {
- /QDPatData exch def
- /QDPatGrey QDPatData GetPatGrey def
- }
- {
- QDPatType 2 eq
- {
- /QDColorValue exch def
- pop % B&W pattern not needed. color will suffice.
- }
- {
- /QDPatBitmap exch def
- /QDisPacked exch def
- /QDDestHeight exch def
- /QDDestWidth exch def
- /Height exch def
- /Width exch def
- /QDTop exch def
- /QDLeft exch def
- /BitsPerComponent exch def
- /QDColorTable exch def
- /QDNumColors exch def
- /QDPatData exch def
- /QDPatGrey QDPatData GetPatGrey def
- }
- ifelse
- }
- ifelse
- end
- }
- def
-
- %%%%%%%%%%%%%
- % Name: bkPat [0002]
- % Syntax: qdpat 0 bkPat -
- % About: Stores the pattern info in the backPattern dict.
- %%%%%%%%%%%%%
- /bkPat
- {backPattern FillQDPatDict}
- def
-
- %%%%%%%%%%%%%
- % Name: pnPat [0009]
- % Syntax: qdpat 0 pnPat -
- % About: Stores the pattern info in the penPattern dict.
- %%%%%%%%%%%%%
- /pnPat
- {penPattern FillQDPatDict}
- def
-
- %%%%%%%%%%%%%
- % Name: fillPat [000A]
- % Syntax: qdpat 0 fillPat -
- % About: Stores the pattern info in the fillPattern dict.
- %%%%%%%%%%%%%
- /fillPat
- {fillPattern FillQDPatDict}
- def
-
- %%%%%%%%%%%%%
- % Name: bkPixPat [0012]
- % Syntax: pict2pat bkPixPat -
- % About: Stores the pattern info in the backPattern dict.
- %%%%%%%%%%%%%
- /bkPixPat
- {backPattern FillQDPatDict}
- def
-
- %%%%%%%%%%%%%
- % Name: pnPixPat [0013]
- % Syntax: pict2pat pnPixPat -
- % About: Stores the pattern info in the penPattern dict.
- %%%%%%%%%%%%%
- /pnPixPat
- {penPattern FillQDPatDict}
- def
-
- %%%%%%%%%%%%%
- % Name: fillPixPat [0014]
- % Syntax: pict2pat fillPixPat -
- % About: Stores the pattern info in the fillPattern dict.
- %%%%%%%%%%%%%
- /fillPixPat
- {fillPattern FillQDPatDict}
- def
-
- %END Patterns
- @
-
-
- 1.3
- log
- @Sat Jan 9 21:07:33 PST 1993
- @
- text
- @@
-
-
- 1.2
- log
- @Fri Jan 1 11:51:40 PST 1993
- @
- text
- @d28 1
- @
-
-
- 1.1
- log
- @Thu Dec 31 15:35:07 PST 1992
- @
- text
- @@
-