Giter Club home page Giter Club logo

Comments (7)

xelatihy avatar xelatihy commented on August 12, 2024 1

Ok, I'll try to prepare a PR.

from tinyexr.

syoyo avatar syoyo commented on August 12, 2024

@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.

xelatihy avatar xelatihy commented on August 12, 2024

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.

xelatihy avatar xelatihy commented on August 12, 2024

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.

syoyo avatar syoyo commented on August 12, 2024

You can propose API based on my draft idea and send PR. Contribution is always welcome.

from tinyexr.

xelatihy avatar xelatihy commented on August 12, 2024

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.

syoyo avatar syoyo commented on August 12, 2024

LoadEXRFromMemory already exists.

Now I've added SaveEXRToMemory 0647fb3 So close the issue.

from tinyexr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.