avutil/csp: create public API for colorspace structs

This commit moves some of the functionality from avfilter/colorspace
into avutil/csp and exposes it as a public API so it can be used by
libavcodec and/or libavformat. It also converts those structs from
double values to AVRational to make regression testing easier and
more consistent.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
This commit is contained in:
Leo Izen
2022-05-28 09:30:36 -04:00
committed by Ronald S. Bultje
parent 77b529fbd2
commit d42b410e05
11 changed files with 316 additions and 190 deletions

View File

@ -25,9 +25,9 @@
#ifndef AVFILTER_FFLCMS2_H
#define AVFILTER_FFLCMS2_H
#include "libavutil/csp.h"
#include "libavutil/frame.h"
#include "libavutil/pixfmt.h"
#include "colorspace.h"
#include <lcms2.h>
@ -72,7 +72,7 @@ int ff_icc_profile_attach(FFIccContext *s, cmsHPROFILE profile, AVFrame *frame);
* Returns 0 on success, or a negative error code.
*/
int ff_icc_profile_read_primaries(FFIccContext *s, cmsHPROFILE profile,
struct ColorPrimaries *out_primaries);
AVColorPrimariesDesc *out_primaries);
/**
* Attempt detecting the transfer characteristic that best approximates the