[comp.sys.mac.programmer] {Bit,Pix}Maps in PICT files

rmorgan@network.ucsd.edu (Robert Morgan) (06/08/90)

Hi,

I'm in the middle of writting a PICT parser on a UNIX system and I need to
know something which does not seem to be documented:

   Q1:
   Is it possible to have a BitMap in a version 2 PICT ?
   The documentation seems to imply that PixMaps replace BitMaps in
   version 2 PICT files, but I wanted to make sure...

   Q2:
   IM V page 104 seems to say that the high bit of rowBytes tells you this,
   but in the same paragraph they say that "In general, the difference
   between version 1 and version 2 formats is that the pixMap replaces
   the bitMap..."  So, can I just check the PICT version instead of
   the high bit of rowBytes ?

Thanks,
John "Mac Hack" Moreland
San Diego SuperComputer Center

russotto@eng.umd.edu (Matthew T. Russotto) (06/09/90)

In article <2529@network.ucsd.edu> rmorgan@network.ucsd.edu (Robert Morgan) writes:
>   Q1:
>   Is it possible to have a BitMap in a version 2 PICT ?
>   The documentation seems to imply that PixMaps replace BitMaps in
>   version 2 PICT files, but I wanted to make sure...
Short Answer: Yes
Long Answer: IM V-104, note 4 (the stuff you mention in Q2)

>   Q2:
>   IM V page 104 seems to say that the high bit of rowBytes tells you this,
>   but in the same paragraph they say that "In general, the difference
>   between version 1 and version 2 formats is that the pixMap replaces
>   the bitMap..."  So, can I just check the PICT version instead of
>   the high bit of rowBytes ?
No, ignore that phrase. I'm pretty sure that if a copybits of a 1-bit bitmap to
a grafport is done while a picture is open, you will get a bitmap in the
picture, and not a pixmap.  Even if this isn't true, its much safer to assume
it is.
--
Matthew T. Russotto	russotto@eng.umd.edu	russotto@wam.umd.edu
][, ][+, ///, ///+, //e, //c, IIGS, //c+ --- Any questions?

mwilkins@jarthur.Claremont.EDU (Mark Wilkins) (06/09/90)

In article <1990Jun8.205052.16133@eng.umd.edu> russotto@eng.umd.edu (Matthew T. Russotto) writes:
>In article <2529@network.ucsd.edu> rmorgan@network.ucsd.edu (Robert Morgan) writes:
>>   IM V page 104 seems to say that the high bit of rowBytes tells you this,
>>   but in the same paragraph they say that "In general, the difference
>>   between version 1 and version 2 formats is that the pixMap replaces
>>   the bitMap..."  So, can I just check the PICT version instead of
>>   the high bit of rowBytes ?
>No, ignore that phrase. I'm pretty sure that if a copybits of a 1-bit bitmap to
>a grafport is done while a picture is open, you will get a bitmap in the
>picture, and not a pixmap.  Even if this isn't true, its much safer to assume
>it is.

  If when the picture is recorded the current port is a CGrafPort, then a
PICT2 with a PixMap will be created, even if it is a one bit deep PixMap.

  If it is an old GrafPort, a PICT v. 1 with a Bitmap will be created.

  Therefore, a PICT2 ALWAYS contains a PixMap, but it may be 1 bit deep.

-- Mark Wilkins
-- 
  "According  to  our  contract, at  precisely  midnight  of  the  night 
  of her greatest triumph,  the party of the first  part,  (that's you), 
  agrees to render up  her soul,  now and  forevermore,  to the party of 
  the second part.  (That's me).  Shall we go?"