Anyone have a RAW loader?

BlitzMax Forums/BlitzMax Programming/Anyone have a RAW loader?

JoshK(Posted 2007) [#1]
LoadPixmapRAW()?

For that matter why isn't there a PF_I16 pixel format?


ImaginaryHuman(Posted 2007) [#2]
Um, open the file, read the data into a pixmap.


xlsior(Posted 2007) [#3]
LoadPixmapRAW()?


Keep in mind that there are many different .raw formats -- they vary between manufacturers and camera models. (Photoshop regularly updates its RAW plugin to support the new flavors)


JoshK(Posted 2007) [#4]
I finally figured out raw is just binary data, unless you have some proprietary camera format, which defeats the purpose of a no-BS data format.

Here's a convenient function with safeguards:
	Function LoadRaw:Int(url:Object,data:Byte Ptr,width,height,bpp)
		Local stream:TStream
		Local size
		stream=ReadStream(url)
		If Not stream Return
		size=width*height*bpp
		If size<>stream.size() Return
		stream.readbytes data,size
		Return 1
	EndFunction



Winni(Posted 2007) [#5]
You could take dcraw and write a BlitzMax wrapper for it. ;-)

http://cybercom.net/~dcoffin/dcraw/