fast conversion of a text file to arrays C++ -
i've been working on project involves large heightmaps (3000x3000 ~60mb). . need split data several 200x200 arrays (15x15 of them), save them separately (but time in format fast possible load again). i've tried using streams (i'm not @ c++ don't exclude ideas streams) it's agonizingly slow.
stuff might (based on i've seen while searching answer): heightmaps supplied text files (.asc) numbers written "125.123" without "". each entry has 3 decimals no matter number ("0.123" , "100.123").as far know there no negative numbers , size of heightmap known beforehand (usually 3000x3000).
so questions essentially:
- whats best way this? (preferably without boost or such if helps lot why not)
- what format (for 200x200 arrays) allow fastest loading time?
any help, ideas, code or links/litterature?
part 2
if reading file onto same type of system (endianness) use binary blittable format. ie store straight binary dump of 200 * 200 array. multiply 1000 , store ints since typically faster (you did not mention range of values, nor required precision, units feet, miles, nanometers?)
Comments
Post a Comment