Anyone have a RAW loader?

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

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