Skip to content

Commit

Permalink
Non-basic roles now define IsBasic and IsCore
Browse files Browse the repository at this point in the history
This clarifies the presence of non-basic roles in the config header. They cannot be used in the basic style but are acceptable in the core style.

Also corrected the invocation example in genColour and @file comment in the config header to match the new naming scheme.

Signed-off-by: John-Paul Smith <[email protected]>
  • Loading branch information
john-paulsmith committed Oct 2, 2024
1 parent 36d7e68 commit 7372ac2
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
20 changes: 19 additions & 1 deletion include/ofx-native-v1.5_aces-v1.3_ocio-v2.3.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
extern "C" {
#endif

/** @file ofx-native-v1.5_aces-v1.3_ocio-v2.3.h
/** @file ofxColourspaceList.h
Contains the list of supported colourspaces.
This file was auto-generated by scripts/genColour from ofx-native-v1.5_aces-v1.3_ocio-v2.3.
*/
Expand Down Expand Up @@ -770,46 +770,64 @@ Any scene-referred colourspace with a log transfer function.
Guaranteed to be ACES2065-1.
*/
#define kOfxColourspaceRoleAcesInterchange "aces_interchange"
#define kOfxColourspaceAcesInterchangeIsBasic false
#define kOfxColourspaceAcesInterchangeIsCore true

/** @brief cie_xyz_d65_interchange
CIE XYZ colorimetry with the neutral axis at D65.
*/
#define kOfxColourspaceRoleCieXyzD65Interchange "cie_xyz_d65_interchange"
#define kOfxColourspaceCieXyzD65InterchangeIsBasic false
#define kOfxColourspaceCieXyzD65InterchangeIsCore true

/** @brief color_picking
The colourspace to use for colour pickers, typically a display colourspace.
*/
#define kOfxColourspaceRoleColorPicking "color_picking"
#define kOfxColourspaceColorPickingIsBasic false
#define kOfxColourspaceColorPickingIsCore true

/** @brief color_timing
A colourspace suitable for colour grading, typically a log colourspace.
*/
#define kOfxColourspaceRoleColorTiming "color_timing"
#define kOfxColourspaceColorTimingIsBasic false
#define kOfxColourspaceColorTimingIsCore true

/** @brief compositing_log
Any scene-referred colourspace with a log transfer function.
*/
#define kOfxColourspaceRoleCompositingLog "compositing_log"
#define kOfxColourspaceCompositingLogIsBasic false
#define kOfxColourspaceCompositingLogIsCore true

/** @brief data
Image values should not be treated as colour, e.g. motion vectors or masks. Mapped to the raw colourspace.
*/
#define kOfxColourspaceRoleData "data"
#define kOfxColourspaceDataIsBasic false
#define kOfxColourspaceDataIsCore true

/** @brief matte_paint
A colourspace suitable for matte painting.
*/
#define kOfxColourspaceRoleMattePaint "matte_paint"
#define kOfxColourspaceMattePaintIsBasic false
#define kOfxColourspaceMattePaintIsCore true

/** @brief scene_linear
Any scene-referred linear colourspace.
*/
#define kOfxColourspaceRoleSceneLinear "scene_linear"
#define kOfxColourspaceSceneLinearIsBasic false
#define kOfxColourspaceSceneLinearIsCore true

/** @brief texture_paint
A colourspace suitable for texture painting, typically sRGB.
*/
#define kOfxColourspaceRoleTexturePaint "texture_paint"
#define kOfxColourspaceTexturePaintIsBasic false
#define kOfxColourspaceTexturePaintIsCore true

#ifdef __cplusplus
}
Expand Down
5 changes: 4 additions & 1 deletion scripts/genColour
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

# Extract information from an OCIO config to C header.
# Example invocation:
# OCIO=include/ofx-native-v1.5_aces-v1.3_ocio-v2.3.ocio scripts/genColour > include/ofxColourspaceList.h
# OCIO=include/ofx-native-v1.5_aces-v1.3_ocio-v2.3.ocio scripts/genColour > include/ofx-native-v1.5_aces-v1.3_ocio-v2.3.h

import sys
import PyOpenColorIO as OCIO
Expand Down Expand Up @@ -100,6 +100,9 @@ def print_role(role):
role_name = role[0]
print(f'\n/** @brief {role_name}\n{role_docs[role_name]}\n*/')
print(f'{define_base}Role{camel_name(role_name)} "{role_name}"')
# non-basic roles are included in the core style
print_bool_property(role_name, 'Basic', False)
print_bool_property(role_name, 'Core', True)

def print_string_property(name, propname, value):
print(f'{define_base}{camel_name(name)}{propname} "{value}"')
Expand Down

0 comments on commit 7372ac2

Please sign in to comment.