Glad that worked. You should be OK reading the header as binary data, though.
All the programs that write headers use binary mode, so you just get back what
was put in. You don't actually want to do line-end conversion for Radiance
headers.
Cheers,
-Greg
> From: Nathaniel Jones
Randolph's solution worked here. The tricky part was to be reading the file
header as strings and then the binary data from the same stream. I ended up
creating a BinaryReader when a format other than ascii is specified and
initializing it with the BaseStream from my StreamReader so as not to have
Nathaniel, the ReadSingle() or ReadDouble() methods of the System.IO
BinaryReader class may do your job. Give those a try. If they don't work,
try ReadBytes() in conjunction with those BitConverter methods you've been
working with. Key, though: you probably want to be using BinaryReader.
--
Hi Nathaniel,
The binary output of dctimestep is just a dump of float (or double) values in
memory, and can be read into a float (or double) array using fread(), or the
Radiance equivalent, getbinary().
I don't know what System.Text.Encoding.ASCII.GetBytes() does, but it's probably
the wrong
Hi all,
I'm trying to read the binary output from dctimestep run with the -od
argument. The idea is that the binary files appear to be a lot faster to
save and load than text. However, I'm having a problem reading the binary
values.
Values less than 512 read in just fine. However, binary values