Adding multiple bit depths to one <!ColorSpace>


Malcolm Humphreys <malcolmh...@...>
 

After playing around with ocio profiles a bit more, I think it would be and idea to have multiple bitdepths defined in one <!ColorSpace> definition.

Below is the vd and nc family colorspaces from the spi-vfx profile. This kind of replaces the family concept, as it seems in all the spi examples that families and names are the way to group color spaces of similar purpose but of different bit-depths.

I'm thinking it feels a bit nicer for a host app to request a named colorspace at a default depth, or request it at a specific depth. I can see that we could get a list of color spaces and do this in a host app but this seems like it should be done by ocio.

ie. the displays would look more like this:

displays:
- !<Display> {device: sRGB, name: Film, colorspace: srgb, bitdepth: 8ui}
- !<Display> {device: sRGB, name: Log, colorspace: lg, bitdepth: 10ui}
- !<Display> {device: DCIP3, name: Film, colorspace: p3dci, bitdepth: 16ui}

Is there a case for two colorspaces in the same family to have the same bitdepth? I would think that would be confusing.

eg. this would make the spi-vfx profile have 11 colorspaces rather than 26, this also helped me spot some possible typos.
--snip--
- !<ColorSpace>
name: ln
isdata: false
gpuallocation: lg2
gpumin: -15
gpumax: 6
bitdepth: 32f
bitdepths:
32f: !<ColorSpaceDetail>
16f: !<ColorSpaceDetail>
16ui: !<ColorSpaceDetail>
gpumax: 0 # typo in the vfx profile?

- !<ColorSpace>
name: lg
isdata: false
gpuallocation: uniform
gpumin: 0
gpumax: 1
bitdepth: 10ui
bitdepths:
16ui: !<ColorSpaceDetail>
to_reference: !<FileTransform> {src: lg16.spi1d, interpolation: nearest}
10ui: !<ColorSpaceDetail>
to_reference: !<FileTransform> {src: lg10.spi1d, interpolation: nearest}
8ui: !<ColorSpaceDetail>
to_reference: !<FileTransform> {src: lg10.spi1d, interpolation: nearest}
32f: !<ColorSpaceDetail>
gpumin: -0.25
gpumax: 1.5
to_reference: !<FileTransform> {src: lgf.spi1d, interpolation: linear}

- !<ColorSpace>
name: gn
isdata: false
gpuallocation: uniform
gpumin: 0
gpumax: 1
bitdepth: 16ui
bitdepths:
16ui: !<ColorSpaceDetail>
to_reference: !<FileTransform> {src: gn16.spi1d, interpolation: nearest}
10ui: !<ColorSpaceDetail>
to_reference: !<FileTransform> {src: gn16.spi1d, interpolation: nearest}
8ui: !<ColorSpaceDetail>
to_reference: !<FileTransform> {src: gn16.spi1d, interpolation: nearest}
32f: !<ColorSpaceDetail>
gpumin: -0.25
gpumax: 1.5
to_reference: !<FileTransform> {src: gnf.spi1d, interpolation: linear}

- !<ColorSpace>
name: vd
isdata: false # can override these in each bitdepth if needed
gpuallocation: uniform
gpumin: 0
gpumax: 1
bitdepth: 8ui
bitdepths:
16ui: !<ColorSpaceDetail>
to_reference: !<GroupTransform>
children:
- !<FileTransform> {src: version_8_whitebalanced.spimtx, interpolation: unknown, direction: inverse}
- !<FileTransform> {src: vd16.spi1d, interpolation: nearest}
8ui: !<ColorSpaceDetail>
to_reference: !<GroupTransform>
children:
- !<FileTransform> {src: version_8_whitebalanced.spimtx, interpolation: unknown, direction: inverse}
- !<FileTransform> {src: vd16.spi1d, interpolation: nearest}
10ui:
to_reference: !<GroupTransform>
children:
- !<FileTransform> {src: version_8_whitebalanced.spimtx, interpolation: unknown, direction: inverse}
- !<FileTransform> {src: vd16.spi1d, interpolation: nearest}
32f:
to_reference: !<GroupTransform>
children:
- !<ColorSpaceTransform> {src: vd, src-depth: 16, dst: ln, dst-depth: 32f}

- !<ColorSpace>
name: hd
isdata: false
gpuallocation: uniform
gpumin: 0
gpumax: 1
bitdepth: 10ui
bitdepths:
10ui: !<ColorSpaceDetail>
to_reference: !<GroupTransform>
children:
- !<FileTransform> {src: hdOffset.spimtx, interpolation: nearest, direction: inverse}
- !<ColorSpaceTransform> {src: vd, src-depth: 32f, dst: ln, dst-depth: 32f}

- !<ColorSpace>
name: dt
isdata: false
gpuallocation: uniform
gpumin: 0
gpumax: 1
bitdepth: 8ui
bitdepths:
8ui: !<ColorSpaceDetail>
to_reference: !<GroupTransform>
children:
- !<FileTransform> {src: diffuseTextureMultiplier.spimtx, interpolation: nearest}
- !<ColorSpaceTransform> {src: vdf, src-depth: 32f, dst: ln, dst-depth: 32f}
16ui: !<ColorSpaceDetail>
to_reference: !<GroupTransform>
children:
- !<FileTransform> {src: diffuseTextureMultiplier.spimtx, interpolation: nearest}
- !<ColorSpaceTransform> {src: vdf, src-depth: 32f, dst: ln, dst-depth: 32f}

- !<ColorSpace>
name: cp
isdata: false
gpuallocation: uniform
gpumin: 0
gpumax: 1
bitdepth: 32f
bitdepths:
32f: !<ColorSpaceDetail>
to_reference: !<GroupTransform>
children:
- !<FileTransform> {src: cpf.spi1d, interpolation: linear}

- !<ColorSpace>
name: nc
isdata: true
gpuallocation: uniform
gpumin: 0
gpumax: 1
bitdepths:
8ui: <!ColorSpaceDetail>
10ui: <!ColorSpaceDetail>
16ui: <!ColorSpaceDetail>
isdata: false # vfx profile typo?
32f: <!ColorSpaceDetail>

- !<ColorSpace>
name: srgb
isdata: false
gpuallocation: uniform
gpumin: 0
gpumax: 1
bitdepth: 8ui
bitdepths:
8ui: !<ColorSpaceDetail>
from_reference: !<GroupTransform>
children:
- !<ColorSpaceTransform> {src: ln, src-depth: 32f, dst: lg, dst-depth: 32f}
- !<FileTransform> {src: spi_ocio_srgb_test.spi3d, interpolation: linear}

- !<ColorSpace>
name: p3dci
isdata: false
gpuallocation: uniform
gpumin: 0
gpumax: 1
bitdepth: 16ui
bitdepths:
16ui: !<ColorSpaceDetail>
from_reference: !<GroupTransform>
children:
- !<ColorSpaceTransform> {src: ln, src-depth: 32f, dst: lg, dst-depth: 10ui}
- !<FileTransform> {src: colorworks_filmlg_to_p3.3dl, interpolation: linear}

- !<ColorSpace>
name: xyz
isdata: false
gpuallocation: uniform
gpumin: 0
gpumax: 1
bitdepth: 16ui
bitdepths:
16ui: !<ColorSpaceDetail>
from_reference: !<GroupTransform>
children:
- !<ColorSpaceTransform> {src: lnf, dst: p3dci8}
- !<ExponentTransform> {value: [2.6, 2.6, 2.6, 1]}
- !<FileTransform> {src: p3_to_xyz16.spimtx, interpolation: unknown}
- !<ExponentTransform> {value: [2.6, 2.6, 2.6, 1], direction: inverse}
--snip--

.malcolm

Join ocio-dev@lists.aswf.io to automatically receive all group messages.