FFmpeg
Functions | Variables
fflcms2.c File Reference
#include "libavutil/csp.h"
#include "fflcms2.h"

Go to the source code of this file.

Functions

static void  log_cb (cmsContext ctx, cmsUInt32Number error, const char *str)
 
int  ff_icc_context_init (FFIccContext *s, void *avctx)
  Initializes an FFIccContext. More...
 
 
static int  get_curve (FFIccContext *s, enum AVColorTransferCharacteristic trc, cmsToneCurve **out_curve)
 
int  ff_icc_profile_generate (FFIccContext *s, enum AVColorPrimaries color_prim, enum AVColorTransferCharacteristic color_trc, cmsHPROFILE *out_profile)
  Generate an ICC profile for a given combination of color primaries and transfer function. More...
 
  Attach an ICC profile to a frame. More...
 
static av_always_inline void  XYZ_xy (cmsCIEXYZ XYZ, AVCIExy *xy)
 
 
  Sanitize an ICC profile to try and fix badly broken values. More...
 
  Read the color primaries and white point coefficients encoded by an ICC profile, and return the raw values in out_primaries. More...
 
  Attempt detecting the transfer characteristic that best approximates the transfer function encoded by an ICC profile. More...
 

Variables

static const AVCIExy  wp_d50 = { {3457, 10000}, {3585, 10000} }
 

Function Documentation

log_cb()

static void log_cb ( cmsContext  ctx,
cmsUInt32Number  error,
const char *  str 
)
static

Definition at line 24 of file fflcms2.c.

Referenced by ff_icc_context_init(), and libplacebo_init().

ff_icc_context_init()

int ff_icc_context_init ( FFIccContexts,
void *  avctx 
)

Initializes an FFIccContext.

This must be done prior to using it.

Returns 0 on success, or a negative error code.

Definition at line 30 of file fflcms2.c.

Referenced by iccdetect_init(), and iccgen_init().

ff_icc_context_uninit()

void ff_icc_context_uninit ( FFIccContexts )

Definition at line 42 of file fflcms2.c.

Referenced by ff_codec_close(), iccdetect_uninit(), and iccgen_uninit().

get_curve()

static int get_curve ( FFIccContexts,
cmsToneCurve **  out_curve 
)
static

Definition at line 50 of file fflcms2.c.

Referenced by ff_icc_profile_detect_transfer(), and ff_icc_profile_generate().

ff_icc_profile_generate()

int ff_icc_profile_generate ( FFIccContexts,
enum AVColorPrimaries  color_prim,
enum AVColorTransferCharacteristic  color_trc,
cmsHPROFILE *  out_profile 
)

Generate an ICC profile for a given combination of color primaries and transfer function.

Both values must be set to valid entries (not "undefined") for this function to work.

Returns 0 on success, or a negative error code.

Definition at line 143 of file fflcms2.c.

Referenced by iccgen_filter_frame().

ff_icc_profile_attach()

int ff_icc_profile_attach ( FFIccContexts,
cmsHPROFILE  profile,
AVFrameframe 
)

Attach an ICC profile to a frame.

Helper wrapper around cmsSaveProfileToMem and av_frame_new_side_data_from_buf.

Returns 0 on success, or a negative error code.

Definition at line 170 of file fflcms2.c.

Referenced by iccgen_filter_frame().

XYZ_xy()

static av_always_inline void XYZ_xy ( cmsCIEXYZ  XYZ,
AVCIExyxy 
)
static

Definition at line 195 of file fflcms2.c.

Referenced by ff_icc_profile_read_primaries(), and ff_icc_profile_sanitize().

abs_sub_q()

static av_always_inline AVRational abs_sub_q ( AVRational  r1,
AVRational  r2 
)
static

Definition at line 202 of file fflcms2.c.

Referenced by ff_icc_profile_sanitize().

ff_icc_profile_sanitize()

int ff_icc_profile_sanitize ( FFIccContexts,
cmsHPROFILE  profile 
)

Sanitize an ICC profile to try and fix badly broken values.

Returns 0 on success, or a negative error code.

Definition at line 211 of file fflcms2.c.

Referenced by iccdetect_filter_frame().

ff_icc_profile_read_primaries()

int ff_icc_profile_read_primaries ( FFIccContexts,
cmsHPROFILE  profile,
AVColorPrimariesDescout_primaries 
)

Read the color primaries and white point coefficients encoded by an ICC profile, and return the raw values in out_primaries.

Returns 0 on success, or a negative error code.

Definition at line 253 of file fflcms2.c.

Referenced by iccdetect_filter_frame().

ff_icc_profile_detect_transfer()

int ff_icc_profile_detect_transfer ( FFIccContexts,
cmsHPROFILE  profile,
enum AVColorTransferCharacteristicout_trc 
)

Attempt detecting the transfer characteristic that best approximates the transfer function encoded by an ICC profile.

Sets out_trc to AVCOL_TRC_UNSPECIFIED if no clear match can be identified.

Returns 0 on success (including no match), or a negative error code.

Definition at line 300 of file fflcms2.c.

Referenced by iccdetect_filter_frame().

Variable Documentation

wp_d50

const AVCIExy wp_d50 = { {3457, 10000}, {3585, 10000} }
static

Definition at line 209 of file fflcms2.c.

Referenced by ff_icc_profile_sanitize().


Generated on Wed Nov 19 2025 19:23:42 for FFmpeg by   doxygen 1.8.17

AltStyle によって変換されたページ (->オリジナル) /