ocio_profile_version: 1

search_path: luts
strictparsing: true
luma: [0.2126, 0.7152, 0.0722]

description: Default Natron OCIO Configuration

roles:
  reference: Utility - Linear Color
  scene_linear: Linear sRGB / REC.709 D65
  default_byte: sRGB D65
  default_float: Linear sRGB / REC.709 D65
  chromaticity: XYZ D65 Aligned
  color_picking: sRGB Curve
  texture_paint: sRGB Curve

displays:
  sRGB / REC.709 Reference:
    - !<View> {name: sRGB D65 View, colorspace: sRGB D65}
    - !<View> {name: Rec 1886 D65 View, colorspace: Rec 1886 Curve}
    - !<View> {name: Linear sRGB D65 View, colorspace: Utility - Linear Color}
    - !<View> {name: Raw View, colorspace: Utility - Raw Data}

  DCI-P3 Reference:
    - !<View> {name: Apple iMac P3 (2015), colorspace: iMac P3 2015}

active_displays: [sRGB / REC.709 Reference, DCI-P3 Reference]
active_views: [sRGB D65 View, Apple iMac P3 (2015)]

colorspaces:

# Utilities - Utility definitions

  - !<ColorSpace>
    name: Utility - Raw Data
    family: Utilities
    equalitygroup:
    bitdepth: 32f
    isdata: true
    allocation: uniform
    allocationvars: [0, 1]

  - !<ColorSpace>
    name: Utility - Linear Color
    family: Utilities
    equalitygroup:
    bitdepth: 32f
    isdata: false
    allocation: lg2
    allocationvars: [-8, 5, 0.00390625]

# Curves - Transfer curves

  - !<ColorSpace>
    name: sRGB Curve
    family: Curves
    equalitygroup:
    bitdepth: 32f
    description: |
      sRGB transfer curve as outlined in IEC 61966-2-1:1999
    isdata: false
    allocation: uniform
    allocationvars: [0, 1]
    to_reference: !<FileTransform> {src: sRGB_to_linear.spi1d, interpolation: linear}

  - !<ColorSpace>
    name: AdobeRGB Compatible Curve
    family: Curves
    equalitygroup:
    bitdepth: 32f
    description: |
      AdobeRGB compatible transfer curve as outlined in the Adobe RGB 1998 specification
    isdata: false
    allocation: uniform
    allocationvars: [0, 1]
    to_reference: !<FileTransform> {src: AdobeRGB_to_linear.spi1d, interpolation: linear}

  - !<ColorSpace>
    name: Josh Pines Log Curve
    family: Curves
    equalitygroup:
    bitdepth: 32f
    description: |
      Josh Pines log curve as outlined at http://osdir.com/ml/video.openexr.devel/2005-03/msg00006.html
    isdata: false
    allocation: uniform
    allocationvars: [0, 1]
    to_reference: !<FileTransform> {src: JPLog_to_linear.spi1d, interpolation: linear}

  - !<ColorSpace>
    name: Cineon Log Curve
    family: Curves
    equalitygroup:
    bitdepth: 32f
    description: |
      Cineon log curve as outlined at http://www.dotcsw.com/doc/cineon1.pdf
    isdata: false
    allocation: uniform
    allocationvars: [0, 1]
    to_reference: !<FileTransform> {src: CineonLog_to_linear.spi1d, interpolation: linear}

  - !<ColorSpace>
    name: Rec 1886 Curve
    family: Curves
    equalitygroup:
    bitdepth: 32f
    description: |
      Rec 1886 curve as outlined in the ITU-R BT.1886 specification
    isdata: false
    allocation: uniform
    allocationvars: [0, 1]
    to_reference: !<FileTransform> {src: rec1886_to_linear.spi1d, interpolation: linear}

  - !<ColorSpace>
    name: Rec 2020 12 Bit Curve
    family: Curves
    equalitygroup:
    bitdepth: 32f
    description: |
      Rec 2020 12 bit curve as outlined in the ITU-R BT.1120-8 specification
    isdata: false
    allocation: uniform
    allocationvars: [0, 1]
    to_reference: !<FileTransform> {src: rec2020_to_linear.spi1d, interpolation: linear}

  - !<ColorSpace>
    name: Rec 709 Curve
    family: Curves
    equalitygroup:
    bitdepth: 32f
    description: |
      Rec 709 encoding curve as outlined in the ITU-R BT.709-5 specification
    isdata: false
    allocation: uniform
    allocationvars: [0, 1]
    to_reference: !<FileTransform> {src: rec2020_to_linear.spi1d, interpolation: linear}

  - !<ColorSpace>
    name: V-Log Curve
    family: input
    equalitygroup: ""
    bitdepth: 32f
    description: |
      Panasonic V-Log
    isdata: false
    allocation: uniform
    allocationvars: [0, 1]
    to_reference: !<FileTransform> {src: V-Log_to_linear.spi1d, interpolation: linear}

# Spaces - Fully defined spaces for transformations to and from

  - !<ColorSpace>
    name: Linear sRGB / REC.709 D65
    family: Spaces
    equalitygroup:
    bitdepth: 32f
    description: |
      Scene linear reference with sRGB / REC.709 primaries
    isdata: false
    allocation: lg2
    allocationvars: [-8, 5, 0.00390625]

  - !<ColorSpace>
    name: sRGB D65
    family: Spaces
    equalitygroup:
    bitdepth: 32f
    description: |
      D65 sRGB space as outlined in IEC 61966-2-1:1999
    isdata: false
    allocation: lg2
    allocationvars: [-8, 5, 0.00390625]
    to_reference: !<ColorSpaceTransform> {src: sRGB Curve, dst: Linear sRGB / REC.709 D65}

  - !<ColorSpace>
    name: AdobeRGB D65 Compatible Space
    family: Spaces
    equalitygroup:
    bitdepth: 32f
    description: |
      D65 AdobeRGB Compatible space as outlined in AdobeRGB (1998)
    isdata: false
    allocation: lg2
    allocationvars: [-8, 5, 0.00390625]
    to_reference: !<GroupTransform>
      children:
        - !<ColorSpaceTransform> {src: AdobeRGB Compatible Curve, dst: Utility - Linear Color}
        - !<MatrixTransform> {matrix: [0.5767309, 0.1855540, 0.1881852, 0, 0.2973769, 0.6273491, 0.0752741, 0, 0.0270343, 0.0706872, 0.9911085, 0, 0, 0, 0, 1]}
        - !<MatrixTransform> {matrix: [3.2404542, -1.5371385, -0.4985314, 0, -0.9692660,  1.8760108,  0.0415560, 0, 0.0556434, -0.2040259,  1.0572252, 0, 0, 0, 0, 1]}

  - !<ColorSpace>
    name: XYZ D65 Aligned
    family: Spaces
    equalitygroup:
    bitdepth: 32f
    description: |
      XYZ space for D65 aligned imagery
    isdata: false
    allocation: lg2
    allocationvars: [-8, 5, 0.00390625]
    from_reference: !<GroupTransform>
      children:
        - !<MatrixTransform> {matrix: [3.2404542, -1.5371385, -0.4985314, 0, -0.9692660,  1.8760108,  0.0415560, 0, 0.0556434, -0.2040259,  1.0572252, 0, 0, 0, 0, 1], direction: inverse}

# V-Log - V-Gamut from https://gist.github.com/sobotka/83dadc636e03b031bd89b4ebafce5a19
# Reference for the V-Gamut to REC.709 Matrix from 
# http://pro-av.panasonic.net/en/varicam/common/pdf/VARICAM_V-Log_V-Gamut.pdf

#  1.806576 -0.695697 -0.110879
# -0.170090  1.305955 -0.135865
# -0.025206 -0.154468  1.179674

  - !<ColorSpace>
    name: V-Log - V-Gamut
    family: Spaces
    equalitygroup:
    bitdepth: 32f
    description: |
      Panasonic V-Log with V-Gamut
    isdata: false
    allocation: uniform
    allocationvars: [0, 1]
    to_reference: !<GroupTransform>
      children:
        - !<FileTransform> {src: V-Log_to_linear.spi1d, interpolation: linear}
        - !<MatrixTransform> {matrix: [1.806576, -0.695697, -0.110879, 0, -0.170090 , 1.305955, -0.135865, 0, -0.025206, -0.154468, 1.179674, 0, 0, 0, 0, 1]}

# View Specific - Defined unique spaces strictly intended for Views

# This transform desperately needs testing. In theory, an sRGB display rendering out identical content
# should look identical on an Apple P3 display, assuming sRGB display is also D65 white point.
  - !<ColorSpace>
    name: iMac P3 2015
    family: Views
    equalitygroup:
    bitdepth: 32f
    description: |
      D65 adapted Apple iMac P3 (Late 2015) viewing transform
    isdata: false
    allocation: uniform
    allocationvars: [0, 1]
    from_reference: !<GroupTransform>
      children:
        # sRGB / BT.709 RGB to XYZ transform.
        - !<MatrixTransform> {matrix: [0.412391, 0.357584, 0.180481, 0.0, 0.212639, 0.715169, 0.0721923, 0.0, 0.0193308, 0.119195, 0.950532, 0.0, 0.0, 0.0, 0.0, 1.0]}
        # Apple P3 D65 XYZ to RGB. These are adapted values, with a normalized
        # matrix to preserve white point. The source values are derived from the iMac
        # P3 ICC, iMac-A7B96997-A225-ECFB-0501-11A19B2BADCC.icc
        # MD5 b9df39c23521f651665de5668808cf82
        # The values are based off of the hexadecimal calculated decimal converted values,
        # adapted from ICC D50 to D65 via Bradford. The chromaticities used for
        # the conversion are D65 { 0.31270,  0.32900} and D50 { 0.34567, 0.35850 }.
        - !<MatrixTransform> {matrix: [0.523955, 0.238698, 0.187803, 0.0, 0.248265, 0.687397, 0.0643383, 0.0, 0.00146883, 0.0485956, 1.03899, 0.0, 0.0, 0.0, 0.0, 1.0], direction: inverse}
        - !<ColorSpaceTransform> {src: Linear, dst: sRGB EOTF}
