Find a color space where isData is false and it has neither a to_ref or from_ref transform. Currently only selecting scene-referred spaces. Note: this returns the first reference space found, even if it is inactive. Returns empty if none are found.
| 194 | // are found. |
| 195 | // |
| 196 | const char * getRefSpaceName(const ConstConfigRcPtr & cfg) |
| 197 | { |
| 198 | // It's important to support inactive spaces since sometimes the only reference space |
| 199 | // may be inactive, e.g. the display-referred reference in the built-in configs. |
| 200 | int nbCs = cfg->getNumColorSpaces(SEARCH_REFERENCE_SPACE_SCENE, COLORSPACE_ALL); |
| 201 | |
| 202 | for (int i = 0; i < nbCs; i++) |
| 203 | { |
| 204 | const char * csname = cfg->getColorSpaceNameByIndex(SEARCH_REFERENCE_SPACE_SCENE, |
| 205 | COLORSPACE_ALL, |
| 206 | i); |
| 207 | ConstColorSpaceRcPtr cs = cfg->getColorSpace(csname); |
| 208 | |
| 209 | if (cs->isData()) |
| 210 | { |
| 211 | continue; |
| 212 | } |
| 213 | ConstTransformRcPtr t = cs->getTransform(COLORSPACE_DIR_TO_REFERENCE); |
| 214 | if (t != nullptr) |
| 215 | { |
| 216 | continue; |
| 217 | } |
| 218 | t = cs->getTransform(COLORSPACE_DIR_FROM_REFERENCE); |
| 219 | if (t != nullptr) |
| 220 | { |
| 221 | continue; |
| 222 | } |
| 223 | |
| 224 | return csname; |
| 225 | } |
| 226 | return ""; |
| 227 | } |
| 228 | |
| 229 | // Find the first scene-referred color space with isdata: true. |
| 230 | // |
no test coverage detected