Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
luminance_mask.h File Reference
#include <assert.h>
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include "common/darktable.h"
#include "develop/imageop_math.h"
+ Include dependency graph for luminance_mask.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MIN_FLOAT   exp2f(-16.0f)
 
#define LOOP(fn)
 

Typedefs

typedef enum dt_iop_luminance_mask_method_t dt_iop_luminance_mask_method_t
 

Enumerations

enum  dt_iop_luminance_mask_method_t {
  DT_TONEEQ_MEAN = 0 ,
  DT_TONEEQ_LIGHTNESS ,
  DT_TONEEQ_VALUE ,
  DT_TONEEQ_NORM_1 ,
  DT_TONEEQ_NORM_2 ,
  DT_TONEEQ_NORM_POWER ,
  DT_TONEEQ_GEOMEAN ,
  DT_TONEEQ_LAST
}
 

Functions

static float linear_contrast (const float pixel, const float fulcrum, const float contrast)
 
 __OMP_DECLARE_SIMD__ (aligned(image, luminance:64) uniform(image, luminance)) static void pixel_rgb_mean(const float *const restrict image
 
 __OMP_SIMD__ (reduction(+:lum) aligned(image:64)) for(int c=0
 

Variables

float *const restrict luminance
 
float *const restrict const size_t k
 
float *const restrict const size_t const size_t ch
 
float *const restrict const size_t const size_t const float exposure_boost
 
float *const restrict const size_t const size_t const float const float fulcrum
 
float *const restrict const size_t const size_t const float const float const float contrast_boost
 

Macro Definition Documentation

◆ LOOP

#define LOOP (   fn)
Value:
{ \
for(size_t k = 0; k < num_elem; k += ch) \
{ \
} \
break; \
}
const dt_colormatrix_t dt_aligned_pixel_t out
Definition colorspaces_inline_conversions.h:42
float *const restrict const size_t const size_t const float const float fulcrum
Definition luminance_mask.h:80
float *const restrict const size_t const size_t const float exposure_boost
Definition luminance_mask.h:79
float *const restrict const size_t const size_t const float const float const float contrast_boost
Definition luminance_mask.h:81
float *const restrict const size_t k
Definition luminance_mask.h:78
float *const restrict const size_t const size_t ch
Definition luminance_mask.h:78

◆ MIN_FLOAT

#define MIN_FLOAT   exp2f(-16.0f)

Typedef Documentation

◆ dt_iop_luminance_mask_method_t

Enumeration Type Documentation

◆ dt_iop_luminance_mask_method_t

Enumerator
DT_TONEEQ_MEAN 
DT_TONEEQ_LIGHTNESS 
DT_TONEEQ_VALUE 
DT_TONEEQ_NORM_1 
DT_TONEEQ_NORM_2 
DT_TONEEQ_NORM_POWER 
DT_TONEEQ_GEOMEAN 
DT_TONEEQ_LAST 

Function Documentation

◆ __OMP_DECLARE_SIMD__()

__OMP_DECLARE_SIMD__ ( aligned(image, luminance:64) uniform(image, luminance ) const

◆ __OMP_SIMD__()

__OMP_SIMD__ ( reduction(+:lum) aligned(image:64)  )
pure virtual

◆ linear_contrast()

static float linear_contrast ( const float  pixel,
const float  fulcrum,
const float  contrast 
)
static

DOCUMENTATION

Lightness map computation

Flatten an RGB image into a lightness/luminance map (grey image) using several vector norms, and other pseudo-norms.

These functions are all written to be vectorizable, using the base image pointer and the explicit index of the current pixel. They perform exposure and contrast compensation as well, for better cache handling.

Buffers need to be 64-bits aligned.

The outputs are clipped to avoid negative and close-to-zero results that could backfire in the exposure computations.

References fulcrum, and MIN_FLOAT.

Variable Documentation

◆ ch

float* const restrict const size_t const size_t ch

Referenced by __attribute__(), _add_node_from_picker(), _apply_mix(), _apply_tonecurves(), _area_button_press_callback(), _area_button_press_callback(), _area_draw_callback(), _area_draw_callback(), _area_draw_callback(), _area_motion_notify_callback(), _area_motion_notify_callback(), _auto_levels(), _blendif_clean_output_channels(), _blendop_blendif_boost_factor_callback(), _blendop_blendif_polarity_callback(), _blendop_blendif_sliders_callback(), _blendop_blendif_sliders_reset_callback(), _blendop_blendif_update_tab(), _create_tooltip_text(), _develop_blend_process_feather(), _dt_focus_cdf22_wtf(), _generate_curve_lut(), _get_auto_exp_histogram(), _init_default_curves(), _iop_clipping_set_max_clip(), _lens_fill_vignette_row(), _move_point_internal(), _move_point_internal(), _move_point_internal(), _move_point_internal(), _process(), _reset_nodes(), _reset_parameters(), _retouch_blur_cl(), _retouch_clone_cl(), _retouch_heal_cl(), _sanitize_requested_layer_name(), _sanitize_requested_layer_name(), _scrolled(), _sync_private_buffer_from_preview_cache(), _transform_lab_to_rgb_matrix(), _transform_matrix_rgb(), _transform_rgb_to_lab_matrix(), _update_curve_cache(), _update_sample_label(), apply_global_distortion_map(), apply_toneequalizer(), area_draw(), area_motion_notify(), auto_detect_WB(), blend_color_picker_apply(), build_channel_basecurve(), cleanup_pipe(), color_picker_apply(), color_temptint_sliders(), commit_params(), commit_params(), compute_luminance_mask(), conv_num(), denoiseprofile_button_press(), denoiseprofile_draw(), display_luminance_mask(), dt_box_max(), dt_box_mean(), dt_box_mean_horizontal(), dt_box_mean_vertical(), dt_box_min(), dt_develop_blend_process(), dt_develop_blend_process_cl(), dt_dwt_init(), dt_gaussian_blur(), dt_heal(), dt_heal_cl(), dt_imageio_flip_buffers_ui8_to_float(), dt_iop_basecurve_button_press(), dt_iop_basecurve_motion_notify(), dt_iop_basecurve_sanity_check(), dt_iop_colorzones_get_params(), dt_iop_copy_image_roi(), dt_iop_denoiseprofile_get_params(), dt_iop_equalizer_iwtf(), dt_iop_equalizer_wtf(), dt_iop_gui_update_blendif(), dt_iop_image_add_const(), dt_iop_image_add_image(), dt_iop_image_alloc(), dt_iop_image_copy_by_size(), dt_iop_image_div_const(), dt_iop_image_fill(), dt_iop_image_invert(), dt_iop_image_linear_blend(), dt_iop_image_mul_const(), dt_iop_image_scaled_copy(), dt_iop_image_sub_image(), dt_iop_rawdenoise_get_params(), dt_iop_tonecurve_button_press(), dt_iop_tonecurve_draw(), dt_iop_tonecurve_key_press(), dt_iop_tonecurve_motion_notify(), dt_iop_tonecurve_sanity_check(), dt_ioppr_transform_image_colorspace_cl(), dt_ioppr_transform_image_colorspace_rgb_cl(), dt_lightroom_import(), filmic_chroma_v2_v3(), filmic_chroma_v4(), filmic_split_v4(), filmic_v5(), gauss_reduce(), gauss_reduce(), get_params(), gui_changed(), gui_cleanup(), gui_cleanup(), gui_init(), gui_init(), gui_post_expose(), guided_filter(), guided_filter_cl(), guided_filter_cl_fallback(), image_lab2rgb(), image_rgb2lab(), init(), init_pipe(), interpolate_bilinear(), legacy_params(), main(), mask_clipped_pixels(), passthrough_color(), pixelpipe_process_on_CPU(), process(), process(), process(), process(), process(), process(), process(), process(), process_cl(), process_cl(), process_clip(), process_clusters(), process_cmatrix_bm(), process_common_cleanup(), process_common_setup(), process_display(), process_drago(), process_filmic(), process_gray(), process_hsl_v1(), process_hsl_v2(), process_lcms2_bm(), process_lcms2_proper(), process_reinhard(), process_rgb(), process_v1(), process_v3(), process_wavelets_cl(), rawdenoise_button_press(), rawdenoise_draw(), reconstruct_highlights(), rt_adjust_levels(), rt_adjust_levels_cl(), rt_copy_in_to_out(), rt_copy_mask_to_alpha(), rt_process_stats(), rt_process_stats_cl(), set_storage_by_name(), thinplate_match(), to_lin(), to_log(), wavelets_reconstruct_ratios(), and wavelets_reconstruct_RGB().

◆ contrast_boost

float* const restrict const size_t const size_t const float const float const float contrast_boost
Initial value:
{
float lum = 0.0f

Referenced by legacy_params().

◆ exposure_boost

float* const restrict const size_t const size_t const float exposure_boost

Referenced by legacy_params().

◆ fulcrum

float* const restrict const size_t const size_t const float const float fulcrum

Referenced by linear_contrast().

◆ k

float* const restrict const size_t k

Referenced by __attribute__(), __OMP_DECLARE_SIMD__(), __OMP_DECLARE_SIMD__(), __OMP_DECLARE_SIMD__(), _add_node(), _add_node(), _add_node(), _add_node(), _add_node(), _apply_mix(), _apply_mono_grain_kernel(), _apply_preferences(), _apply_tonecurves(), _area_button_press_callback(), _area_button_press_callback(), _area_button_press_callback(), _area_draw_callback(), _area_draw_callback(), _area_draw_callback(), _area_motion_notify_callback(), _area_motion_notify_callback(), _area_motion_notify_callback(), _bin_pixels_waveform(), _bin_vectorscope(), _blendop_blendif_sliders_callback(), _blendop_blendif_update_tab(), _brush_events_button_pressed(), _brush_events_post_expose(), _brush_get_pts_border(), _build_layer_kernel_bank(), _clamp_display_rgb_array_simd(), _clamp_float_to_uint8(), _color_picker_convert_buffer(), _color_picker_direct_hsl(), _color_picker_direct_lch_or_jzczhz(), _color_picker_hsl(), _color_picker_jzczhz(), _color_picker_lch(), _color_picker_rgb_or_lab(), _colorchecker_rebuild_patch_list(), _compute_correction(), _create_crystal_kernel(), _create_pdf(), _create_tooltip_text(), _create_waveform_image(), _delete_node(), _detect_printers_callback(), _develop_blend_process_mask_tone_curve(), _distort_paths(), _downsample_bayer_half_size(), _draw_axes(), _draw_color_picker(), _draw_cube(), _draw_curve(), _draw_graph_background(), _draw_paths(), _draw_samples(), _dt_style_update_from_image(), _edit_preset_response(), _ellipse_events_mouse_moved(), _ellipse_get_distance(), _exif_import_tags(), _export_final_buffer_to_uint16(), _extract_luminance_kernel(), _extract_patches(), _extract_rgb_kernels(), _fill_current_layer(), _finalize_color_grain_kernel(), _find_max_histogram(), _find_selected_node(), _float_to_fract(), _float_to_fract(), _generate_curve_lut(), _get_active_marker_internal(), _get_selected_area(), _get_selected_area(), _gradient_get_points(), _gradient_get_pts_border(), _gradient_slider_button_press(), _gradient_slider_draw(), _gradient_slider_set_defaults(), _gtk_log_writer_filter(), _gui_set_single_expanded(), _gui_styles_update_view(), _handle_xpath(), _hit_paths(), _image_distance_transform(), _import_get_thumbnail(), _init_8(), _init_drawing(), _init_unbounded_coeffs(), _interpolate_and_mask(), _interpolate_and_mask_xtrans(), _iop_tooltip_callback(), _iop_zonesystem_calculate_zonemap(), _iop_zonesystem_zone_index_from_lightness(), _is_identity(), _lens_fill_vignette_row(), _lib_snapshots_add_button_clicked_callback(), _lib_snapshots_toggled_callback(), _masks_blur_13x13_coeff(), _masks_blur_5x5_coeff(), _metadata_view_update_values(), _page_delete_area(), _picker_max_chroma_for_m_hue(), _pixelpipe_pick_from_image(), _polygon_crop_to_roi(), _polygon_find_self_intersection(), _polygon_get_mask(), _polygon_get_mask_roi(), _presets_show_edit_dialog(), _print_button_clicked(), _print_job_run(), _print_nan_debug(), _print_setup_initial_image(), _process(), _process_histogram(), _process_vectorscope(), _record_point_area(), _reset_channel_nodes(), _reset_nodes(), _sample_picker_buffer(), _sample_picker_from_cache(), _sample_raw_segment_cubic_arclen(), _select_base_display_color(), _set_sample_box_area(), _show_drawlayer_wait_dialog(), _simplex(), _slider_move(), _swap_byteorder_float_to_uint8(), _table_to_list(), _trace_buffer_content(), _uint8_to_float(), _update_curve_cache(), _update_recentcollections(), apply_auto_Dmin(), apply_correction(), apply_curve(), apply_global_distortion_map_cl(), apply_legacy_curve(), apply_linear_blending(), apply_linear_blending_w_geomean(), apply_toneequalizer(), area_button_press(), area_draw(), area_draw(), area_motion_notify(), autoset(), backtransform_Y0U0V0(), blend_color_picker_apply(), blur_line(), blur_line(), blur_line_z(), build_gui_kernel(), build_mask(), calculate_clut_3dl(), capture_histogram(), choleski_decompose_fast(), choleski_decompose_safe(), cleanup(), color_picker_apply(), color_picker_helper_4ch_converted_parallel(), color_picker_helper_4ch_parallel(), color_picker_helper_bayer_parallel(), color_picker_helper_bayer_seq(), color_picker_helper_xtrans_parallel(), color_picker_helper_xtrans_seq(), commit_params(), commit_params(), commit_params(), commit_params(), compute_curve_lut(), compute_log_histogram_and_stats(), compute_lut_correction(), compute_patches_delta_E(), compute_ratios(), copy_pixel(), create_lens_kernel(), crop_fitness(), decompress_plain(), denoiseprofile_button_press(), denoiseprofile_draw(), display_mask(), dsvd(), dt_apply_printer_profile(), dt_bauhaus_draw_baseline(), dt_bauhaus_popup_draw(), dt_bauhaus_slider_set_stop(), dt_bilateral_splat(), dt_collection_deserialize(), dt_collection_serialize(), dt_color_checker_get_patch_by_name(), dt_colormatrix_mul(), dt_colorrings_curve_periodic_sample(), dt_colorrings_eval_local_field(), dt_colorrings_eval_sparse_local_field(), dt_colorspaces_conversion_matrices_rgb(), dt_colorspaces_create_alternate_profile(), dt_colorspaces_create_darktable_profile(), dt_colorspaces_create_vendor_profile(), dt_colorspaces_create_xyzmatrix_profile(), dt_colorspaces_cygm_to_rgb(), dt_colorspaces_get_matrix_from_profile(), dt_colorspaces_pseudoinverse(), dt_colorspaces_rgb_to_cygm(), dt_control_add_job(), dt_control_flush_jobs_queue(), dt_control_jobs_init(), dt_control_merge_hdr_job_run(), dt_control_merge_hdr_process(), dt_control_shutdown(), dt_control_signal_init(), dt_database_backup(), dt_develop_blend_params_is_all_zero(), dt_dlopencl_init(), dt_draw_curve_smaple_values(), dt_draw_grid(), dt_draw_grid_zoomed(), dt_draw_histogram_8_linxliny(), dt_draw_histogram_8_linxlogy(), dt_draw_histogram_8_logxliny(), dt_draw_histogram_8_logxlogy(), dt_draw_histogram_8_zoomed(), dt_draw_horizontal_lines(), dt_draw_loglog_grid(), dt_draw_semilog_x_grid(), dt_draw_semilog_y_grid(), dt_draw_star(), dt_draw_vertical_lines(), dt_fast_mexp2f(), dt_focus_create_clusters(), dt_focus_draw_clusters(), dt_gaussian_blur(), dt_gaussian_blur_cl(), dt_gaussian_init(), dt_gaussian_init_cl(), dt_get_help_url(), dt_get_media_type(), dt_get_papers(), dt_histogram_helper(), dt_histogram_max_helper(), dt_histogram_worker(), dt_image_init(), dt_imageio_dng_write_tiff_header(), dt_imageio_export_with_flags(), dt_imageio_flip_buffers_ui8_to_float(), dt_imageio_jpeg_compress(), dt_imageio_jpeg_write_with_icc_profile(), dt_imageio_open_j2k(), dt_imageio_open_png(), dt_imageio_open_rawspeed(), dt_imageio_open_rawspeed_sraw(), dt_imageio_write_dng(), dt_init(), dt_interpolation_resample_cl(), dt_iop_basecurve_button_press(), dt_iop_basecurve_draw(), dt_iop_basecurve_motion_notify(), dt_iop_basecurve_sanity_check(), dt_iop_channelmixer_shared_mul3x3(), dt_iop_clip_and_zoom_8(), dt_iop_colorzones_get_params(), dt_iop_denoiseprofile_get_params(), dt_iop_estimate_exp(), dt_iop_flip_and_zoom_8(), dt_iop_gui_blending_lose_focus(), dt_iop_gui_init_blendif(), dt_iop_image_add_const(), dt_iop_image_add_image(), dt_iop_image_copy(), dt_iop_image_div_const(), dt_iop_image_fill(), dt_iop_image_invert(), dt_iop_image_linear_blend(), dt_iop_image_mul_const(), dt_iop_image_scaled_copy(), dt_iop_image_sub_image(), dt_iop_levels_area_draw(), dt_iop_levels_compute_levels_automatic(), dt_iop_levels_compute_levels_manual(), dt_iop_levels_motion_notify(), dt_iop_load_module_by_so(), dt_iop_lowlight_get_params(), dt_iop_rawdenoise_get_params(), 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_iop_tonecurve_sanity_check(), dt_iop_zonesystem_bar_button_press(), dt_iop_zonesystem_bar_draw(), dt_iop_zonesystem_preview_draw(), dt_ioppr_get_iop_order_list_kind(), dt_ioppr_update_for_entries(), dt_lib_colorpicker_set_box_area(), dt_lightroom_import(), dt_local_laplacian_cl(), dt_local_laplacian_free_cl(), dt_local_laplacian_init_cl(), dt_lut3d_pyramid_interp(), dt_lut3d_tetrahedral_interp(), dt_lut3d_trilinear_interp(), dt_masks_blur_9x9_coeff(), dt_masks_create_menu(), dt_mimap_cache_evict(), dt_mipmap_cache_get_fitting_size(), dt_mipmap_cache_get_matching_size(), dt_mipmap_cache_init(), dt_mipmap_cache_remove(), dt_noiseprofile_get_matching(), dt_noiseprofile_interpolate(), dt_noiseprofile_verify(), dt_opencl_cleanup_device(), dt_opencl_create_kernel(), dt_opencl_device_init(), dt_opencl_events_flush(), dt_opencl_events_profiling(), dt_opencl_events_reset(), dt_opencl_init(), dt_points_init(), dt_print_file(), dt_printing_clear_boxes(), dt_printing_get_image_box(), dt_printing_setup_display(), dt_printing_setup_page(), dt_simd_memcpy(), dt_ui_panel_show(), dt_ui_restore_panels(), dtgtk_cairo_paint_modulegroup_favorites(), dtgtk_gradient_slider_multivalue_get_values(), dtgtk_gradient_slider_multivalue_set_markers(), dtgtk_gradient_slider_multivalue_set_resetvalues(), dtgtk_gradient_slider_multivalue_set_scale_callback(), dtgtk_gradient_slider_multivalue_set_values(), easter(), eaw_synthesize(), edge_enhance(), edge_enhance_1d(), eigf_blending(), eigf_blending_no_mask(), eigf_variance_analysis(), eigf_variance_analysis_no_mask(), encode_colorchecker(), encode_tonecurve(), enter(), expose(), extract_color_checker(), fast_mexp2f(), filmic_chroma_v1(), filmic_chroma_v2_v3(), filmic_chroma_v4(), filmic_split_v1(), filmic_split_v2_v3(), filmic_split_v4(), filmic_v5(), finalize_store(), find_coeffs(), find_hovered(), find_temperature_from_raw_coeffs(), fit_curve(), gauss_make_triangular(), gauss_reduce(), gauss_solve_triangular(), generate_thumbnail_cache(), get_cluster(), get_clusters(), get_corner(), get_corner(), get_corner(), get_error(), get_interpolate(), get_manifolds(), get_params(), get_params(), get_scales(), get_skin_tones_range(), get_white_balance_coeff(), green_equilibration_cl(), gui_changed(), gui_cleanup(), gui_init(), gui_init(), gui_init(), gui_post_expose(), gui_post_expose(), gui_reset(), gui_reset(), gui_update(), gui_update_from_coeffs(), guided_filter_tiling(), heat_PDE_diffusion(), heat_PDE_diffusion(), init(), init(), init_global(), init_kernel(), init_pipe(), init_presets(), init_reconstruct(), init_reconstruct(), init_tab_general(), inpaint_mask(), interpolate_color(), interpolate_color_xtrans(), interpolate_paths(), invert_histogram(), invert_histogram(), kmeans(), kth_smallest(), leave(), legacy_params(), lens_set(), LinEqSolve(), local_laplacian_internal(), HashTablePermutohedral< KD, VD >::lookup(), loop_switch(), lowlight_button_press(), lowlight_draw(), lowlight_motion_notify(), interpol::smooth_cubic_spline< T >::LU_factor(), interpol::smooth_cubic_spline< T >::LU_solve(), main(), main(), main(), mask_clipped_pixels(), mat3mul(), mat3mulv(), mat3SSEmul(), mat4mulv(), matrice_pseudoinverse(), matrix_multiply(), memset_zero(), modify_roi_in(), modify_roi_out(), mouse_moved(), mouse_moved(), mul2xyz(), mutate(), nextpow2(), nfa(), nlmeans_denoise_cl(), nlmeans_denoiseprofile_cl(), node_alloc(), node_gc(), normalize_manifolds(), pixelpipe_process_on_CPU(), polar_decomposition(), pre_median_b(), precondition_Y0U0V0(), preload_image_cache(), pretty_print_collection(), process(), process(), process(), process(), process(), process(), process_cl(), process_clip(), process_cmatrix_fastpath_clipping(), process_cmatrix_fastpath_simple(), process_cmatrix_proper(), process_common_cleanup(), process_common_setup(), process_data(), process_display(), process_drago(), process_fastpath_apply_tonecurves(), process_fastpath_matrix(), process_filmic(), process_fusion(), process_gray(), process_hsl_v1(), process_hsl_v2(), process_lcms2_bm(), process_lcms2_proper(), process_nlmeans_cl(), process_random(), process_reinhard(), process_rgb(), process_v1(), process_v3(), process_wavelets(), process_wavelets(), process_wavelets_cl(), profile_callback(), pseudo_solve_gaussian(), QR_dec(), quantize(), rawdenoise_button_press(), rawdenoise_draw(), read_histogram(), read_image(), read_pfm(), read_plain(), reduce_artifacts(), reload_defaults(), restore_ratios(), rol32(), rol32(), scrolled(), set_params(), set_presets(), set_storage_by_name(), HashTablePermutohedral< KD, VD >::Key::setHash(), shift_left(), shift_right(), smooth_path_linsys(), smooth_paths_linsys(), thinplate_match(), transpose_dot_matrix(), transpose_dot_matrix(), transpose_dot_vector(), transpose_dot_vector(), unselect_all(), update_bounding_box(), update_profile_list(), update_warp_count(), variance_analyse(), wavelets_detail_level(), wavelets_reconstruct_ratios(), wavelets_reconstruct_RGB(), WB_high_picker_callback(), WB_low_picker_callback(), write_image(), write_image(), and xyz2mul().

◆ luminance