Skip to content

QuentinTessier/zHDR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zHDR

Import .hdr file in zig

For large files, you should prioritize loading the all file in memory and using zHDR.parseFromMemory has it is much faster than other options. zHDR.parseFromFile can take up to 2 minutes to parse a 8k image.

const allocator = some_allocator;

// For small file
var img = zHDR.parseFromFilePath(allocator, "./file.hdr");
defer zHDR.releaseImage(allocator, &img);

// For larger files
var file = try std.fs.cwd().openFile("./file.hdr", .{});
defer file.close();

const endPos = try file.getEndPos();
const content = try file.readToEndAlloc(allocator, endPos);
defer allocator.free(content);

var img = zHDR.parseFromMemory(allocator, content);
defer zHDR.releaseImage(allocator, &img);

About

Import .hdr file in zig

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages