AcademySoftwareFoundation / AcademySoftwareFoundation/OpenImageIO
[FEATURE REQUEST] Need expanded queries about formats
- Dominant language
- C++
- Stars
- 2.4k
- Forks
- 698
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 47
Description
Since the very earliest days of OIIO, the ImageInput and ImageOutput classes have had `supports()` methods that let you test whether the reader or writer has a particular capability. For example,
```
if (imageoutput->supports("tiles")) {
// we know the format writer supports tiles
} else {
// only scanline output is supported
}
```
The list of tokens denoting capabilities has expanded over the years, but we still just return a bool: it supports the feature or it doesn't.
A concrete example where this is inadequate is if an app wants to know the list of compression methods available for a certain format. Here, an array of strings (or maybe one string that is a comma-separated list) would be much better. There's not much we can do with a bool here.
Anyway, I don't yet have a specific solution to propose. But maybe we can use this issue to discuss or have people propose a solution? What we want is something akin to supports(), but capable of more general queries about formats and their features, supporting arbitrary data types (with shades of getattribute, perhaps). And maybe it would be useful to be able to ask about formats by name, without already needing to hold a created instance of a reader/writer?
Suggestions welcome.
Contributor guide
Research direction
Start by reading the ImageInput and ImageOutput supports() methods and compare their capability tokens with the existing getattribute approach. Review the discussion before proposing a general query API that can return values such as compression-method lists and support queries by format name; done requires an agreed design, not just a boolean extension.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- api, computer-graphics
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100