[comp.graphics] 24-bit Sun rasterfiles needed

thor@csd.uwo.ca (Jim Thorsley) (01/26/91)

I need to get some 24-bit Sun rasterfiles for testing purposes. Could
someone tell me of an anonymous ftp site where I could get some?
Also, if anyone knows the format of these file I would like to know that
too. I know the format of 8-bit files but can't find any info on 24-bit.

Thanks muchly in advance.

falk@peregrine.Sun.COM (Ed Falk) (01/28/91)

In article <1991Jan25.145603@csd.uwo.ca> thor@csd.uwo.ca (Jim Thorsley) writes:
>I need to get some 24-bit Sun rasterfiles for testing purposes. Could
>someone tell me of an anonymous ftp site where I could get some?
>Also, if anyone knows the format of these file I would like to know that
>too. I know the format of 8-bit files but can't find any info on 24-bit.

Well, in a nut-shell, a 24-bit raster file looks like (see <rasterfile.h>)

    header:
	ras_magic = RAS_MAGIC (0x59a66a95)
	ras_width = width of your image
	ras_height = height of your image
	ras_depth = 24
	ras_length = (width*3, rounded even) * height
	ras_type = RT_STANDARD (1) for BGR byte-ordering, or
		   RT_FORMAT_RGB (3) for RGB byte-ordering.
	ras_maptype = RMT_NONE
	ras_maplength = 0

    data: 'height' rows of 'width' pixels of 3 bytes each.  Byte order
	is either RGB (format RT_FORMAT_RGB) or BGR (format RT_STANDARD)

	Each row is padded to an even number of bytes, if need be.


Normally, if you use pr_load() to load a rasterfile, and it sees
a format other than RT_STANDARD or RT_BYTE_ENCODED, it invokes one
of the filters in /usr/lib/rasfilters to convert.

		-ed falk, sun microsystems
		 sun!falk, falk@sun.com
To be loyal to rags, to shout for rags, to worship rags, to die for rags 
-- that is a loyalty of unreason, it is pure animal (Mark Twain).