MCPcopy Create free account
hub / github.com/OSGeo/gdal / GDALGetColorInterpretationByName

Function GDALGetColorInterpretationByName

gcore/gdal_misc.cpp:1433–1454  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1431 */
1432
1433GDALColorInterp GDALGetColorInterpretationByName(const char *pszName)
1434
1435{
1436 VALIDATE_POINTER1(pszName, "GDALGetColorInterpretationByName",
1437 GCI_Undefined);
1438
1439 for (int iType = 0; iType <= GCI_Max; iType++)
1440 {
1441 if (EQUAL(GDALGetColorInterpretationName(
1442 static_cast<GDALColorInterp>(iType)),
1443 pszName))
1444 {
1445 return static_cast<GDALColorInterp>(iType);
1446 }
1447 }
1448
1449 // Accept British English spelling
1450 if (EQUAL(pszName, "grey"))
1451 return GCI_GrayIndex;
1452
1453 return GCI_Undefined;
1454}
1455
1456/************************************************************************/
1457/* GDALGetColorInterpFromSTACCommonName() */

Callers 9

GetColorInterpFunction · 0.85
RunStepMethod · 0.85
RunStepMethod · 0.85
XMLInitMethod · 0.85
OpenMethod · 0.85
OpenOffsetMethod · 0.85
XMLInitMethod · 0.85

Calls 2

EQUALFunction · 0.50

Tested by

no test coverage detected