Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
iop_profile.h File Reference

The colour-profile struct and the maths over it: the derived matrix/LUT engine. More...

#include "pixel/format.h"
#include "common/colorspaces_inline_conversions.h"
#include "colorprofiles/profile_types.h"
#include <CL/cl.h>
+ Include dependency graph for colorprofiles/iop_profile.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  dt_iop_order_iccprofile_info_t
 A profile reduced to the arithmetic the pixel loop can run: two matrices and six tone-curve LUTs, plus the identity they were derived from. More...
 
struct  dt_colorspaces_cl_global_t
 The three colorspace kernels, compiled once and held by common/opencl.c. More...
 
struct  dt_colorspaces_iccprofile_info_cl_t
 The device-side view of a dt_iop_order_iccprofile_info_t: the scalar fields only. More...
 

Typedefs

typedef struct dt_iop_order_iccprofile_info_t dt_iop_order_iccprofile_info_t
 A profile reduced to the arithmetic the pixel loop can run: two matrices and six tone-curve LUTs, plus the identity they were derived from.
 
typedef struct dt_colorspaces_cl_global_t dt_colorspaces_cl_global_t
 The three colorspace kernels, compiled once and held by common/opencl.c.
 
typedef struct dt_colorspaces_iccprofile_info_cl_t dt_colorspaces_iccprofile_info_cl_t
 The device-side view of a dt_iop_order_iccprofile_info_t: the scalar fields only.
 

Functions

void dt_ioppr_init_profile_info (dt_iop_order_iccprofile_info_t *profile_info, const int lutsize)
 Put a freshly allocated dt_iop_order_iccprofile_info_t into its empty state – must be called before using profile_info, default lutsize = 0.
 
void dt_ioppr_cleanup_profile_info (dt_iop_order_iccprofile_info_t **profile_info)
 Release a profile info: its tone-curve LUTs, the struct itself, and the caller's pointer – must be called when done with profile_info.
 
dt_iop_order_iccprofile_info_tdt_colorspaces_add_profile (const dt_colorspaces_color_profile_type_t profile_type, const char *profile_filename, const int intent)
 Find-or-build the derived matrix/LUT data for a profile identity, memoised.
 
void dt_colorspaces_flush_profile_memo (void)
 Drop every memoised entry. Called by dt_colorprofiles_cleanup().
 
void dt_colorspaces_invalidate_display_profile_memo (void)
 Drop the memoised DT_COLORSPACE_DISPLAY entry, whose source profile this module replaces on a monitor change.
 
void dt_colorspaces_apply_profile (const char *const op_name, const char *const instance_name, const float *const image_in, float *const image_out, const int width, const int height, const int cst_from, const int cst_to, int *converted_cst, const dt_iop_order_iccprofile_info_t *const profile_info)
 Convert a 4-channel float buffer between RGB and Lab through one profile.
 
int dt_colorspaces_apply_profile_cl (const char *const op_name, const char *const instance_name, const int devid, cl_mem dev_img_in, cl_mem dev_img_out, const int width, const int height, const int cst_from, const int cst_to, int *converted_cst, const dt_iop_order_iccprofile_info_t *const profile_info)
 OpenCL counterpart of dt_colorspaces_apply_profile(), same contract.
 
void dt_ioppr_transform_image_colorspace_rgb (const float *const image_in, float *const image_out, const int width, const int height, const dt_iop_order_iccprofile_info_t *const profile_info_from, const dt_iop_order_iccprofile_info_t *const profile_info_to, const char *message)
 Convert a 4-channel float buffer between two RGB profiles.
 
void dt_colorspaces_init_cl_global (void)
 Compile the colorspace kernels. Called once by common/opencl.c at device init.
 
void dt_colorspaces_free_cl_global (void)
 Release the kernels and the struct from dt_colorspaces_init_cl_global(). NULL-safe.
 
void dt_ioppr_get_profile_info_cl (const dt_iop_order_iccprofile_info_t *const profile_info, dt_colorspaces_iccprofile_info_cl_t *profile_info_cl)
 sets profile_info_cl using profile_info, to be used as a parameter when calling opencl.
 
cl_float * dt_ioppr_get_trc_cl (const dt_iop_order_iccprofile_info_t *const profile_info)
 returns the profile_info trc, to be used as a parameter when calling opencl.
 
cl_int dt_ioppr_build_iccprofile_params_cl (const dt_iop_order_iccprofile_info_t *const profile_info, const int devid, dt_colorspaces_iccprofile_info_cl_t **_profile_info_cl, cl_float **_profile_lut_cl, cl_mem *_dev_profile_info, cl_mem *_dev_profile_lut)
 build the required parameters for a kernel that uses a profile info.
 
void dt_ioppr_free_iccprofile_params_cl (dt_colorspaces_iccprofile_info_cl_t **_profile_info_cl, cl_float **_profile_lut_cl, cl_mem *_dev_profile_info, cl_mem *_dev_profile_lut)
 free parameters build with the previous function.
 
int dt_ioppr_transform_image_colorspace_rgb_cl (const int devid, cl_mem dev_img_in, cl_mem dev_img_out, const int width, const int height, const dt_iop_order_iccprofile_info_t *const profile_info_from, const dt_iop_order_iccprofile_info_t *const profile_info_to, const char *message)
 OpenCL counterpart of dt_ioppr_transform_image_colorspace_rgb().
 
 __OMP_DECLARE_SIMD__ (aligned(lut:64) uniform(lut)) static inline __attribute__((always_inline)) float extrapolate_lut(const float *const lut
 Sample a tone curve, with linear interpolation between entries.
 
static __attribute__ ((always_inline)) float eval_exp(const float coeff[3]
 Evaluate the power-law continuation of a tone curve past white: b * (a*x)^c.
 
 __OMP_DECLARE_SIMD__ (aligned(lut:64) uniform(lut, coeff)) static inline __attribute__((always_inline)) float dt_ioppr_eval_trc(const float x
 Evaluate a tone curve over the whole real line: table below white, power law above.
 
void dt_ioppr_clear_lut_curves (dt_iop_order_iccprofile_info_t *profile_info)
 Mark all six tone curves linear, by writing -1.0 into entry 0 of each.
 
int dt_ioppr_init_unbounded_coeffs (float *lutr, float *lutg, float *lutb, float *unbounded_coeffsr, float *unbounded_coeffsg, float *unbounded_coeffsb, const int lutsize)
 Fit the power-law continuation of three tone curves past white.
 
void dt_ioppr_transform_lcms2 (const char *op, const char *multi_name, const float *const image_in, float *const image_out, const int width, const int height, const dt_iop_colorspace_type_t cst_from, const dt_iop_colorspace_type_t cst_to, dt_iop_colorspace_type_t *converted_cst, const dt_iop_order_iccprofile_info_t *const profile_info)
 The lcms2 branch of dt_colorspaces_apply_profile(): RGB <-> Lab via cmsDoTransform.
 
void dt_ioppr_transform_matrix (const char *op, const char *multi_name, const float *const image_in, float *const image_out, const int width, const int height, const dt_iop_colorspace_type_t cst_from, const dt_iop_colorspace_type_t cst_to, dt_iop_colorspace_type_t *converted_cst, const dt_iop_order_iccprofile_info_t *const profile_info)
 The vectorised branch of dt_colorspaces_apply_profile(): RGB <-> Lab by matrix and tone-curve LUT.
 

Variables

const float v
 
const float const int lutsize
 
const int t = (ft < lutsize - 2) ? ft : lutsize - 2
 
const float f = ft - t
 
const float l1 = lut[t]
 
const float l2 = lut[t + 1]
 
static const float x
 
const float *const lut
 
const float *const const float coeff [3]
 
static dt_aligned_pixel_t rgb_out
 
static dt_aligned_pixel_t float *const const float unbounded_coeffs [3][3]
 

Detailed Description

The colour-profile struct and the maths over it: the derived matrix/LUT engine.

Layer 2: nothing here mentions dt_develop_t, dt_dev_pixelpipe_t or dt_iop_module_t, and the four forward declarations that used to sit here – the only reason this header reached two layers up – went with the pipeline-facing half to develop/iop_profile.h.

pixel/rgb_norms.h and pixel/colorequal_shared.h consume this half, which is why it could not simply move up to develop/ with the rest. (pixel/eaw.c was named here too, but as of this writing it includes nothing from colorprofiles/ and names no type declared below.)

Two things live here, and only these two:

  • the DERIVED form of a profile, dt_iop_order_iccprofile_info_t – the two 3x3 matrices and the six tone-curve LUTs extracted from a cmsHPROFILE once, so that the pixel loop never calls lcms2 per pixel. Extracting them is expensive (two 65536-entry passes) and is a pure function of (type, filename), so dt_colorspaces_add_profile() memoises the result process-wide;
  • APPLY – dt_colorspaces_apply_profile() and its siblings: the pixel loops that consume that struct. Each branches INTERNALLY between the vectorised matrix + LUT path and the lcms2 fallback, so callers neither choose nor see which one ran.

No cmsHPROFILE and no cmsHTRANSFORM ever crosses this header, by design. There is no cmsDupProfile in lcms2 – the only true deep copy is serialise-and-reopen (~0.005 ms for a built-in, but 1.02 ms for a real colord display profile), and copying a prepared transform means rebuilding it (2.2-38 ms, not amortised). So the lifetime of an lcms2 handle is answered by a lock, not by a copy: dt_colorspaces_lock_profiles() / dt_colorspaces_unlock_profiles() in colorprofiles/colorspaces.h. The functions below that need one take that lock themselves, internally, and only for the one profile that can change under them (DT_COLORSPACE_DISPLAY).

See also
colorprofiles/colorspaces.hthe profile list itself (CRUDE on metadata, Lock and Apply on the data).
develop/iop_profile.hthe pipeline-facing half, which knows about pipes and iops.

Definition in file colorprofiles/iop_profile.h.

Typedef Documentation

◆ dt_colorspaces_cl_global_t

The three colorspace kernels, compiled once and held by common/opencl.c.

Built from colorspaces.cl (program 23 in data/kernels/programs.conf) by dt_colorspaces_init_cl_global(), reached from the pixel loops as a file-static in colorprofiles/iop_profile.c. Members are kernel handles, not pointers.

◆ dt_colorspaces_iccprofile_info_cl_t

The device-side view of a dt_iop_order_iccprofile_info_t: the scalar fields only.

Flattened for upload as a constant buffer. The two matrices are stored as 9 contiguous floats, NOT as the host struct's 4x4 padded dt_colormatrix_t; the curves are not here at all – they travel separately as a float image built by dt_ioppr_get_trc_cl(). The host identity (type, filename, intent) is dropped: the kernels only do arithmetic.

Warning
Must be in synch with dt_colorspaces_iccprofile_info_cl_t in data/kernels/colorspaces.cl – there is no compile-time check on either side.

◆ dt_iop_order_iccprofile_info_t

A profile reduced to the arithmetic the pixel loop can run: two matrices and six tone-curve LUTs, plus the identity they were derived from.

This is the DERIVED form of a profile, not the profile. It is produced once by dt_colorspaces_add_profile() from the cmsHPROFILE that colorprofiles/colorspaces.c owns, and from then on it is self-contained: nothing in it points back at lcms2, so the pixel loops below need no lock and no lcms2 call per pixel.

Warning
SOLE OWNERSHIP. One of these is ~1.5 MB: six eagerly-allocated 65536-float LUTs (lut_in[3] + lut_out[3]), see dt_ioppr_init_profile_info(). develop/blend.c shallow-memcpys the struct onto the stack (dt_develop_blendif_init_masking_profile()), which ALIASES those six pointers into a second struct. Such a copy is read-only borrowed state: it must never be handed to dt_ioppr_cleanup_profile_info(), and the original must outlive it. Only the allocator of an instance may free it.
Two sentinel encodings drive every dispatch below, and neither is a flag: isnan(matrix_in[0][0]) means "not a matrix-shaper profile, use lcms2" (dt_ioppr_mark_as_nonmatrix_profile()), and lut_x[c][0] < 0.0f means "channel c has no tone curve, treat it as linear" (dt_ioppr_clear_lut_curves()). Code that memsets or calloc's one of these structs instead of calling dt_ioppr_init_profile_info() gets the opposite meaning for both.

Function Documentation

◆ __attribute__()

static __attribute__ ( (always_inline ) const
inlinestatic

Evaluate the power-law continuation of a tone curve past white: b * (a*x)^c.

Apply one channel's tone curve to each of the three colour channels, or pass the channel through untouched when it has none.

Parameters
coeffthe {a, b, c} fit from dt_ioppr_init_unbounded_coeffs(), i.e. one row of unbounded_coeffs_in/_out.
xinput value, expected >= 1.0.
Returns
the extrapolated curve value.
Note
This is what lets the pipeline carry values above white through an encoding curve that only exists on [0,1]; lcms2 would have clipped them.
Parameters
rgb_insource pixel.
rgb_outdestination pixel. Only channels 0..2 are written – the 4th lane is left alone, which is what preserves alpha through an in-place conversion.
lutthe profile's lut_in or lut_out. A NULL entry, or one whose [0] is negative, means "channel is linear" and is copied straight through.
unbounded_coeffsthe matching unbounded_coeffs_in/_out.
lutsizeentry count.

References coeff, L, and x.

◆ __OMP_DECLARE_SIMD__() [1/2]

__OMP_DECLARE_SIMD__ ( aligned(lut:64) uniform(lut ) const

Sample a tone curve, with linear interpolation between entries.

Parameters
lutcurve, lutsize entries spanning [0,1].
vinput value.
lutsizeentry count.
Returns
the interpolated curve value.
Note
Despite the name it does NOT extrapolate: v is clamped into the table, so everything above 1.0 returns the last entry. Extrapolation past white is eval_exp()'s job, and dt_ioppr_eval_trc() is the one that picks between them.

◆ __OMP_DECLARE_SIMD__() [2/2]

__OMP_DECLARE_SIMD__ ( aligned(lut:64) uniform(lut, coeff ) const

Evaluate a tone curve over the whole real line: table below white, power law above.

Parameters
xinput value.
lutthe curve, one of lut_in[c]/lut_out[c].
coeffthe matching unbounded_coeffs_*[c] fit.
lutsizeentry count.
Returns
the curve value.
Warning
Does not test the lut[0] < 0 "linear channel" sentinel – callers must, or a linear channel gets read as a curve whose first entry is -1. _apply_trc() and the loops in the .c do that test.

◆ dt_colorspaces_add_profile()

dt_iop_order_iccprofile_info_t * dt_colorspaces_add_profile ( const dt_colorspaces_color_profile_type_t  profile_type,
const char *  profile_filename,
const int  intent 
)

Find-or-build the derived matrix/LUT data for a profile identity, memoised.

Deriving matrices and curves from a profile costs two 65536-entry extractions and is a pure function of (type, filename, intent), so the result is kept in a process-wide memo. The lookup and the append are ONE critical section under the module's own mutex: this is reached from the pipeline worker (iop/lut3d.c and iop/tonecurve.c call it from process()/process_cl(), once per tile) and from the GUI thread (iop/colorin.c), and two threads missing the same key concurrently would otherwise each build an entry – 1.5 MB of tone-curve LUTs apiece – and append both. Building the DT_COLORSPACE_DISPLAY entry additionally takes dt_colorspaces_lock_profiles() internally, for the whole span from resolving the handle to the last extraction, because that handle is the one datum in the profile list that is replaced at runtime.

Parameters
profile_typeprofile identity; half of the memo key.
profile_filenameICC file name, "" for built-ins; the other half of the key.
intentrendering intent; the third part of the key. It is stored in the entry and read back by the lcms2 transform path, so a memo that ignored it handed the second caller a transform built for the first caller's intent – silently, and depending on which module happened to commit first. Two intents for one profile now cost two entries, which is 1.5 MB each; that is the price of the answer being right.
Returns
A pointer the MODULE owns, valid until dt_colorspaces_flush_profile_memo() (or, for DT_COLORSPACE_DISPLAY, dt_colorspaces_invalidate_display_profile_memo()). Never free it, and never write through it – the entry is shared by every caller asking for the same identity, including concurrent pipes. NULL only if the allocation failed or the profile could not be derived.
Warning
NOT for the image-derived types, DT_COLORSPACE_EMBEDDED_ICC (9) through DT_COLORSPACE_ALTERNATE_MATRIX (14). Those are not registered in the profile list and cannot be resolved by identity at all: their matrices come from the image's own camera data via iop/colorin.c. Keyed on (type, "") they would all collide on one entry and stomp each other across images. They live on the pipe that built them instead (dt_dev_pixelpipe_t.owned_input_profile_info); see dt_ioppr_set_pipe_input_profile_info() in develop/iop_profile.c.

Definition at line 1248 of file colorprofiles/iop_profile.c.

References _generate_profile_info(), _get_profile_info_from_list(), _profile_info_lock, _profile_info_memo, dt_alloc_align(), dt_ioppr_cleanup_profile_info(), dt_ioppr_init_profile_info(), IS_NULL_PTR, and L.

Referenced by _filmic_get_output_profile(), _refresh_slider_gradients(), _update_gui_lut_cache(), _update_gui_lut_cache(), commit_params(), dt_ioppr_get_iop_work_profile_info(), dt_ioppr_set_pipe_input_profile_info(), dt_ioppr_set_pipe_output_profile_info(), dt_ioppr_set_pipe_work_profile_info(), process(), process(), process_cl(), and workicc_changed().

◆ dt_colorspaces_apply_profile()

void dt_colorspaces_apply_profile ( const char *const  op_name,
const char *const  instance_name,
const float *const  image_in,
float *const  image_out,
const int  width,
const int  height,
const int  cst_from,
const int  cst_to,
int *  converted_cst,
const dt_iop_order_iccprofile_info_t *const  profile_info 
)

Convert a 4-channel float buffer between RGB and Lab through one profile.

THE entry point for the RGB <-> Lab leg of the pipeline, called by develop/pixelpipe_cpu.c around every module that wants a different working space than the one the pipe carries. It dispatches on the profile itself, not on a caller's request: if the profile reduced to real matrices (!isnan(matrix_in[0][0])) it runs dt_ioppr_transform_matrix() – our own vectorised matrix + tone-curve LUT loop, with power-law extrapolation above white; otherwise (a CLUT profile, a v4 parametric curve lcms2 will not reduce) it falls back to dt_ioppr_transform_lcms2(), which builds a cmsHTRANSFORM and runs cmsDoTransform. Callers do not choose, and do not see which ran except in the -d perf trace.

The lcms2 branch resolves and pins the profile handle itself – it takes dt_colorspaces_lock_profiles() around resolve-through-cmsCreateTransform when the profile is DT_COLORSPACE_DISPLAY – so callers neither take that lock nor need to know the branch exists.

Parameters
op_namemodule op string, for the -d perf trace ONLY.
instance_namemodule multi_name string, same.
image_insource, 4 floats per pixel, 16-byte aligned. May equal image_out (in-place is supported and used).
image_outdestination, same layout. Alpha (the 4th float) is preserved by the matrix paths.
widthpixels per row.
heightrows.
cst_fromsource colorspace, a dt_iop_colorspace_type_t passed as plain int.
cst_todestination colorspace, same.
converted_cstout: set to cst_to when the buffer was converted, and left at cst_from when it was NOT – which is how the caller learns the buffer is still in its original space. This is the only failure report; there is no return value.
Warning
Refuses (leaving *converted_cst == cst_from) on a NULL profile_info or one whose type is DT_COLORSPACE_NONE, and prints to stderr on an unsupported pair.
RGB -> RGB is a NO-OP here: it reports success (*converted_cst = cst_to) and copies nothing, not even between two different RGB profiles. Converting between two RGB spaces is dt_ioppr_transform_image_colorspace_rgb()'s job.
See also
dt_ioppr_transform_image_colorspace_rgb() for the RGB -> RGB leg.

Definition at line 1300 of file colorprofiles/iop_profile.c.

References DT_COLORSPACE_NONE, DT_DEBUG_PERF, dt_get_debug_flags(), dt_get_times(), dt_iop_colorspace_is_rgb(), dt_ioppr_transform_lcms2(), dt_ioppr_transform_matrix(), height, IS_NULL_PTR, L, and width.

Referenced by _draw_color_picker(), _refresh_preview_module_histogram_for_hash(), _retouch_blur(), dt_colorspaces_apply_profile_cl(), pixelpipe_process_on_CPU(), and pixelpipe_process_on_GPU().

◆ dt_colorspaces_apply_profile_cl()

int dt_colorspaces_apply_profile_cl ( const char *const  op_name,
const char *const  instance_name,
const int  devid,
cl_mem  dev_img_in,
cl_mem  dev_img_out,
const int  width,
const int  height,
const int  cst_from,
const int  cst_to,
int *  converted_cst,
const dt_iop_order_iccprofile_info_t *const  profile_info 
)

OpenCL counterpart of dt_colorspaces_apply_profile(), same contract.

Same internal branch, different fallback cost: a matrix profile is uploaded (the scalar fields as a constant buffer, the six curves as a 256 x 1536 float image) and converted by the colorspaces_transform_* kernels; a non-matrix profile has no kernel, so the buffer is read back to host memory, run through dt_colorspaces_apply_profile() on the CPU in place, and written back to the device.

Parameters
devidOpenCL device.
dev_img_insource device image.
dev_img_outdestination device image.
converted_cstout: same "did it actually convert" report as the CPU version, and still meaningful on a FALSE return.
Returns
TRUE on success, FALSE on any OpenCL error or refusal – an int, not a cl_int. Callers must fall back to the CPU path on FALSE.
Warning
Asserts that both images are non-NULL and DISTINCT: unlike the CPU version, this one cannot run in place.

Definition at line 1362 of file colorprofiles/iop_profile.c.

References _colorspaces_cl_global, ch, cleanup(), DT_COLORSPACE_NONE, dt_colorspaces_apply_profile(), DT_DEBUG_PERF, dt_free, dt_get_debug_flags(), dt_get_times(), dt_iop_colorspace_is_rgb(), dt_ioppr_get_profile_info_cl(), dt_ioppr_get_trc_cl(), dt_opencl_copy_device_to_host(), dt_opencl_copy_host_to_device(), dt_opencl_copy_host_to_device_constant(), dt_opencl_enqueue_kernel_2d(), dt_opencl_release_mem_object(), dt_opencl_set_kernel_arg(), dt_opencl_write_host_to_device(), dt_pixelpipe_cache_alloc_align_float_cache, dt_pixelpipe_cache_free_align, FALSE, height, IOP_CS_LAB, IS_NULL_PTR, dt_colorspaces_cl_global_t::kernel_colorspaces_transform_lab_to_rgb_matrix, dt_colorspaces_cl_global_t::kernel_colorspaces_transform_rgb_matrix_to_lab, L, ROUNDUPDHT, ROUNDUPDWD, TRUE, and width.

Referenced by pixelpipe_process_on_GPU().

◆ dt_colorspaces_flush_profile_memo()

void dt_colorspaces_flush_profile_memo ( void  )

Drop every memoised entry. Called by dt_colorprofiles_cleanup().

Frees each entry with dt_ioppr_cleanup_profile_info(), so it invalidates every pointer ever returned by dt_colorspaces_add_profile(). Only legitimate at shutdown, once no pipe can still be holding one.

Definition at line 1096 of file colorprofiles/iop_profile.c.

References _profile_info_lock, _profile_info_memo, dt_ioppr_cleanup_profile_info(), and L.

Referenced by dt_colorprofiles_cleanup().

◆ dt_colorspaces_free_cl_global()

void dt_colorspaces_free_cl_global ( void  )

Release the kernels and the struct from dt_colorspaces_init_cl_global(). NULL-safe.

Definition at line 712 of file colorprofiles/iop_profile.c.

References _colorspaces_cl_global, dt_free, dt_opencl_free_kernel(), g, IS_NULL_PTR, and L.

Referenced by dt_opencl_cleanup().

◆ dt_colorspaces_init_cl_global()

void dt_colorspaces_init_cl_global ( void  )

Compile the colorspace kernels. Called once by common/opencl.c at device init.

Returns
A malloced struct the caller owns; release with dt_colorspaces_free_cl_global().

Definition at line 700 of file colorprofiles/iop_profile.c.

References _colorspaces_cl_global, dt_opencl_create_kernel(), g, dt_colorspaces_cl_global_t::kernel_colorspaces_transform_lab_to_rgb_matrix, and L.

Referenced by dt_opencl_init().

◆ dt_colorspaces_invalidate_display_profile_memo()

void dt_colorspaces_invalidate_display_profile_memo ( void  )

Drop the memoised DT_COLORSPACE_DISPLAY entry, whose source profile this module replaces on a monitor change.

Nothing invalidated it before, so a session kept the previous monitor's matrices and tone curves for as long as the memo lived. That was already wrong when the memo hung off one image; now that it is process-wide it would persist for the whole run. Dropped rather than rebuilt: the next caller that wants it will build it, and rebuilding here would mean deriving a profile under the memo lock from inside the profile-changed handler.

Warning
Called from colorprofiles/colorspaces.c when the display profile changes. Any pointer a caller cached from a previous dt_colorspaces_add_profile(DISPLAY, ...) is freed by this – resolve the display profile per use, do not hold it.

Definition at line 1108 of file colorprofiles/iop_profile.c.

References _profile_info_lock, _profile_info_memo, DT_COLORSPACE_DISPLAY, dt_ioppr_cleanup_profile_info(), L, and dt_iop_order_iccprofile_info_t::type.

Referenced by _notify_profile_changed().

◆ dt_ioppr_build_iccprofile_params_cl()

cl_int dt_ioppr_build_iccprofile_params_cl ( const dt_iop_order_iccprofile_info_t *const  profile_info,
const int  devid,
dt_colorspaces_iccprofile_info_cl_t **  _profile_info_cl,
cl_float **  _profile_lut_cl,
cl_mem *  _dev_profile_info,
cl_mem *  _dev_profile_lut 
)

build the required parameters for a kernel that uses a profile info.

Packs the profile for the device in one call: the scalars into a constant buffer and the six curves into a 256 x 1536 float image. Everything it allocates – host and device – comes back through the four out-parameters, and is released as a set by dt_ioppr_free_iccprofile_params_cl().

Parameters
profile_infoprofile to upload, or NULL. NULL is a supported "this kernel takes a profile argument but there is no profile" case: it uploads a 6-float dummy LUT and leaves *_dev_profile_info NULL while still returning CL_SUCCESS. Callers that pass a profile conditionally (develop/blend.c does) must therefore not assume a successful return means a valid device buffer.
devidOpenCL device.
_profile_info_clout: host-side packed struct, always allocated.
_profile_lut_clout: host-side flattened curves.
_dev_profile_infoout: device constant buffer, or NULL as described above.
_dev_profile_lutout: device image holding the curves.
Returns
CL_SUCCESS, or a cl_int error. On error the out-parameters still carry whatever was allocated before the failure, so the free function must be called either way.
Warning
The device LUT image is hardcoded 256 x (256*6), which equals 6 * lutsize ONLY for the default lutsize of 65536. A profile built with a different lutsize would upload the wrong amount of data with no diagnostic.

Definition at line 762 of file colorprofiles/iop_profile.c.

References cleanup(), dt_ioppr_get_profile_info_cl(), dt_ioppr_get_trc_cl(), dt_opencl_copy_host_to_device(), dt_opencl_copy_host_to_device_constant(), IS_NULL_PTR, and L.

Referenced by dt_develop_blend_process_cl(), and process_cl().

◆ dt_ioppr_cleanup_profile_info()

void dt_ioppr_cleanup_profile_info ( dt_iop_order_iccprofile_info_t **  profile_info)

Release a profile info: its tone-curve LUTs, the struct itself, and the caller's pointer – must be called when done with profile_info.

This owns the WHOLE teardown, not just the LUTs. A dt_iop_order_iccprofile_info_t owns six aligned float arrays, so releasing one is "free the curves, free the struct, drop the pointer" – three steps every caller used to open-code, and three chances to free the struct while leaving 1.5 MB of curves behind.

Parameters
profile_infoaddress OF the caller's pointer. Taken by address, not by value, so the caller's variable is NULLed here and cannot be left dangling. A NULL address, or an address holding NULL, is a no-op.
Warning
The struct is released with dt_free_align, so only a struct obtained from dt_alloc_align may be passed. Never pass a stack copy or a shallow memcpy of another instance – develop/blend.c makes exactly such a copy, and its aliased LUT pointers belong to the original.

Definition at line 624 of file colorprofiles/iop_profile.c.

References dt_free_align, i, IS_NULL_PTR, and L.

Referenced by dt_colorspaces_add_profile(), dt_colorspaces_flush_profile_memo(), dt_colorspaces_invalidate_display_profile_memo(), and dt_dev_pixelpipe_cleanup().

◆ dt_ioppr_clear_lut_curves()

void dt_ioppr_clear_lut_curves ( dt_iop_order_iccprofile_info_t profile_info)

Mark all six tone curves linear, by writing -1.0 into entry 0 of each.

The curve equivalent of the NaN matrix sentinel. Requires the six LUT arrays to be allocated already, i.e. dt_ioppr_init_profile_info() must have run.

Parameters
profile_infoprofile to clear. Dereferenced unguarded.

Definition at line 84 of file colorprofiles/iop_profile.c.

References i, and L.

Referenced by _generate_profile_info().

◆ dt_ioppr_free_iccprofile_params_cl()

void dt_ioppr_free_iccprofile_params_cl ( dt_colorspaces_iccprofile_info_cl_t **  _profile_info_cl,
cl_float **  _profile_lut_cl,
cl_mem *  _dev_profile_info,
cl_mem *  _dev_profile_lut 
)

free parameters build with the previous function.

Releases both host allocations and both device buffers and NULLs all four caller variables, so it is idempotent and safe on a partially-built set (which is what an error return from dt_ioppr_build_iccprofile_params_cl() leaves behind).

Warning
Dereferences all four addresses unguarded – pass addresses of real variables, never NULL.

Definition at line 817 of file colorprofiles/iop_profile.c.

References dt_free, dt_opencl_release_mem_object(), and L.

Referenced by dt_develop_blend_process_cl(), and process_cl().

◆ dt_ioppr_get_profile_info_cl()

void dt_ioppr_get_profile_info_cl ( const dt_iop_order_iccprofile_info_t *const  profile_info,
dt_colorspaces_iccprofile_info_cl_t profile_info_cl 
)

sets profile_info_cl using profile_info, to be used as a parameter when calling opencl.

Parameters
profile_infosource, host side. Dereferenced unguarded.
profile_info_cldestination, caller-provided storage (a stack struct is the usual case). Every field is written, so it needs no prior initialisation.
Note
Copies the scalars only. The tone curves are dt_ioppr_get_trc_cl()'s job.

Definition at line 726 of file colorprofiles/iop_profile.c.

References i, and L.

Referenced by dt_colorspaces_apply_profile_cl(), dt_ioppr_build_iccprofile_params_cl(), and dt_ioppr_transform_image_colorspace_rgb_cl().

◆ dt_ioppr_get_trc_cl()

cl_float * dt_ioppr_get_trc_cl ( const dt_iop_order_iccprofile_info_t *const  profile_info)

returns the profile_info trc, to be used as a parameter when calling opencl.

Flattens the six tone curves into one contiguous array, lut_in[0..2] then lut_out[0..2], profile_info->lutsize floats each.

Returns
A newly malloced array of 6 * lutsize floats that the CALLER owns and frees with dt_free (the CL param helpers below do it for you). NULL if the allocation failed – which callers in this file do not check.

Definition at line 746 of file colorprofiles/iop_profile.c.

References L, and x.

Referenced by dt_colorspaces_apply_profile_cl(), dt_ioppr_build_iccprofile_params_cl(), and dt_ioppr_transform_image_colorspace_rgb_cl().

◆ dt_ioppr_init_profile_info()

void dt_ioppr_init_profile_info ( dt_iop_order_iccprofile_info_t profile_info,
const int  lutsize 
)

Put a freshly allocated dt_iop_order_iccprofile_info_t into its empty state – must be called before using profile_info, default lutsize = 0.

Sets type = DT_COLORSPACE_NONE, marks the matrices non-matrix (NaN) and the six curves linear ([0] = -1), and ALLOCATES the six LUT arrays with dt_alloc_align_float – so this is not a cheap "zero the struct" call: it is where the ~1.5 MB comes from, and it must be paired with dt_ioppr_cleanup_profile_info() or every byte of it leaks.

Parameters
profile_infostruct to initialise. Not NULL-checked, and not allocated here: the caller allocates (with dt_alloc_align, since teardown uses dt_free_align).
lutsizeentries per tone curve, or 0 for the default of 65536. Every caller in the tree passes 0, which is also what the OpenCL upload path assumes.
Warning
Do not call this twice on the same struct: it overwrites the six LUT pointers without freeing the previous arrays.

Definition at line 602 of file colorprofiles/iop_profile.c.

References dt_alloc_align_float(), DT_COLORSPACE_NONE, DT_INTENT_PERCEPTUAL, DT_IOPPR_LUT_SAMPLES, i, L, and lutsize.

Referenced by dt_colorspaces_add_profile(), and dt_ioppr_set_pipe_input_profile_info().

◆ dt_ioppr_init_unbounded_coeffs()

int dt_ioppr_init_unbounded_coeffs ( float *  lutr,
float *  lutg,
float *  lutb,
float *  unbounded_coeffsr,
float *  unbounded_coeffsg,
float *  unbounded_coeffsb,
const int  lutsize 
)
inline

Fit the power-law continuation of three tone curves past white.

For each channel whose curve is not marked linear, samples it at x = 0.7, 0.8, 0.9, 1.0 and fits b * (a*x)^c, which eval_exp() then evaluates above 1.0. This is what makes the pipeline able to carry values above white through an encoding curve defined only on [0,1].

Parameters
lutr,lutg,lutbthe three curves, lutsize entries each. A curve whose [0] is negative is skipped and its coefficients marked -1.
unbounded_coeffsr,unbounded_coeffsg,unbounded_coeffsbout: three floats each.
lutsizeentry count.
Returns
the COUNT (0..3) of channels that actually got a fit – which is what callers store into profile_info->nonlinearlut and then read as a boolean.

Definition at line 303 of file colorprofiles/iop_profile.c.

References dt_iop_estimate_exp(), k, L, lut, lutsize, unbounded_coeffs, and x.

Referenced by _generate_profile_info(), and dt_colorspaces_prepare_conversion().

◆ dt_ioppr_transform_image_colorspace_rgb()

void dt_ioppr_transform_image_colorspace_rgb ( const float *const  image_in,
float *const  image_out,
const int  width,
const int  height,
const dt_iop_order_iccprofile_info_t *const  profile_info_from,
const dt_iop_order_iccprofile_info_t *const  profile_info_to,
const char *  message 
)

Convert a 4-channel float buffer between two RGB profiles.

The other half of APPLY: dt_colorspaces_apply_profile() handles RGB <-> Lab through ONE profile and refuses RGB -> RGB; this one takes two profiles and does exactly that leg. Same internal dispatch, on all four matrices this time: when both profiles reduced to matrices, the two 3x3s are pre-multiplied ONCE into a single matrix so the loop costs one matrix product per pixel instead of two; otherwise both profiles go to lcms2 as a single RGB->RGB transform.

Parameters
image_insource, 4 floats per pixel. May equal image_out.
image_outdestination.
profile_info_fromsource profile. Must NOT be NULL.
profile_info_todestination profile. Must NOT be NULL.
messagelabel for the -d perf trace only; NULL is tolerated.
Warning
No return value and no converted_cst: a refusal is SILENT. It returns without touching image_out when either profile's type is DT_COLORSPACE_NONE – so the destination keeps whatever it held, which for a fresh buffer is garbage.
Both pointers are dereferenced unguarded. This differs from dt_colorspaces_apply_profile(), which NULL-checks its profile.
Note
When both profiles have the same type AND the same filename it degenerates to a memcpy (skipped when the buffers are the same), not to a no-op.

◆ dt_ioppr_transform_image_colorspace_rgb_cl()

int dt_ioppr_transform_image_colorspace_rgb_cl ( const int  devid,
cl_mem  dev_img_in,
cl_mem  dev_img_out,
const int  width,
const int  height,
const dt_iop_order_iccprofile_info_t *const  profile_info_from,
const dt_iop_order_iccprofile_info_t *const  profile_info_to,
const char *  message 
)

OpenCL counterpart of dt_ioppr_transform_image_colorspace_rgb().

Same dispatch: both profiles reduced to matrices means one pre-multiplied matrix and the colorspaces_transform_rgb_matrix_to_rgb kernel; otherwise the buffer is read back, converted on the CPU by dt_ioppr_transform_image_colorspace_rgb(), and written back. Unlike dt_colorspaces_apply_profile_cl(), in-place IS supported: when dev_img_in == dev_img_out it allocates a device scratch image and copies through it.

Returns
TRUE on success. FALSE on any OpenCL error AND on the "either profile is DT_COLORSPACE_NONE" refusal – so a FALSE does not distinguish a device failure from a caller passing an unset profile. Identical source and destination profiles return TRUE after a device-side image copy.
Warning
Both profile pointers are dereferenced unguarded.

Definition at line 840 of file colorprofiles/iop_profile.c.

References _colorspaces_cl_global, ch, cleanup(), dt_colormatrix_mul(), DT_COLORSPACE_NONE, DT_DEBUG_PERF, dt_free, dt_get_debug_flags(), dt_get_times(), dt_ioppr_get_profile_info_cl(), dt_ioppr_get_trc_cl(), dt_ioppr_transform_image_colorspace_rgb(), dt_opencl_alloc_device(), dt_opencl_copy_device_to_host(), dt_opencl_copy_host_to_device(), dt_opencl_copy_host_to_device_constant(), dt_opencl_enqueue_copy_image(), dt_opencl_enqueue_kernel_2d(), dt_opencl_release_mem_object(), dt_opencl_set_kernel_arg(), dt_opencl_write_host_to_device(), dt_pixelpipe_cache_alloc_align_float_cache, dt_pixelpipe_cache_free_align, FALSE, height, IS_NULL_PTR, dt_colorspaces_cl_global_t::kernel_colorspaces_transform_rgb_matrix_to_rgb, L, matrix, pack_3xSSE_to_3x4(), ROUNDUPDHT, ROUNDUPDWD, TRUE, and width.

Referenced by process_cl().

◆ dt_ioppr_transform_lcms2()

void dt_ioppr_transform_lcms2 ( const char *  op,
const char *  multi_name,
const float *const  image_in,
float *const  image_out,
const int  width,
const int  height,
const dt_iop_colorspace_type_t  cst_from,
const dt_iop_colorspace_type_t  cst_to,
dt_iop_colorspace_type_t converted_cst,
const dt_iop_order_iccprofile_info_t *const  profile_info 
)

The lcms2 branch of dt_colorspaces_apply_profile(): RGB <-> Lab via cmsDoTransform.

Resolves the profile by identity out of the shared list, builds a cmsHTRANSFORM, runs it over the buffer and deletes it – so the transform is rebuilt on EVERY call, which is why this is the fallback and not the default. It takes dt_colorspaces_lock_profiles() itself, across resolve-through-cmsCreateTransform, when the profile is DT_COLORSPACE_DISPLAY, because that handle can be closed and replaced by a monitor change mid-flight.

Parameters
opmodule op string, for the -d dev trace only.
multi_namemodule multi_name string, same.
image_in,image_out4-float pixels; may be the same buffer.
width,heightbuffer geometry.
cst_from,cst_tosource and destination colorspaces. Only RGB <-> Lab is supported; anything else leaves *converted_cst == cst_from and logs to stderr.
converted_cstout: cst_to on success, cst_from on refusal.
profile_infoprofile identity to resolve. Only type, filename and intent are read – the matrices and LUTs are ignored on this path. A type of DT_COLORSPACE_NONE silently substitutes linear Rec2020 here, unlike dt_colorspaces_apply_profile(), which refuses it before ever getting this far.

Definition at line 257 of file colorprofiles/iop_profile.c.

References _transform_from_to_rgb_lab_lcms2(), DT_DEBUG_DEV, dt_iop_colorspace_is_rgb(), dt_print(), height, IOP_CS_LAB, L, and width.

Referenced by dt_colorspaces_apply_profile().

◆ dt_ioppr_transform_matrix()

void dt_ioppr_transform_matrix ( const char *  op,
const char *  multi_name,
const float *const  image_in,
float *const  image_out,
const int  width,
const int  height,
const dt_iop_colorspace_type_t  cst_from,
const dt_iop_colorspace_type_t  cst_to,
dt_iop_colorspace_type_t converted_cst,
const dt_iop_order_iccprofile_info_t *const  profile_info 
)

The vectorised branch of dt_colorspaces_apply_profile(): RGB <-> Lab by matrix and tone-curve LUT.

No lcms2, no lock, no per-call setup: it reads the matrices and curves already in profile_info and runs an OpenMP/SIMD loop. Preserves the 4th float of each pixel on the Lab -> RGB leg (some callers convert in place and rely on alpha surviving).

Parameters
opmodule op string, for the trace only.
multi_namemodule multi_name string, same.
image_in,image_out4-float pixels; may be the same buffer.
width,heightbuffer geometry.
cst_from,cst_tosource and destination colorspaces; only RGB <-> Lab is supported.
converted_cstout: cst_to on success, cst_from on refusal.
profile_infoprofile whose matrices and curves to use.
Warning
Does NOT check the NaN sentinel. Called on a non-matrix profile it will happily multiply by NaN and fill the buffer with NaN. dt_colorspaces_apply_profile() is the thing that makes that check.

Variable Documentation

◆ coeff

◆ f

const float f = ft - t

Definition at line 541 of file colorprofiles/iop_profile.h.

Referenced by __attribute__(), __attribute__(), __attribute__(), _build_xtrans_bilinear_lookup(), _circle_get_mask(), _circle_get_mask_roi(), _colorspaces_get_base_name(), _colorspaces_is_base_name(), _dt_focus_update(), _fill_mask(), _forms_json(), _get_total_memory(), _image_distance_transform(), _interpolate_and_mask_xtrans(), derive_filmic_agx_primaries::_lab_d65_to_work(), _lib_masks_list_recurs(), _print_nan_debug(), _process(), _quantize(), _read_pbm(), _read_pgm(), _read_ppm(), _retouch_fill(), _simplex_2d_noise(), _tonecurve_apply(), _track_add_point(), _upsample_bilinear(), apply_legacy_curve(), area_draw(), clamp(), demosaic_ppg(), denoiseprofile_draw(), doubleToRawLongBits(), draw_f_boxes(), dsvd(), dt_bauhaus_combobox_from_params(), dt_bauhaus_slider_from_params(), dt_bauhaus_toggle_from_params(), dt_bauhaus_value_changed_default_callback(), dt_bauhaus_widget_set_quad_paint(), dt_conf_init(), dt_conf_print(), dt_conf_save(), dt_fast_mexp2f(), dt_film_relocate(), dt_film_remove_empty(), dt_gpx_geodesic_intermediate_point(), dt_gpx_get_location(), dt_gradient_lookup(), dt_image_distance_transform(), dt_image_repository_get_xmp_row(), dt_imageio_dng_convert_rational(), dt_imageio_dng_write_tiff_header(), dt_imageio_jpeg_write_with_icc_profile(), dt_imageio_open_pfm(), dt_imageio_open_pnm(), dt_imageio_open_rawspeed(), dt_imageio_open_rgbe(), dt_imageio_open_webp(), dt_imageio_write_dng(), dt_iop_colorzones_get_params(), dt_iop_denoiseprofile_get_params(), dt_iop_lowlight_get_params(), dt_iop_monochrome_draw(), dt_iop_rawdenoise_get_params(), dt_mipmap_cache_allocate_dynamic(), dt_mipmap_cache_deallocate_dynamic(), dt_nn_model_load(), dt_opencl_build_program(), dt_opencl_device_init(), dt_opencl_load_program(), dt_opencl_md5sum(), dt_points_get_for(), dt_print_mem_usage(), dt_supervisor_history(), easter(), finalize_store(), fopen_stat(), get_params(), gh(), gui_init(), image_is_normalized(), Lab_to_XYZ(), legacy_params(), legacy_params(), lerp_lookup_unbounded(), lin_interpolate(), longBitsToDouble(), lowlight_draw(), main(), main(), modify_roi_out(), nearest_color(), orthonormalize_v_with_qr_single(), parse_cht(), parse_csv(), process(), process_cl(), process_clusters(), process_floyd_steinberg(), process_vng_cl(), rawdenoise_draw(), rcd_ppg_border(), read_curveset(), read_f32(), read_histogram(), read_pfm(), read_pfm(), read_ppm16(), read_ppm8(), read_ppm_header(), rgbe2float(), rt_copy_image_masked(), rt_copy_mask_to_alpha(), simplex(), vec3lnorm(), vec3norm(), vec3prodn(), write_curveset(), write_image(), write_image(), write_image(), write_image(), write_image(), write_pfm(), xdiv2f(), xdivf(), xmul2f(), xtrans_fdc_interpolate(), and xtrans_markesteijn_interpolate().

◆ l1

◆ l2

◆ lut

◆ lutsize

◆ rgb_out

Definition at line 600 of file colorprofiles/iop_profile.h.

Referenced by _scope_pixel_to_display_rgb().

◆ t

const int t = (ft < lutsize - 2) ? ft : lutsize - 2

Definition at line 540 of file colorprofiles/iop_profile.h.

Referenced by _add_node_to_segment(), _add_node_to_segment(), _add_usage_bar(), _align_lcm(), _ask_text(), _brush_border_get_XY(), _brush_get_mask(), _brush_get_mask_roi(), _brush_get_position_in_segment(), _brush_get_XY(), _brush_line_point_at_length(), _brush_point_line_distance2(), _build_raw_segment_cubic_arclen_lut(), _chromaticity_gradient(), _chromaticity_gradient_stage_cl_selftest(), _closest_point_on_segment(), _compute_downsampling_kernel(), _count_images_per_track(), _delete_tagids(), _detach_tagids(), _dist_seg(), _dt_CGATS_get_type_value(), _dt_colorchecker_get_standard_type(), _ellipse_draw_shape(), _exif_get_exiv2_tag_type(), _format_picker_brightness_position(), _free_result_item(), _free_result_item(), _gcd(), _generic_dt_control_fileop_images_job_run(), _group_get_mask(), _hit_paths(), _hl_floor_gate(), _hl_ring_flat_mean_vote(), _intersect_affine_ray_segment(), _introspect_dump(), _lcm(), _lerpf(), _lerpf(), _match_text(), _on_record_toggled(), _on_toggle(), _paint_build_segment_window_sample(), _paint_cubic_hermitef(), _paint_process_one_raw_input(), _polygon_border_get_XY(), _polygon_get_mask(), _polygon_get_mask_roi(), _polygon_get_position_in_segment(), _polygon_get_XY(), _preview_button_press(), _preview_gpx_file(), _read_chunky_16(), _read_chunky_16_Lab(), _read_chunky_8(), _read_chunky_8_Lab(), _read_chunky_f(), _read_chunky_h(), _refresh_collection_tags(), _refresh_completion_store(), _refresh_track_list(), _render_preview(), _sample_raw_segment_cubic_param(), _show_gpx_tracks(), _show_tag_on_view(), _sprinkle_octave_weights(), _tag_add_tags_to_list(), _tag_from_row(), _tag_get_attached_export(), _tag_remove_tags_from_list(), _tonecurve_apply(), _wire_conv(), apply_blue_mapping(), blackbody_xy_to_tinted_xy(), button_released(), casteljau(), CCT_to_xy_blackbody(), CCT_to_xy_daylight(), cmix(), color_smoothing_cl(), commit_params(), compute_density(), curve_scalar(), dt_collection_free(), dt_collection_set_rules(), dt_colorrings_eval_local_field(), dt_colorrings_eval_sparse_local_field(), dt_colorrings_wendland_c2(), dt_control_datetime_job_run(), dt_control_delete_images_job_run(), dt_control_duplicate_images_job_run(), dt_control_export_job_run(), dt_control_flip_images_job_run(), dt_control_gpx_apply_job_run(), dt_control_image_enumerator_job_film_init(), dt_control_local_copy_images_job_run(), dt_control_merge_hdr_job_run(), dt_control_monochrome_images_job_run(), dt_control_refresh_exif_run(), dt_control_remove_images_job_run(), dt_control_save_xmps_job_run(), dt_drawlayer_brush_profile_eval(), dt_drawlayer_brush_transition_profile_eval(), dt_get_times(), dt_gui_freeze_release_(), dt_imageio_open_rawspeed(), dt_imageio_open_tiff(), dt_iop_clip_and_zoom_8(), dt_iop_flip_and_zoom_8(), dt_location_repository_get_in_bbox(), dt_map_location_get_locations_by_path(), dt_metadata_get_key_by_subkey(), dt_metadata_get_subkey(), dt_noiseprofile_interpolate(), dt_pdf_finish(), dt_supervisor_events_snapshot_since(), dt_tag_count_free(), dt_tag_get_attached(), dt_tag_get_collection_tags(), dt_tag_get_hierarchical(), dt_tag_get_hierarchical_export(), dt_tag_get_list(), dt_tag_get_list_export(), dt_tag_get_suggestions(), dt_tag_get_with_usage(), dt_tag_repository_get_attached(), dt_tag_repository_get_attached_for_export(), dt_tag_repository_get_by_path_with_counts(), dt_tag_repository_get_collection_tags(), dt_tag_repository_get_similar(), dt_tag_repository_get_suggestions(), dt_tag_repository_get_with_usage(), dt_timer_start_with_name(), dt_timer_stop_with_name(), f(), find_nearest_on_curve_t(), gauss_solve_triangular(), get_samples(), get_scales(), get_tint_from_tinted_xy(), HSV_2_RGB(), illum_xy_callback(), illuminant_CCT_to_RGB(), illuminant_to_xy(), interpolate_cubic_bezier(), interpolate_paths(), lerp_lookup_unbounded(), mix(), mix_warps(), mutate(), parse_cube_line(), planckian_normal(), point_at_arc_length(), pointer_swap_f(), polar_decomposition(), process(), process(), process(), process_cl(), process_vng_cl(), process_wavelets(), process_wavelets_cl(), sinf_fast(), spline_cubic_set(), spline_cubic_set_internal(), spline_cubic_val(), thinplate_match(), tiling_callback(), update_approx_cct(), vng_interpolate(), xlog(), xoshiro128plus(), and xoshiro128plus().

◆ unbounded_coeffs

◆ v

const float v

Definition at line 536 of file colorprofiles/iop_profile.h.

Referenced by __attribute__(), __attribute__(), __attribute__(), __attribute__(), _apply_matrix(), _bind_text(), _clamp01(), _clamp01(), _cleanup_metadata_value(), _collect_sorted_tree_names(), _column_text(), _column_text_or_null(), _ellipse_points_to_transform(), _filmic_is_agx(), _get_iso8601_int(), _get_lines_hash(), _gradient_get_mask(), _gradient_get_mask_roi(), _gradient_get_points(), _group_get_mask(), _image_distance_transform(), _k_assemble(), _lib_duplicate_init_callback(), _linear_channel_to_u8(), _list_custom_models(), _lrop(), _mapping_profile_value(), _mm_vectorGetByIndex(), _name_value_new(), _picker_project_opponent_to_display_rgb(), _piwigo_album_changed(), _points_to_transform(), _polygon_get_mask(), _polygon_get_mask_roi(), _polygon_get_pts_border(), _populate_list(), _sanitize_confgen(), _scalar(), _toggle_expanded(), _unet_forward(), _unet_forward_cl(), _xmp_append_colorlabel(), amaze_demosaic_RT(), blur_vertical_1wide(), blur_vertical_1wide_Kahan(), cleanup_global(), color_picker_helper_bayer_parallel(), color_picker_helper_bayer_seq(), color_picker_helper_xtrans_parallel(), color_picker_helper_xtrans_seq(), compute_features(), CurveDataSampleV2(), CurveDataSampleV2Periodic(), dsvd(), dt_cairo_sharpen_surface_rgb24(), dt_collection_name_value_free(), dt_colorrings_gray_basis_to_rgb(), dt_colorrings_rgb_to_gray_cyl(), dt_dev_pixelpipe_set_changed(), dt_drawlayer_brush_profile_clamp01(), dt_drawlayer_widgets_draw_picker(), dt_image_distance_transform(), dt_image_repository_get_versions(), dt_image_version_free(), dt_imageio_open_pfm(), dt_points_get_for(), dt_print_file(), dt_pwstorage_kwallet_get(), dt_set_xmp_dt_metadata(), dt_view_manager_button_pressed(), dt_view_manager_button_released(), dt_view_manager_configure(), dt_view_manager_key_pressed(), dt_view_manager_mouse_leave(), dt_view_manager_mouse_moved(), dt_view_manager_switch(), get_blocksizes(), get_double(), get_float(), homography(), HSV_2_RGB(), load_add_16wide(), load_add_16wide_Kahan(), load_add_Nwide_Kahan(), load_update_max_16wide(), load_update_min_16wide(), local_laplacian_internal(), mat3mulv(), mat4mulv(), model_fitness(), multiply_id_v(), multiply_il_v(), multiply_minus_v_d(), multiply_v_il(), normalize(), panels_get_panel_path(), polar_decomposition(), process(), process(), process_cl(), process_markesteijn_cl(), read_pfm(), set_grad_from_points(), set_points_from_grad(), simplex(), solve(), PermutohedralLattice< D, VD >::splat(), sub_16wide_Kahan(), sub_Nwide_Kahan(), thinplate_match(), vec3isnull(), vec3lnorm(), vec3norm(), views(), xtrans_fdc_interpolate(), and xtrans_markesteijn_interpolate().

◆ x

const float x
Initial value:
{
return coeff[1] * powf(x * coeff[0], coeff[2])
static const float x
const float *const const float coeff[3]

Definition at line 559 of file colorprofiles/iop_profile.h.

Referenced by __attribute__(), __attribute__(), __attribute__(), __attribute__(), __attribute__(), __attribute__(), __attribute__(), __OMP_DECLARE_SIMD__(), __OMP_DECLARE_SIMD__(), __OMP_DECLARE_SIMD__(), __OMP_DECLARE_SIMD__(), __OMP_DECLARE_SIMD__(), __OMP_DECLARE_SIMD__(), __OMP_DECLARE_SIMD__(), __OMP_DECLARE_SIMD__(), __OMP_DECLARE_SIMD__(), _add_node(), _add_node(), _add_node(), _add_node(), _add_node(), _add_node_from_picker(), _align_lcm(), _aniso_chroma(), _aniso_iterate_obs(), _aniso_stage_cl_selftest(), _aniso_tensor(), _apply_mix(), _apply_mono_grain_kernel(), _apply_smudge_stroke_mode(), _area_button_press_callback(), _area_button_press_callback(), _area_draw_callback(), _area_draw_callback(), _area_motion_notify_callback(), _area_motion_notify_callback(), _auto_levels(), _auto_set_illuminant(), _bh_get_active_region(), _bh_round_to_n_digits(), _biharmonic_dome(), _bin_pickers_histogram(), _bin_pickers_vectorscope(), _bin_pickers_waveforms(), _blendop_masks_group_query_tooltip(), _brush_events_button_released(), _brush_events_post_expose(), _brush_falloff(), _brush_falloff_roi(), _brush_initial_source_pos(), _brush_line_point_at_length(), _brush_profile_cell_rect(), _brush_profile_geometry(), _build_cat16_rgb_matrix(), _build_clut(), _build_viewer_control_nodes(), _build_xtrans_bilinear_lookup(), _cellular_grain_2d(), _center_view_free_zoom(), _cf_adaptive_tensor(), _cf_harmonic_fill_cl_selftest(), _cf_harmonic_fill_n(), _cf_joint_stage_cl_selftest(), _cf_stage_cl_selftest(), _chromaticity_gradient_stage_cl_selftest(), _circle_get_distance(), _circle_get_mask_roi(), _circle_get_points(), _circle_get_points_border(), _circle_get_points_source(), _circle_initial_source_pos(), _CLAMP(), _cmp_image_imgid(), _cmp_mip_size(), _cmp_pixel_size(), _color_picker_set_from_position(), _colorspaces_create_transfer(), _create_crystal_kernel(), _cursor_curve_state(), _curve_to_mouse(), _curve_to_mouse(), _darkroom_pickers_draw(), _darkroom_set_default_cursor(), _develop_blend_process_mask_tone_curve(), _distort_xtransform(), _do_drop(), _downsample_bayer_half_size(), _downsample_xtrans_half_size(), _drag_and_drop_received(), _drag_and_drop_received(), _drag_motion_received(), _draw_brush_hud(), _draw_cube(), _draw_curve(), _draw_end_marker(), _draw_graph_background(), _draw_near_point(), _draw_sym(), _dt_masks_events_set_current_pos(), _ellipse_draw_handles(), _ellipse_draw_shape(), _ellipse_get_distance(), _ellipse_get_points_border(), _ellipse_initial_source_pos(), _ellipse_point_close_to_path(), _ellipse_point_transform(), _ellipse_points_to_transform(), _event_dnd_motion(), _event_dnd_received(), _extract_luminance_kernel(), _extract_patches(), _extract_pointer_input(), _extract_rgb_kernels(), _fill_box_values(), _fill_mask(), _filmstrip_position_to_rowid(), _filmstrip_rowid_to_position(), _finalize_color_grain_kernel(), _gelu(), _get_active_marker_from_screen(), _get_active_marker_internal(), _get_auto_exp_histogram(), _get_control(), _get_position_from_screen(), _gradient_get_distance(), _gradient_get_mask(), _gradient_get_mask_roi(), _gradient_get_points(), _gradient_get_pts_border(), _gradient_is_canonical(), _graph_background_hsb(), _grid_rowid_to_position(), _group_get_mask(), _guides_draw_diagonal_method(), _guides_draw_grid(), _guides_draw_harmonious_triangles(), _guides_draw_metering(), _guides_draw_perspective(), _guides_draw_rules_of_thirds(), _hf_stage_cl_selftest(), _HLG_fct(), _hm_report_drag_data_received(), _init_widgets(), _interpolate_and_mask_xtrans(), _ioporder_draw_label(), _ioporder_draw_rounded_rect(), _ioporder_graph_draw(), _ioporder_rebuild_graph(), _is_in_frame(), _joint_core_stage_cl_selftest(), _k_assemble(), _k_avg2x2(), _k_bilerp_add(), _k_bin16_mdv(), _k_blend_crop(), _k_floor_fuse(), _k_fuse_step(), _knee_lift_of(), _lap5(), _lcm(), _lens_fill_vignette_row(), _lib_history_view_query_tooltip(), _lib_navigation_set_position(), _lib_tagging_tag_show_accel(), _linear_channel_to_u8(), _lrop(), _mapping_profile_value(), _mask_indicator_tooltip(), _masks_gui_menu_item_forward_event(), _menu_icon_draw(), _mm_exp2_ps(), _mm_log2_ps(), _mm_pow_ps(), _mm_pow_ps1(), _mouse_to_curve(), _mouse_to_curve(), _move_point_internal(), _move_selected_node(), _nm_fitness(), _paint_hue(), _points_to_transform(), _points_to_transform(), _polygon_crop_to_roi(), _polygon_events_post_expose(), _polygon_falloff(), _polygon_falloff_roi(), _polygon_get_mask_roi(), _polygon_get_sizes(), _polygon_initial_source_pos(), _position_to_rowid(), _PQ_fct(), _prepare_analytic_pixel_context(), _prepare_blur_context(), _prepare_resampling_plan(), _process(), _process_vectorscope(), _project_point(), _read_pbm(), _read_pgm(), _read_ppm(), _rect_contains_with_margin(), _region_composite(), _region_gather(), _region_guided_filter_cl_selftest(), _render_brush_profile_cell(), _render_preview_surface(), _resync_pipe_with_history(), _row_tooltip_setup(), _row_tooltip_setup(), _rowid_to_position(), _sample_picker_luminance_mask(), _sanity_check(), _sanity_check(), _selfdome_stage_cl_selftest(), _set_vector(), _simplex_2d_noise(), _simulate_channel(), _simulate_color(), _smudge_hash_signed(), _snap_to_grid(), _sp_chol_cl_selftest(), _sp_row_l9(), _sp_row_op(), _splash_draw(), _sprinkle_noise_at_pixel_precomputed(), _srgb_to_display_row(), _studio_image_norm_to_widget(), _studio_style_pool_query_tooltip(), _studio_style_styles_query_tooltip(), _studio_toggle_zoom(), _studio_widget_to_image_norm(), _temperature_to_xy(), _tonecurve_apply(), _transform_rgba8_to_bgra8(), _translate_cursor(), _tree_query_tooltip(), _update_darkroom_roi(), _update_RGB_colors(), _upsample_bilinear(), _view_drag_data_received(), _view_drag_motion(), _view_map_drag_motion_callback(), _view_map_get_entry_at_pos(), _view_map_get_imgs_at_pos(), _write_pixel(), _zoom_and_center(), add_to_global_distortion_map(), apply_global_distortion_map(), apply_homography(), apply_homography_scaling(), area_draw(), area_motion_notify(), backtransform(), backtransform(), backtransform(), backtransform(), backtransform_v2(), backtransform_Y0U0V0(), bicubic(), blackbody_xy_to_tinted_xy(), blur_horizontal_1ch(), blur_horizontal_2ch(), blur_horizontal_4ch(), blur_horizontal_4ch_Kahan(), blur_horizontal_Nch_Kahan(), blur_vertical_1ch(), box_max_1d(), box_min_1d(), build_lookup_table(), build_round_stamp(), button_pressed(), button_pressed(), button_pressed(), button_pressed(), button_pressed(), button_released(), button_released(), button_released(), button_released(), button_released(), cairo_surface_create_from_xyz_data(), catmull_rom_set(), catmull_rom_val(), cbf(), CCT_reverse_lookup(), CCT_to_xy_blackbody(), CCT_to_xy_daylight(), CDL(), ceil_fast(), clamp_range_f(), clamp_simd(), clampnan(), clipnan(), color_picker_apply(), commit_params(), commit_params(), commit_params(), compare_L_source(), compute_features(), compute_lut_correction(), create_gauss_kernel(), create_global_distortion_map(), create_lens_kernel(), create_motion_kernel(), crop_fitness(), curve_scalar(), CurveDataSample(), d3_np_fs(), demosaic_ppg(), distort_backtransform(), distort_mask(), distort_transform(), draw_box(), draw_circle(), draw_overlay(), draw_rectangle(), draw_slider_line(), draw_triangle(), dsvd(), dt_bauhaus_draw_quad(), dt_cairo_sharpen_surface_rgb24(), dt_calculator_solve(), dt_colorrings_curve_periodic_sample(), dt_colorrings_curve_x_to_hue(), dt_colorrings_eval_local_field(), dt_colorrings_eval_sparse_local_field(), dt_colorrings_fill_lut_local_field(), dt_colorrings_fill_lut_sparse_local_field(), dt_colorrings_wrap_pi(), dt_colorspaces_create_xyzmatrix_profile(), dt_control_button_pressed(), dt_control_button_released(), dt_control_merge_hdr_process(), dt_control_mouse_moved(), dt_curve_to_mouse(), dt_dev_pixelpipe_has_preview_output(), dt_dev_toolbox_show_popup(), dt_develop_blendif_init_masking_profile(), dt_develop_blendif_lab_make_mask(), dt_develop_blendif_raw_make_mask(), dt_develop_blendif_rgb_hsl_make_mask(), dt_develop_blendif_rgb_jzczhz_make_mask(), dt_draw_cairo_to_gdk_pixbuf(), dt_draw_cross(), dt_draw_curve_add_point(), dt_draw_curve_calc_value(), dt_draw_curve_calc_values(), dt_draw_curve_calc_values_V2(), dt_draw_curve_calc_values_V2_nonperiodic(), dt_draw_curve_calc_values_V2_periodic(), dt_draw_curve_set_point(), dt_draw_curve_smaple_values(), dt_draw_histogram_8_logxliny(), dt_draw_histogram_8_logxlogy(), dt_draw_loglog_grid(), dt_draw_node(), dt_draw_plus_sign(), dt_draw_rounded_rectangle_path(), dt_draw_semilog_x_grid(), dt_draw_semilog_y_grid(), dt_draw_star(), dt_drawlayer_brush_rasterize(), dt_drawlayer_brush_rasterize_dab_argb8(), dt_drawlayer_brush_rasterize_dab_rgbaf(), dt_drawlayer_cache_populate_process_patch_from_base(), dt_drawlayer_io_load_flat_rgba(), dt_drawlayer_layer_to_widget_coords(), dt_drawlayer_paint_runtime_get_smudge_pickup(), dt_drawlayer_paint_runtime_set_smudge_pickup(), dt_drawlayer_widgets_draw_swatch(), dt_drawlayer_widgets_pick_brush_profile(), dt_drawlayer_widgets_pick_history_color(), dt_drawlayer_widgets_update_from_picker_position(), dt_fast_expf_4wide(), dt_fast_mexp2f(), dt_focus_draw_clusters(), dt_focuspeaking(), dt_get_printer_info(), dt_gpx_geodesic_intermediate_point(), dt_gui_draw_rounded_rectangle(), dt_gui_gtk_write_config(), dt_guides_draw_diagonal_method(), dt_guides_draw_grid(), dt_guides_draw_metering(), dt_image_distance_transform(), dt_imageio_has_mono_preview(), dt_imageio_open_avif(), dt_imageio_open_heif(), dt_interpolation_compute_pixel4c(), dt_interpolation_compute_sample(), dt_iop_basecurve_button_press(), dt_iop_basecurve_draw(), dt_iop_basecurve_motion_notify(), dt_iop_clip_and_zoom_8(), dt_iop_clip_and_zoom_demosaic_half_size_f(), dt_iop_clip_and_zoom_demosaic_passthrough_monochrome_f(), dt_iop_clip_and_zoom_demosaic_third_size_xtrans_f(), dt_iop_clip_and_zoom_mosaic_half_size(), dt_iop_clip_and_zoom_mosaic_half_size_f(), dt_iop_clip_and_zoom_mosaic_third_size_xtrans(), dt_iop_clip_and_zoom_mosaic_third_size_xtrans_f(), dt_iop_colorreconstruct_bilateral_slice(), dt_iop_colorreconstruct_bilateral_splat(), dt_iop_estimate_cubic(), dt_iop_estimate_exp(), dt_iop_eval_cubic(), dt_iop_eval_exp(), dt_iop_filmic_rgb_compute_spline(), dt_iop_monochrome_draw(), dt_iop_tonecurve_button_press(), dt_iop_tonecurve_draw(), dt_iop_tonecurve_draw(), dt_iop_tonecurve_draw(), dt_iop_tonecurve_draw(), dt_iop_tonecurve_motion_notify(), dt_ioppr_get_trc_cl(), dt_ioppr_init_unbounded_coeffs(), dt_log_scale_axis(), dt_masks_events_button_pressed(), dt_masks_events_button_released(), dt_masks_events_mouse_moved(), dt_masks_events_mouse_scrolled(), dt_nn_bin_planes(), dt_nn_upsample_nearest(), dt_printing_get_image_box(), dt_printing_setup_box(), dt_thumbtable_dispatch_over(), dt_thumbtable_get_scroll_position(), dt_thumbtable_scroll_to_position(), dt_thumbtable_scroll_to_rowid(), dt_thumbtable_set_active_rowid(), dt_view_manager_button_pressed(), dt_view_manager_button_released(), dt_view_manager_mouse_moved(), dt_view_manager_scrolled(), dtgtk_cairo_paint_color(), dtgtk_cairo_paint_eye(), dtgtk_cairo_paint_plus(), eaw_decompose(), eaw_dn_decompose(), encode_tonecurve(), envelope(), eval_grey(), eval_grey(), exp_tonemapping_v2(), extract_color_checker(), f(), f_inv_sqrtf(), fast_exp10f(), fast_expf(), fast_mexp2f(), fastlog(), fastlog2(), fib_latt(), find_closest_corner(), find_nearest_on_curve_t(), find_nearest_on_line_t(), find_temperature_from_raw_coeffs(), fit_curve(), flip(), gamma2(), gaussian(), gaussian_sampler(), get_contrast(), get_gamma(), get_luminance_from_buffer(), get_lut_contrast(), get_lut_gamma(), get_pixel(), get_pixel_region(), get_point_scale(), get_points(), get_slider_line_offset(), get_theta(), get_tint_from_tinted_xy(), get_xyz_sample_from_image(), green_equilibration_favg(), green_equilibration_lavg(), gui_draw_sym(), gui_post_expose(), gui_post_expose(), handle_motion(), homography(), igamma2(), illuminant_CCT_to_RGB(), illuminant_color_draw(), illuminant_to_xy(), illuminant_xy_to_RGB(), illuminant_xy_to_XYZ(), image_lab_to_xyz(), image_to_grid(), interpol::Catmull_Rom_spline< T >::init(), interpol::monotone_hermite_spline< T >::init(), interpol::monotone_hermite_spline_variant< T >::init(), interpol::smooth_cubic_spline< T >::init(), init_presets(), inter_hi(), inter_low(), interpolate_set(), interpolate_val(), interpolate_val_V2(), interpolate_val_V2_periodic(), isaligned(), kernel(), kth_smallest(), lab_f(), lab_f(), lab_f_inv(), lab_f_inv(), ldexpk(), legacy_params(), lerp_lookup_unbounded(), limf(), lin_interpolate(), linear_saturation(), linearize_16bit(), linearize_8bit(), ll_angle(), Log2(), Log2Thres(), log_gamma_lanczos(), log_gamma_windschitl(), log_tonemapping(), logit(), lookup(), lookup_gamut(), lookup_unbounded(), main(), map_mouse_to_0_1(), mat3mul(), mat3mulv(), mat3SSEmul(), mat4mulv(), mitchell(), modify_roi_in(), modify_roi_in(), modify_roi_out(), modify_roi_out(), monotone_hermite_set(), mouse_in_actionarea(), mouse_in_imagearea(), mouse_moved(), mouse_moved(), mouse_moved(), mouse_moved(), mouse_moved(), mouse_moved(), mutate(), nmsfit(), interpol::spline_base< T >::operator()(), paint_chroma_slider(), parse_cht(), planckian_normal(), polar_decomposition(), precision(), process(), process(), process(), process(), process(), process_cl(), process_filmic(), process_fusion(), process_vng_cl(), rcd_ppg_border(), reduce_region_radius(), refine(), region2rect(), region_grow(), rol32(), rol32(), rotate_x(), rotate_xy(), rotate_y(), round5(), roundToNextPowerOfTwo(), rt_compute_roi_in(), rt_masks_form_is_in_roi(), scrolled(), scrolled(), show_pango_text(), sign(), soft_clip(), solve_hermitian(), interpol::spline_base< T >::spline_base(), SQR(), SQR(), swap(), test_clamp_simd(), test_filmic_desaturate_v1(), testimg_gen_grey_max_dr(), testimg_gen_grey_max_dr_neg(), testimg_gen_grey_space(), testimg_gen_grey_with_rgb_clipping(), testimg_gen_rgb_space(), testimg_gen_single_color_space(), testimg_gen_three_color_space(), testimg_print_by_pixel(), testimg_print_chan(), thinplate_kernel(), to_lin(), to_lin(), to_log(), to_log(), transform(), transform(), triangular_ascent_fast(), triangular_ascent_safe(), update_approx_cct(), update_corner(), update_xy_color(), vng_interpolate(), WB_coeffs_to_illuminant_xy(), window_max(), window_min(), write_image(), write_image(), write_image(), write_image(), write_image(), write_image(), xdiv2f(), xdivf(), xlog(), xmul2f(), xtrans_fdc_interpolate(), xtrans_markesteijn_interpolate(), and xy_to_CCT().