🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Device independent cached images? (12 bit and 16 bit grayscale images)

#1289
From: Harry Vlahos
Date: Wed, 04 Nov 1992 09:18
45 lines
2480 bytes
In article <5711@rosie.NeXT.COM> aozer@next.com (Ali Ozer) writes:
> In article <1992Oct27.212529.12565@ohsu.edu> filibert@ohsu.edu writes:
> > ... 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. ...
> >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. ... 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)!
> 
> Hmm. Do you set the depth limit of this second NXImage to 24 bits? If you  
don't,
> then the NXImage you get is the same depth as the default depth of the  
system.
> You should do:
> 
>     NXImage *myImage = [[NXImage alloc] initSize:...];
>     [myImage useCacheWithDepth:NX_TwentyFourBitRGBDepth];
>     if ([myImage lockFocus]) {
>          ... draw the image ...
>          ... now read it back ...
>          [myImage unlockFocus];
>     }
> 
> Also please don't use the NXReadBitmap()/NXSizeBitmap() functions. Use the
> NXBitmapImageRep method initData:fromRect:, which is a lot more efficient,
> especially if you let the NXBitmapImageRep allocate and manage the data.
> You can use the writeTIFF: method to save it out.
> 
> Ali, Ali_Ozer@NeXT.com
> 

I think I read somewhere in the 3.0 docs that the NXImage functions
support 12-bit monochrome files now.  I can't seem to locate it again.
Is this true?  How about 16-bit grayscale images.
I have never written an NXCustomImageRep.  Would that be a pretty
easy task to undertake if the support for 12-bit or 16-bit is not there ?


Harry,  vlahos@cubism.portal.com
Technical Details
Message-ID: <1992Nov4.091820.4269@cubism.portal.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!portal!cubism.portal.com!vlahos
References: <5711@rosie.NeXT.COM>

Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.next.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!portal!cubism.portal.com!vlahos
From: vlahos@cubism.portal.com (Harry Vlahos)
Subject: Re: Device independent cached images?  (12 bit and 16 bit grayscale images)
Message-ID: <1992Nov4.091820.4269@cubism.portal.com>
Sender: vlahos@cubism.portal.com (Harry Vlahos)
Organization: -Independent NeXT Developer-
References: <5711@rosie.NeXT.COM>
Date: Wed, 4 Nov 1992 09:18:20 GMT
Lines: 46