![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include <assert.h>#include <math.h>#include <stdlib.h>#include <string.h>#include "common/colorspaces_inline_conversions.h"#include "common/opencl.h"#include "control/control.h"#include "develop/develop.h"#include "gui/gtk.h"#include "iop/iop_api.h"
Include dependency graph for gamma.c:Go to the source code of this file.
Data Structures | |
| struct | dt_iop_gamma_params_t |
| This module converts float32 RGBA pixels to uint8 BGRA pixels, for GUI pipelines only (darkroom main preview and navigation thumbnail). It self-disables for export pipelines. More... | |
| struct | dt_iop_gamma_global_data_t |
| struct | dt_iop_gamma_mask_preview_t |
| Shared appearance of mask previews rendered by the display encoding module. More... | |
Typedefs | |
| typedef struct dt_iop_gamma_params_t | dt_iop_gamma_params_t |
| This module converts float32 RGBA pixels to uint8 BGRA pixels, for GUI pipelines only (darkroom main preview and navigation thumbnail). It self-disables for export pipelines. | |
| typedef struct dt_iop_gamma_global_data_t | dt_iop_gamma_global_data_t |
| typedef enum dt_iop_gamma_kernel_mode_t | dt_iop_gamma_kernel_mode_t |
| typedef enum dt_iop_gamma_false_color_t | dt_iop_gamma_false_color_t |
| typedef struct dt_iop_gamma_mask_preview_t | dt_iop_gamma_mask_preview_t |
| Shared appearance of mask previews rendered by the display encoding module. | |
Enumerations | |
| enum | dt_iop_gamma_kernel_mode_t { DT_IOP_GAMMA_KERNEL_COPY = 0 , DT_IOP_GAMMA_KERNEL_MASK = 1 , DT_IOP_GAMMA_KERNEL_CHANNEL_MONO = 2 , DT_IOP_GAMMA_KERNEL_CHANNEL_FALSE_COLOR = 3 } |
| enum | dt_iop_gamma_false_color_t { DT_IOP_GAMMA_FALSE_COLOR_MONO = 0 , DT_IOP_GAMMA_FALSE_COLOR_A = 1 , DT_IOP_GAMMA_FALSE_COLOR_B = 2 , DT_IOP_GAMMA_FALSE_COLOR_R = 3 , DT_IOP_GAMMA_FALSE_COLOR_G = 4 , DT_IOP_GAMMA_FALSE_COLOR_B_CH = 5 , DT_IOP_GAMMA_FALSE_COLOR_C = 6 , DT_IOP_GAMMA_FALSE_COLOR_LCH_H = 7 , DT_IOP_GAMMA_FALSE_COLOR_HSL_H = 8 , DT_IOP_GAMMA_FALSE_COLOR_JZ_HZ = 9 } |
Functions | |
| const char * | name () |
| int | default_group () |
| int | flags () |
| int | default_colorspace (dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece) |
| void | input_format (dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece, dt_iop_buffer_dsc_t *dsc) |
| void | output_format (dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece, dt_iop_buffer_dsc_t *dsc) |
| static void | _write_pixel (const float *const restrict in, uint8_t *const restrict out, const dt_iop_gamma_mask_preview_t *const preview, const size_t pixel_index, const float alpha) |
| Blend one linear RGB pixel with its mask checker and encode it for display. | |
| __OMP_DECLARE_SIMD__ (aligned(pixel:16) uniform(norm)) | |
| __OMP_DECLARE_SIMD__ (aligned(XYZ, sRGB:16) uniform(norm)) | |
| static __DT_CLONE_TARGETS__ void | _channel_display_monochrome (const float *const restrict in, uint8_t *const restrict out, const size_t buffsize, const float alpha, const dt_iop_gamma_mask_preview_t *const preview) |
| static __DT_CLONE_TARGETS__ void | _channel_display_false_color (const float *const restrict in, uint8_t *const restrict out, const size_t buffsize, const float alpha, dt_dev_pixelpipe_display_mask_t channel, const dt_iop_gamma_mask_preview_t *const preview) |
| static __DT_CLONE_TARGETS__ void | _mask_display (const float *const restrict in, uint8_t *const restrict out, const size_t buffsize, const float alpha, const dt_iop_gamma_mask_preview_t *const preview) |
| static __DT_CLONE_TARGETS__ void | _copy_output (const float *const restrict in, uint8_t *const restrict out, const size_t buffsize) |
| int | process (struct dt_iop_module_t *self, const dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece, const void *const i, void *const o) |
| static int | _false_color_channel_to_kernel_code (const dt_dev_pixelpipe_display_mask_t mask_display) |
| int | process_cl (struct dt_iop_module_t *self, const dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece, cl_mem dev_in, cl_mem dev_out) |
| void | init_global (dt_iop_module_so_t *module) |
| void | cleanup_global (dt_iop_module_so_t *module) |
| void | init (dt_iop_module_t *module) |
| void | init_pipe (struct dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece) |
| void | cleanup_pipe (struct dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece) |
| void | commit_params (dt_iop_module_t *self, dt_iop_params_t *params, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece) |
| typedef enum dt_iop_gamma_false_color_t dt_iop_gamma_false_color_t |
| typedef struct dt_iop_gamma_global_data_t dt_iop_gamma_global_data_t |
| typedef enum dt_iop_gamma_kernel_mode_t dt_iop_gamma_kernel_mode_t |
| typedef struct dt_iop_gamma_mask_preview_t dt_iop_gamma_mask_preview_t |
Shared appearance of mask previews rendered by the display encoding module.
The checker colors remain in linear RGB until they are blended with the image so this path matches module-authored previews that continue through display encoding.
| typedef struct dt_iop_gamma_params_t dt_iop_gamma_params_t |
This module converts float32 RGBA pixels to uint8 BGRA pixels, for GUI pipelines only (darkroom main preview and navigation thumbnail). It self-disables for export pipelines.
| __OMP_DECLARE_SIMD__ | ( | aligned(pixel:16) uniform(norm) | ) |
Definition at line 182 of file gamma.c.
References factor, for_each_channel, and x.
| __OMP_DECLARE_SIMD__ | ( | aligned(XYZ, sRGB:16) uniform(norm) | ) |
Definition at line 191 of file gamma.c.
References dt_XYZ_to_Rec709_D50(), sRGB, and XYZ.
|
static |
Definition at line 212 of file gamma.c.
References __OMP_PARALLEL_FOR__, __OMP_PARALLEL_FOR_SIMD__, _channel_display_monochrome(), _write_pixel(), DT_DEV_PIXELPIPE_DISPLAY_a, DT_DEV_PIXELPIPE_DISPLAY_ANY, DT_DEV_PIXELPIPE_DISPLAY_b, DT_DEV_PIXELPIPE_DISPLAY_B, DT_DEV_PIXELPIPE_DISPLAY_G, DT_DEV_PIXELPIPE_DISPLAY_GRAY, DT_DEV_PIXELPIPE_DISPLAY_HSL_H, DT_DEV_PIXELPIPE_DISPLAY_HSL_l, DT_DEV_PIXELPIPE_DISPLAY_HSL_S, DT_DEV_PIXELPIPE_DISPLAY_JzCzhz_Cz, DT_DEV_PIXELPIPE_DISPLAY_JzCzhz_hz, DT_DEV_PIXELPIPE_DISPLAY_JzCzhz_Jz, DT_DEV_PIXELPIPE_DISPLAY_L, DT_DEV_PIXELPIPE_DISPLAY_LCH_C, DT_DEV_PIXELPIPE_DISPLAY_LCH_h, DT_DEV_PIXELPIPE_DISPLAY_OUTPUT, DT_DEV_PIXELPIPE_DISPLAY_R, dt_Lab_to_XYZ(), JzAzBz, out, value, and XYZ_D65.
Referenced by process().
|
static |
Definition at line 199 of file gamma.c.
References __OMP_PARALLEL_FOR_SIMD__, _write_pixel(), and out.
Referenced by _channel_display_false_color(), and process().
|
static |
Definition at line 347 of file gamma.c.
References __OMP_PARALLEL_FOR_SIMD__, and out.
Referenced by process().
|
static |
Definition at line 422 of file gamma.c.
References DT_DEV_PIXELPIPE_DISPLAY_a, DT_DEV_PIXELPIPE_DISPLAY_ANY, DT_DEV_PIXELPIPE_DISPLAY_b, DT_DEV_PIXELPIPE_DISPLAY_B, DT_DEV_PIXELPIPE_DISPLAY_G, DT_DEV_PIXELPIPE_DISPLAY_GRAY, DT_DEV_PIXELPIPE_DISPLAY_HSL_H, DT_DEV_PIXELPIPE_DISPLAY_HSL_l, DT_DEV_PIXELPIPE_DISPLAY_HSL_S, DT_DEV_PIXELPIPE_DISPLAY_JzCzhz_Cz, DT_DEV_PIXELPIPE_DISPLAY_JzCzhz_hz, DT_DEV_PIXELPIPE_DISPLAY_JzCzhz_Jz, DT_DEV_PIXELPIPE_DISPLAY_L, DT_DEV_PIXELPIPE_DISPLAY_LCH_C, DT_DEV_PIXELPIPE_DISPLAY_LCH_h, DT_DEV_PIXELPIPE_DISPLAY_OUTPUT, DT_DEV_PIXELPIPE_DISPLAY_R, DT_IOP_GAMMA_FALSE_COLOR_A, DT_IOP_GAMMA_FALSE_COLOR_B, DT_IOP_GAMMA_FALSE_COLOR_B_CH, DT_IOP_GAMMA_FALSE_COLOR_C, DT_IOP_GAMMA_FALSE_COLOR_G, DT_IOP_GAMMA_FALSE_COLOR_HSL_H, DT_IOP_GAMMA_FALSE_COLOR_JZ_HZ, DT_IOP_GAMMA_FALSE_COLOR_LCH_H, DT_IOP_GAMMA_FALSE_COLOR_MONO, and DT_IOP_GAMMA_FALSE_COLOR_R.
Referenced by process_cl().
|
static |
Definition at line 329 of file gamma.c.
References __OMP_PARALLEL_FOR_SIMD__, _write_pixel(), dt_iop_gamma_mask_preview_t::black_and_white, and out.
Referenced by process().
|
inlinestatic |
Blend one linear RGB pixel with its mask checker and encode it for display.
Definition at line 156 of file gamma.c.
References out, value, dt_iop_gamma_mask_preview_t::width, and x.
Referenced by _channel_display_false_color(), _channel_display_monochrome(), and _mask_display().
| void cleanup_global | ( | dt_iop_module_so_t * | module | ) |
Definition at line 537 of file gamma.c.
References dt_iop_module_so_t::data, dt_free, dt_opencl_free_kernel(), and dt_iop_gamma_global_data_t::kernel_gamma_pack.
| void cleanup_pipe | ( | struct dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
| void commit_params | ( | dt_iop_module_t * | self, |
| dt_iop_params_t * | params, | ||
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 566 of file gamma.c.
References DT_DEV_PIXELPIPE_FULL, DT_DEV_PIXELPIPE_PREVIEW, dt_dev_pixelpipe_iop_t::enabled, and dt_dev_pixelpipe_t::type.
| int default_colorspace | ( | dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| const dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 114 of file gamma.c.
References IOP_CS_RGB_DISPLAY.
| int default_group | ( | ) |
Definition at line 104 of file gamma.c.
References IOP_GROUP_TECHNICAL.
| int flags | ( | ) |
Definition at line 109 of file gamma.c.
References IOP_FLAGS_HIDDEN, IOP_FLAGS_NO_HISTORY_STACK, IOP_FLAGS_ONE_INSTANCE, and IOP_FLAGS_UNSAFE_COPY.
| void init | ( | dt_iop_module_t * | module | ) |
| void init_global | ( | dt_iop_module_so_t * | module | ) |
Definition at line 528 of file gamma.c.
References dt_opencl_create_kernel(), and dt_iop_gamma_global_data_t::kernel_gamma_pack.
| void init_pipe | ( | struct dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 556 of file gamma.c.
References dt_dev_pixelpipe_iop_t::data, and dt_dev_pixelpipe_iop_t::data_size.
| void input_format | ( | dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece, | ||
| dt_iop_buffer_dsc_t * | dsc | ||
| ) |
Definition at line 119 of file gamma.c.
References dt_iop_buffer_dsc_t::channels, dt_iop_buffer_dsc_t::datatype, default_input_format(), and TYPE_FLOAT.
| void output_format | ( | dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece, | ||
| dt_iop_buffer_dsc_t * | dsc | ||
| ) |
Definition at line 127 of file gamma.c.
References dt_iop_buffer_dsc_t::channels, dt_iop_buffer_dsc_t::cst, dt_iop_buffer_dsc_t::datatype, and TYPE_UINT8.
| int process | ( | struct dt_iop_module_t * | self, |
| const dt_dev_pixelpipe_t * | pipe, | ||
| const dt_dev_pixelpipe_iop_t * | piece, | ||
| const void *const | i, | ||
| void *const | o | ||
| ) |
Definition at line 361 of file gamma.c.
References _channel_display_false_color(), _channel_display_monochrome(), _copy_output(), _mask_display(), dt_iop_gamma_mask_preview_t::checker_color_1, dt_conf_get_bool(), dt_conf_get_float(), dt_conf_get_int(), dt_conf_is_equal(), DT_DEV_PIXELPIPE_DISPLAY_ANY, DT_DEV_PIXELPIPE_DISPLAY_CHANNEL, DT_DEV_PIXELPIPE_DISPLAY_MASK, DT_PIXEL_APPLY_DPI, dt_iop_roi_t::height, i, dt_dev_pixelpipe_t::mask_display, MAX, dt_dev_pixelpipe_iop_t::roi_out, and dt_iop_roi_t::width.
| int process_cl | ( | struct dt_iop_module_t * | self, |
| const dt_dev_pixelpipe_t * | pipe, | ||
| const dt_dev_pixelpipe_iop_t * | piece, | ||
| cl_mem | dev_in, | ||
| cl_mem | dev_out | ||
| ) |
Definition at line 455 of file gamma.c.
References _false_color_channel_to_kernel_code(), dt_dev_pixelpipe_t::devid, dt_conf_get_bool(), dt_conf_get_float(), dt_conf_get_int(), dt_conf_is_equal(), DT_DEBUG_OPENCL, DT_DEV_PIXELPIPE_DISPLAY_ANY, DT_DEV_PIXELPIPE_DISPLAY_CHANNEL, DT_DEV_PIXELPIPE_DISPLAY_MASK, DT_IOP_GAMMA_FALSE_COLOR_MONO, DT_IOP_GAMMA_KERNEL_CHANNEL_FALSE_COLOR, DT_IOP_GAMMA_KERNEL_CHANNEL_MONO, DT_IOP_GAMMA_KERNEL_COPY, DT_IOP_GAMMA_KERNEL_MASK, dt_opencl_enqueue_kernel_2d(), dt_opencl_set_kernel_arg(), DT_PIXEL_APPLY_DPI, dt_print(), FALSE, dt_iop_module_t::global_data, height, dt_iop_roi_t::height, dt_iop_gamma_global_data_t::kernel_gamma_pack, dt_dev_pixelpipe_t::mask_display, MAX, dt_dev_pixelpipe_iop_t::roi_out, ROUNDUPDHT, ROUNDUPDWD, TRUE, width, and dt_iop_roi_t::width.