🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.programmer
Article #18

Device independent cached images?

#18
From: Daniel Filiberti
Date: Tue, 27 Oct 1992 21:25
49 lines
2601 bytes
Hi Everybody!

I'm having problems doing the following...

1)  I load a 24-bit TIFF image into an NXImage with the initFromFile: method.   
I assume that this method automagically creates an NXBitmapImageRep for you and  
adds it to the images representation list.

2)  A region is traced in the image via the user interface and stored as a  
postscript user path.

3)  I now want to "etch" out the region traced by the user from the image and  
get at the data.  So, I create another NXImage, lockFocus on it, and use some  
postscript magic to set the clipping path and copy from the original image into  
the new one.  This new image is created with the initSize: method, and so I  
assume that it creates a NXCachedImageRep to hold the image.

4) Finally, I need to get at the bitmap data in the etched image.  One way to  
do this is to use the NXReadBitmap() function to read the image into a chunk of  
memory.

Now, when I do this on our NeXTDimension system, everything works fine.  But,  
if I'm running the application on a monochrome slab, NXSizeBitmap() and  
NXReadBitmap() always treat the image as 2 bps, and 4 spp (RGBA)!  Furthermore,  
even if I try to save out the etched image with writeTIFF:, it gets saved as a  
monochrome TIFF!

So, how do I manage to get at the color bitmap data in this situation?  I've  
tried everything that I can imagine to do this, and nothing seems to work.  The  
debugger shows the cached image rep as being 8 bps and 3 color...so its  
obviously stored as color, why does it always get converted to monochrome?


Any help greatly appreciated!

Daniel

---
************************************************************
Motto for a monitor, "It's better to burn out, than to fade
 away..."  [8?)}
************************************************************
 
Daniel Filiberti
Oregon Health Sciences University
Biomedical Information Communication Center (BICC)
3181 Sam Jackson Park Road
Portland, Oregon  97201-3098
email:  filibert@ohsu.edu
Technical Details
Message-ID: <1992Oct27.212529.12565@ohsu.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!ames!decwrl!usenet.coe.montana.edu!news.u.washington.edu!ogicse!pdxgate!steele!news

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!ames!decwrl!usenet.coe.montana.edu!news.u.washington.edu!ogicse!pdxgate!steele!news
From: filibert@vista (Daniel Filiberti)
Newsgroups: comp.sys.next.programmer
Subject: Device independent cached images?
Keywords: image, color, NXImage, bitmap
Message-ID: <1992Oct27.212529.12565@ohsu.edu>
Date: 27 Oct 92 21:25:29 GMT
Article-I.D.: ohsu.1992Oct27.212529.12565
Sender: news@ohsu.edu
Reply-To: filibert@ohsu.edu
Organization: Oregon Health Sciences University
Lines: 49
Nntp-Posting-Host: vista