home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / sys / mac / programm / 18375 < prev    next >
Encoding:
Internet Message Format  |  1992-11-14  |  2.6 KB

  1. Path: sparky!uunet!know!hri.com!noc.near.net!news.Brown.EDU!qt.cs.utexas.edu!yale.edu!jvnc.net!darwin.sura.net!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!destroyer!news.itd.umich.edu!krk
  2. From: krk@oit.itd.umich.edu (Kenneth Knight)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Re: Reading in jpeg compressed PICT files
  5. Message-ID: <1e0t96INN7ac@terminator.rs.itd.umich.edu>
  6. Date: 13 Nov 92 18:48:06 GMT
  7. References: <1992Nov12.192450.17388@husc3.harvard.edu>
  8. Organization: Instructional Technology Laboratory, University of Michigan
  9. Lines: 36
  10. NNTP-Posting-Host: helen.oit.itd.umich.edu
  11.  
  12. In article <1992Nov12.192450.17388@husc3.harvard.edu> crevier@husc8.harvard.edu (Daniel Crevier) writes:
  13. >
  14. >    I am trying to convert some PICT files that were captured with the
  15. >video spigot into a format called FITS so that I can use them with a program
  16. >called macvista.  My problem is in loading the pict files.  My plan was to
  17. >create a gworld, and then open the PICT files using the source from tech note
  18. >152, and then draw it in the gworld, and then go through it with GetCPixel, and
  19. >convert it.  I can't get it working...  I tried just loading a picture into 
  20. >a CWindow using the source from tech note 152, and it crashes when doing the
  21. >DrawPicture call.  Will this not work with JPEG pictures for some reason?  I 
  22. >can send source if needed.  Any help, or pointers to source to load pictures
  23. >would be appreciated.
  24.  
  25. I'm not sure this will answer your question,but here goes. You will have to
  26. work with QuickTime. Full documentation on QuickTime is at ftp.apple.com and
  27. you will want to focus on the Image Compression chapter. In brief, you will
  28. need to do the following things:
  29.  
  30. 1. Load your picture dat into a pointer of the proper size.
  31. 2. You need to create an ImageDescriptionRecord (actually a handle
  32.    of type ImageDescriptionHandle) and fill it appropriately. Probably the
  33.    easiest way to figure out just what to fill it with would be to run
  34.    one of the sample compression program (again all this is at ftp.apple.com)
  35.    and see what such a record look like when decompressing a JPEG file. You'll
  36.    want to skim the docs here to decide which codec is best for you (i.e., 
  37.     best performance over bestspeed or best-for-the-machine).
  38. 3. Once all this is done create a GWorld of the proper size and depth.
  39. 4. Use the DecompressImage function:
  40. FUNCTION DecompressImage (data: Ptr; desc: ImageDescriptionHandle; dst: PixMapHandle; srcRect: Rect; dstRect: Rect; mode: Integer; mask: RgnHandle): OSErr;
  41.  
  42. You'll need to imclude various .h files including codec.h compression.h,
  43. imagedescription.h (I think those names are right).
  44.  
  45. Good luck.
  46.  
  47.   ** Ken **
  48.