-
Notifications
You must be signed in to change notification settings - Fork 644
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.