Skip to content

Commit

Permalink
Merge pull request #3 from austinbhale/patch-1
Browse files Browse the repository at this point in the history
feat: add the `void*` data argument for HDR images
  • Loading branch information
rds1983 committed Feb 13, 2023
2 parents 51cb585 + 8c381af commit 6c99960
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/ImageWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,19 @@ public void WriteTga(byte[] data, int width, int height, ColorComponents compone
}
}

public void WriteHdr(void* data, int width, int height, ColorComponents components, Stream dest)
{
try
{
_stream = dest;
StbImageWrite.stbi_write_hdr_to_func(WriteCallback, null, width, height, (int)components, (float*)data);
}
finally
{
_stream = null;
}
}

public void WriteHdr(byte[] data, int width, int height, ColorComponents components, Stream dest)
{
CheckParams(data, width, height, components);
Expand Down

0 comments on commit 6c99960

Please sign in to comment.