AcademySoftwareFoundation / AcademySoftwareFoundation/OpenImageIO
[FEATURE REQUEST] Access binary data of file without decoding
- Dominant language
- C++
- Stars
- 2.4k
- Forks
- 698
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 48
Description
`std::vector pixels (xres*yres*channels);`
`in->read_image (TypeDesc::UINT8, &pixels[0]);`
`in->close ();`
The basic example for reading or writing a file using oiio offers a read or write method that returns the decoded binary image. For certain image processing, it may be necessary to access the encoded binary data inside the jpeg or png.
A read_binary() and write_binary() method can be offered that will extract just the binary data in a buffer and write it back. Of course, the size of the binary buffer using read_binary() and write_binary() must be exactly the same.
It will be easy to do this within oiio as the library already is aware of the header and data sections due to the read and write functionality.
Alternatively, a data_offset() method can return the number of bytes in the header. And the user can modify the binary data on their own. Combined with the ability to write jpeg to memory, this will be quite useful.
Contributor guide
Research direction
Start by reviewing the existing read/write API and the JPEG/PNG memory-writing path referenced in the issue. Clarify whether the goal is encoded payload access or a header offset, then define the API and matching tests for the affected formats; no implementation files or tests are named.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-graphics
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100