Skip to content

[FEATURE REQUEST] Need expanded queries about formats #4853

@lgritz

Description

@lgritz

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    core APIsAffecting public APIs of core functionality classes, such as ImageInput, ImageOutput, ImageBuf.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions