Skip to main content

Crate ocio

Crate ocio 

Source
Expand description

§ocio

A pure Rust port of OpenColorIO, the color management framework for visual effects and animation.

use ocio::Config;

let config = Config::create_from_file("config.ocio").unwrap();
let processor = config.get_processor("ACEScg", "sRGB - Display").unwrap();
let cpu = processor.default_cpu_processor();
let mut pixel = [0.18f32, 0.18, 0.18];
cpu.apply_rgb(&mut pixel);

Re-exports§

pub use baker::Baker;
pub use config::Config;
pub use context::Context;
pub use dynamic_property::DynamicProperty;
pub use dynamic_property::SharedValue;
pub use error::Error;
pub use error::Result;
pub use format_metadata::FormatMetadata;
pub use image_desc::ImageData;
pub use image_desc::ImageDesc;
pub use image_desc::PackedImageDesc;
pub use image_desc::PlanarImageDesc;
pub use processor::CpuProcessor;
pub use processor::Processor;
pub use processor::ProcessorMetadata;
pub use transforms::grading::*;
pub use transforms::*;
pub use types::*;

Modules§

apphelpers
Application helpers (port of OpenColorAppHelpers.h and src/OpenColorIO/apphelpers): color space menus, (display, view) helpers, the legacy viewing pipeline, color mixing helpers and config merging.
baker
LUT baking (port of Baker.cpp and BakingUtils.cpp).
builtins
Builtin transforms (ACES, camera log curves, display curves) and builtin configs (port of transforms/builtins/*, transforms/BuiltinTransform.cpp and builtinconfigs/*).
config
The configuration: color spaces, roles, displays / views, looks, view transforms, named transforms, file and viewing rules (port of Config.cpp and of the config objects of OpenColorIO.h).
context
Context: search paths, working directory and context (environment) variables used to resolve file references (port of Context.cpp and ContextVariableUtils.cpp).
dynamic_property
Dynamic properties: values of a processor that can be changed after the processor is created (exposure, contrast, gamma, grading values).
error
Error types.
fileformats
LUT / transform file formats (port of FileTransform.h registry and the fileformats/ directory).
format_metadata
Rich metadata attached to transforms (port of FormatMetadata).
gpu
GPU shader generation (port of GpuShaderDesc.cpp, GpuShader.cpp, GPUProcessor.cpp, GpuShaderUtils.cpp, GpuShaderClassWrapper.cpp and the *OpGPU.cpp renderers).
hash_utils
Cache identifier hashes (port of HashUtils.cpp): XXH3 128-bit hashes formatted as OCIO does.
image_desc
Image descriptions used by CpuProcessor::apply (port of ImageDesc).
math_utils
Math helpers (port of the parts of MathUtils.cpp shared across modules).
ops
Ops: the internal, CPU-evaluable building blocks a processor is made of (port of Op.h / OpData / the *OpCPU renderers).
path_utils
Path helpers mirroring the pystring::os::path functions used by OCIO.
processor
Processors: an optimized list of ops ready to be applied to pixels (port of Processor.cpp, CPUProcessor.cpp and OpOptimizers.cpp).
transforms
Transforms: the user-facing descriptions of color operations (port of OpenColorTransforms.h).
types
Core enumerations, string conversions and constants (port of OpenColorTypes.h and the string helpers of ParseUtils.cpp).

Macros§

bail
Early-return with an Error::Exception built from a format string.
nl
Build one shader line from its parts and add it to a GpuShaderText (port of OCIO’s GpuShaderText::newLine() << ...).

Constants§

OCIO_VERSION
Library version: the latest OCIO release fully covered by this port (see UPSTREAM.md).
VERSION
Version of this crate.

Functions§

clear_all_caches
Clear all the caches of the library (port of ClearAllCaches): the file transform cache (files are read again on the next use).