Comments (7)
Ok, I'll try to prepare a PR.
from tinyexr.
@xelatihy Rather than extending existing legacy LoadEXR/SaveEXR
API, we can propose new simple API based on stb
interface, for example:
exr_load_from_file
exr_load_from_memory
,
exr_load_half_from_memory
(e.g. Load fp16 image as fp16 data)
exr_write_to_memory
,
exr_is_half
(check if images in .exr have all fp16)
...
And example code is something like:
int w, h, c;
if (exr_is_half(exrfile)) {
uint16_t *img = exr_load_half_from_file(exrfile, &w, &h, &c);
} else {
float *img = exr_load_from_file(exrfile, &w, &h, &c);
}
from tinyexr.
This proposal is actually might nicer! And we could deprecate the old ones.
I would love to have both the _from_file
and _from_memory
options.
from tinyexr.
Would be also great to have the stb
requested number of channels on load that is very helpful when putting together apps quickly.
from tinyexr.
You can propose API based on my draft idea and send PR. Contribution is always welcome.
from tinyexr.
I took a look and it is that as simple. The easiest thing to do is to wrap into a coherent API what you have already implemented. But that would have some limitations in the API itself. I guess it may be better than nothing, but still not as nice as one would like.
I might take another look later as I get more time.
from tinyexr.
LoadEXRFromMemory already exists.
Now I've added SaveEXRToMemory
0647fb3 So close the issue.
from tinyexr.
Related Issues (20)
- [Enhancement] Support spectral layout HOT 3
- [Informational] Using TinyEXR with the ZLIB functions from stb_image HOT 3
- heap overflow in tinyexr::DecodePixelData HOT 8
- Heap-buffer-overflow still exists in the rleUncompress HOT 3
- Warnings when compiling with VS2019 and W3 (32 bit) HOT 5
- Windows install HOT 1
- Heap-buffer-overflow exists in the DecompressPiz HOT 2
- Heap-buffer-overflow exists in the DecodePixelData HOT 2
- [TODO] Support nested layer name
- Got "-Wreserved-identifier" compiler warning when compiling with Clang-13.0.1 HOT 4
- Use wuffs for fast & secure ZIP/LZW decoding/encoding HOT 3
- UBSan issue when loading an .exr HOT 2
- compilation error on 1.0.1 with ZFP HOT 2
- "Failed to read attribute" error message on Big Endian platform? HOT 2
- [TODO] Setup Github Actions CI build
- memory error in tinyexr::InitSingleResolutionOffsets HOT 3
- [TODO] [Improve Security] Remove assert HOT 1
- PIZ decompression error with tinyexr 1.0.2 HOT 5
- Three Bugs in tinyexr.h HOT 2
- [TODO] Memory limit feature HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tinyexr.