OpenColorIO bindings for Go
Go C++ C
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
cpp
testdata/spi-vfx
LICENSE
README.md
all.cpp
colorspace.go
config.go
context.go
ocio.go
ocio_test.go
processor.go

README.md

OpenColorIO bindings for Go

OpenColorIO (OCIO) is a complete color management solution geared towards motion picture production with an emphasis on visual effects and computer animation. OCIO provides a straightforward and consistent user experience across all supporting applications while allowing for sophisticated back-end configuration options suitable for high-end production usage. OCIO is compatible with the Academy Color Encoding Specification (ACES) and is LUT-format agnostic, supporting many popular formats.

OpenColorIO is released as version 1.0 and has been in development since 2003. OCIO represents the culmination of years of production experience earned on such films as SpiderMan 2 (2004), Surf’s Up (2007), Cloudy with a Chance of Meatballs (2009), Alice in Wonderland (2010), and many more. OpenColorIO is natively supported in commercial applications like Katana, Mari, Silhouette FX, and others coming soon.

OpenColorIO is free and is one of several open source projects actively sponsored by Sony Imageworks.

http://opencolorio.org

Requirements

Status

So far only parts of the API have been exposed. Most of the Config API is done, along with the ColorSpace, Context, and color processing via CPU Path.

Installation

go get github.com/justinfx/opencolorigo

Documentation

http://godoc.org/github.com/justinfx/opencolorigo

Example

func Example() {

    // Arbitrary source of image data
    //
    // ColorData is a []float32 containing the pixel values.
    // Could be in various formats:
    //     R,G,B,R,G,B,...     // 3 Channels
    //     R,G,B,A,R,G,B,A,... // 4 Channels
    //
    var imageData ocio.ColorData = getExampleImage()

    // Get the global OpenColorIO config
    // This will auto-initialize (using $OCIO) on first use
    cfg, err := ocio.CurrentConfig()
    if err != nil {
        panic(err.Error()
    }

    // Get the processor corresponding to this transform.
    processor, err := cfg.Processor("linear", "Cineon")
    if err != nil {
        panic(err.Error())
    }

    // Wrap the image in a light-weight ImageDesc,
    // providing the width, height, and number of color channels
    // that imageData represents.
    imgDesc := ocio.NewPackedImageDesc(imageData, 512, 256, 3)

    // Apply the color transformation (in place)
    err = processor.Apply(imgDesc)
    if err != nil {
        panic(err.Error())
    }
}