🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

NXImage - problem forcing image depth (2.x)

#1360
From: Detlev Droege
Date: Fri, 09 Oct 1992 13:28
44 lines
2383 bytes
One of our students has following problem. He's not reachable by mail,
I'll forward any answers to him.	- Detlev

I'm writing a program to convert 24-bit-color images (color reduction).
Therefore I need to load the image with its full color. Because these images
are large I've compressed them with "compress"; to load them I'm setting up a
pipe to "zcat" and decompress them into a stream. From this stream I
instantiate an new NXImage with following piece of code:
	--- generate 'userStream'
	localImage = [NXImage alloc];
		// some flags to force loading 24-bit rgb-images
	[localImage setDataRetained:YES];
	[localImage setCacheDepthBounded:NO];
	[localImage setColorMatchPreferred:NO];
	[localImage setScalable:YES];
	[localImage setMatchedOnMultipleResolution:NO];
	[localImage initFromStream:userStream];
	--- close and remove 'userStream'

This loading works fine on all devices (NeXT-Colorstation, NeXT-Dimension and
NeXTstation); the imageRep (NXCachedImageRep) contains all informations from
the compressed image. BUT...:

When _not_ working on a NeXT-Dimension, the first time I use the image (e.g.
composite it into a view) the informations of the imagerep will change to the
depth of the framebuffer; no _new_ representation will be generated, but the
original will change.
This only happens with compressed TIFF-files. If I'll map a stream on a
(uncompressed) TIFF-image and perform this code, the representation does not
change.

Now my question:
How can I force the Image not to change the imagerep?
	or
How to load an image from a stream and use it without loosing informations?

Thanks in advance
	Roger Craemer

--
Detlev Droege                          | droege@infko.uni-koblenz.de
Universitaet Koblenz,                  |       (NeXTmail ok)
Institut fuer Informatik               | Voice: +49 261 9119-421
Rheinau 3-4, D-5400 Koblenz, Germany   | Fax:   +49 261 9119-499
Technical Details
Message-ID: <1992Oct09.132830.14359@infko.uucp>
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!Germany.EU.net!infko!news

Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.next.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!Germany.EU.net!infko!news
From: droege@infko.uni-koblenz.de (Detlev Droege)
Subject: NXImage - problem forcing image depth (2.x)
Message-ID: <1992Oct09.132830.14359@infko.uucp>
Sender: news@infko.uucp (that is the account for news)
Nntp-Posting-Host: nelson.uni-koblenz.de
Organization: Universitaet Koblenz (FB Informatik)
Date: Fri, 09 Oct 1992 13:28:30 GMT
Lines: 44