home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / sys / next / programm / 7042 < prev    next >
Encoding:
Text File  |  1992-11-05  |  2.4 KB  |  58 lines

  1. Newsgroups: comp.sys.next.programmer
  2. Path: sparky!uunet!portal!cubism.portal.com!vlahos
  3. From: vlahos@cubism.portal.com (Harry Vlahos)
  4. Subject: Re: Device independent cached images?  (12 bit and 16 bit grayscale images)
  5. Message-ID: <1992Nov4.091820.4269@cubism.portal.com>
  6. Sender: vlahos@cubism.portal.com (Harry Vlahos)
  7. Organization: -Independent NeXT Developer-
  8. References: <5711@rosie.NeXT.COM>
  9. Date: Wed, 4 Nov 1992 09:18:20 GMT
  10. Lines: 46
  11.  
  12. In article <5711@rosie.NeXT.COM> aozer@next.com (Ali Ozer) writes:
  13. > In article <1992Oct27.212529.12565@ohsu.edu> filibert@ohsu.edu writes:
  14. > > ... So, I create another NXImage, lockFocus on it, and use some  
  15. > >postscript magic to set the clipping path and copy from the original image  
  16. into  
  17. > >the new one.  This new image is created with the initSize: method, and so I  
  18. > >assume that it creates a NXCachedImageRep to hold the image. ...
  19. > >Finally, I need to get at the bitmap data in the etched image.  One way to  
  20. > >do this is to use the NXReadBitmap() function to read the image into a chunk  
  21. of  
  22. > >memory. ... when I do this on our NeXTDimension system, everything works  
  23. fine.
  24. > >But, if I'm running the application on a monochrome slab, NXSizeBitmap() and  
  25. > >NXReadBitmap() always treat the image as 2 bps, and 4 spp (RGBA)!
  26. > Hmm. Do you set the depth limit of this second NXImage to 24 bits? If you  
  27. don't,
  28. > then the NXImage you get is the same depth as the default depth of the  
  29. system.
  30. > You should do:
  31. >     NXImage *myImage = [[NXImage alloc] initSize:...];
  32. >     [myImage useCacheWithDepth:NX_TwentyFourBitRGBDepth];
  33. >     if ([myImage lockFocus]) {
  34. >          ... draw the image ...
  35. >          ... now read it back ...
  36. >          [myImage unlockFocus];
  37. >     }
  38. > Also please don't use the NXReadBitmap()/NXSizeBitmap() functions. Use the
  39. > NXBitmapImageRep method initData:fromRect:, which is a lot more efficient,
  40. > especially if you let the NXBitmapImageRep allocate and manage the data.
  41. > You can use the writeTIFF: method to save it out.
  42. > Ali, Ali_Ozer@NeXT.com
  43.  
  44. I think I read somewhere in the 3.0 docs that the NXImage functions
  45. support 12-bit monochrome files now.  I can't seem to locate it again.
  46. Is this true?  How about 16-bit grayscale images.
  47. I have never written an NXCustomImageRep.  Would that be a pretty
  48. easy task to undertake if the support for 12-bit or 16-bit is not there ?
  49.  
  50.  
  51. Harry,  vlahos@cubism.portal.com
  52.  
  53.