FFmpeg
ocio_wrapper.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2026 Sam Richards
3  *
4  * This file is part of FFmpeg.
5  *
6  * FFmpeg is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * FFmpeg is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with FFmpeg; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #pragma once
22 #include <stdint.h>
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 typedef void *OCIOHandle;
29 
30 // Create an OCIO processor for Display/View transform.
31 // Returns NULL on failure.
33  const char *config_path,
34  const char *input_color_space,
35  const char *display,
36  const char *view, int inverse,
37  AVDictionary *params);
38 
39 // Create an OCIO processor for output colorspace transform.
40 // Returns NULL on failure.
43  const char *config_path,
44  const char *input_color_space,
45  const char *output_color_space,
46  AVDictionary *params);
47 
48 // Create an OCIO processor for file transform.
49 // Returns NULL on failure.
51  const char *file_transform,
52  int inverse);
53 
54 // Finalize OCIO processor for given bit depth.
55 // is_half_float: true for half-float, false for float
56 int ocio_finalize_processor(AVFilterContext *ctx, OCIOHandle handle, int input_format,
57  int output_format);
58 
59 // Apply processor to planar float RGB(A).
60 // pixels: pointer to float samples
61 // w,h: image dimensions
62 // channels: 3 or 4
63 // stride_bytes: bytes between row starts (use 0 for tightly packed)
65  int y_start, int height);
66 
67 // Destroy OCIO processor.
69 
70 #ifdef __cplusplus
71 }
72 #endif
inverse
inverse
Definition: af_crystalizer.c:122
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:427
AVDictionary
Definition: dict.c:32
ocio_destroy_processor
void ocio_destroy_processor(AVFilterContext *ctx, OCIOHandle handle)
Definition: ocio_wrapper.cpp:309
ocio_finalize_processor
int ocio_finalize_processor(AVFilterContext *ctx, OCIOHandle handle, int input_format, int output_format)
Definition: ocio_wrapper.cpp:214
ctx
static AVFormatContext * ctx
Definition: movenc.c:49
ocio_create_output_colorspace_processor
OCIOHandle ocio_create_output_colorspace_processor(AVFilterContext *ctx, const char *config_path, const char *input_color_space, const char *output_color_space, AVDictionary *params)
Definition: ocio_wrapper.cpp:99
height
#define height
Definition: dsp.h:89
output_frame
static int output_frame(H264Context *h, AVFrame *dst, H264Picture *srcp)
Definition: h264dec.c:861
ocio_create_file_transform_processor
OCIOHandle ocio_create_file_transform_processor(AVFilterContext *ctx, const char *file_transform, int inverse)
Definition: ocio_wrapper.cpp:183
output_format
static char * output_format
Definition: ffprobe.c:144
AVFilterContext
An instance of a filter.
Definition: avfilter.h:274
OCIOHandle
void * OCIOHandle
Definition: ocio_wrapper.hpp:28
ocio_create_display_view_processor
OCIOHandle ocio_create_display_view_processor(AVFilterContext *ctx, const char *config_path, const char *input_color_space, const char *display, const char *view, int inverse, AVDictionary *params)
Definition: ocio_wrapper.cpp:137
ocio_apply
int ocio_apply(AVFilterContext *ctx, OCIOHandle handle, AVFrame *input_frame, AVFrame *output_frame, int y_start, int height)
Definition: ocio_wrapper.cpp:275