home *** CD-ROM | disk | FTP | other *** search
- 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
- From: krk@oit.itd.umich.edu (Kenneth Knight)
- Newsgroups: comp.sys.mac.programmer
- Subject: Re: Reading in jpeg compressed PICT files
- Message-ID: <1e0t96INN7ac@terminator.rs.itd.umich.edu>
- Date: 13 Nov 92 18:48:06 GMT
- References: <1992Nov12.192450.17388@husc3.harvard.edu>
- Organization: Instructional Technology Laboratory, University of Michigan
- Lines: 36
- NNTP-Posting-Host: helen.oit.itd.umich.edu
-
- In article <1992Nov12.192450.17388@husc3.harvard.edu> crevier@husc8.harvard.edu (Daniel Crevier) writes:
- >
- > I am trying to convert some PICT files that were captured with the
- >video spigot into a format called FITS so that I can use them with a program
- >called macvista. My problem is in loading the pict files. My plan was to
- >create a gworld, and then open the PICT files using the source from tech note
- >152, and then draw it in the gworld, and then go through it with GetCPixel, and
- >convert it. I can't get it working... I tried just loading a picture into
- >a CWindow using the source from tech note 152, and it crashes when doing the
- >DrawPicture call. Will this not work with JPEG pictures for some reason? I
- >can send source if needed. Any help, or pointers to source to load pictures
- >would be appreciated.
-
- I'm not sure this will answer your question,but here goes. You will have to
- work with QuickTime. Full documentation on QuickTime is at ftp.apple.com and
- you will want to focus on the Image Compression chapter. In brief, you will
- need to do the following things:
-
- 1. Load your picture dat into a pointer of the proper size.
- 2. You need to create an ImageDescriptionRecord (actually a handle
- of type ImageDescriptionHandle) and fill it appropriately. Probably the
- easiest way to figure out just what to fill it with would be to run
- one of the sample compression program (again all this is at ftp.apple.com)
- and see what such a record look like when decompressing a JPEG file. You'll
- want to skim the docs here to decide which codec is best for you (i.e.,
- best performance over bestspeed or best-for-the-machine).
- 3. Once all this is done create a GWorld of the proper size and depth.
- 4. Use the DecompressImage function:
- FUNCTION DecompressImage (data: Ptr; desc: ImageDescriptionHandle; dst: PixMapHandle; srcRect: Rect; dstRect: Rect; mode: Integer; mask: RgnHandle): OSErr;
-
- You'll need to imclude various .h files including codec.h compression.h,
- imagedescription.h (I think those names are right).
-
- Good luck.
-
- ** Ken **
-