![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include <CL/cl.h>#include "common/image.h"#include "develop/imageop.h"#include <glib.h>#include <math.h>#include <stddef.h>#include <stdint.h>
Include dependency graph for imageop_math.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Macros | |
| #define | RED 0 |
| #define | GREEN 1 |
| #define | BLUE 2 |
| #define | ALPHA 3 |
Functions | |
| void | dt_iop_flip_and_zoom_8 (const uint8_t *in, int32_t iw, int32_t ih, uint8_t *out, int32_t ow, int32_t oh, const dt_image_orientation_t orientation, uint32_t *width, uint32_t *height) |
| void | dt_iop_clip_and_zoom (float *out, const float *const in, const struct dt_iop_roi_t *const roi_out, const struct dt_iop_roi_t *const roi_in, const int32_t out_stride, const int32_t in_stride) |
| void | dt_iop_clip_and_zoom_roi (float *out, const float *const in, const struct dt_iop_roi_t *const roi_out, const struct dt_iop_roi_t *const roi_in, const int32_t out_stride, const int32_t in_stride) |
| int | dt_iop_clip_and_zoom_cl (int devid, cl_mem dev_out, cl_mem dev_in, const struct dt_iop_roi_t *const roi_out, const struct dt_iop_roi_t *const roi_in) |
| int | dt_iop_clip_and_zoom_roi_cl (int devid, cl_mem dev_out, cl_mem dev_in, const struct dt_iop_roi_t *const roi_out, const struct dt_iop_roi_t *const roi_in) |
| void | dt_iop_clip_and_zoom_mosaic_half_size_f (float *const out, const float *const in, const dt_iop_roi_t *const roi_out, const dt_iop_roi_t *const roi_in, const int32_t out_stride, const int32_t in_stride, const uint32_t filters) |
| void | dt_iop_clip_and_zoom_mosaic_half_size (uint16_t *const out, const uint16_t *const in, const dt_iop_roi_t *const roi_out, const dt_iop_roi_t *const roi_in, const int32_t out_stride, const int32_t in_stride, const uint32_t filters) |
| void | dt_iop_clip_and_zoom_mosaic_third_size_xtrans (uint16_t *const out, const uint16_t *const in, const dt_iop_roi_t *const roi_out, const dt_iop_roi_t *const roi_in, const int32_t out_stride, const int32_t in_stride, const uint8_t(*const xtrans)[6]) |
| void | dt_iop_clip_and_zoom_mosaic_third_size_xtrans_f (float *const out, const float *const in, const dt_iop_roi_t *const roi_out, const dt_iop_roi_t *const roi_in, const int32_t out_stride, const int32_t in_stride, const uint8_t(*const xtrans)[6]) |
| void | dt_iop_clip_and_zoom_demosaic_passthrough_monochrome_f (float *out, const float *const in, const struct dt_iop_roi_t *const roi_out, const struct dt_iop_roi_t *const roi_in, const int32_t out_stride, const int32_t in_stride) |
| void | dt_iop_clip_and_zoom_demosaic_half_size_f (float *out, const float *const in, const struct dt_iop_roi_t *const roi_out, const struct dt_iop_roi_t *const roi_in, const int32_t out_stride, const int32_t in_stride, const uint32_t filters) |
| void | dt_iop_clip_and_zoom_demosaic_third_size_xtrans_f (float *out, const float *const in, const struct dt_iop_roi_t *const roi_out, const struct dt_iop_roi_t *const roi_in, const int32_t out_stride, const int32_t in_stride, const uint8_t(*const xtrans)[6]) |
| void | dt_iop_clip_and_zoom_8 (const uint8_t *i, int32_t ix, int32_t iy, int32_t iw, int32_t ih, int32_t ibw, int32_t ibh, uint8_t *o, int32_t ox, int32_t oy, int32_t ow, int32_t oh, int32_t obw, int32_t obh) |
| void | dt_iop_YCbCr_to_RGB (const dt_aligned_pixel_t yuv, dt_aligned_pixel_t rgb) |
| void | dt_iop_RGB_to_YCbCr (const dt_aligned_pixel_t rgb, dt_aligned_pixel_t yuv) |
| void | dt_iop_estimate_cubic (const float x[4], const float y[4], float a[4]) |
| static float | dt_iop_eval_cubic (const float *const a, const float x) |
| static void | dt_iop_estimate_exp (const float *const x, const float *const y, const int num, float *coeff) |
| static float | dt_iop_eval_exp (const float *const coeff, const float x) |
| __OMP_DECLARE_SIMD__ (uniform(width, height) aligned(ivoid, ovoid:64)) static inline void dt_iop_alpha_copy(const void *const ivoid | |
| for (size_t k=3;k< width *height *4;k+=4) out[k] | |
| static int | FC (const size_t row, const size_t col, const uint32_t filters) |
| static int | FCxtrans (const int row, const int col, const dt_iop_roi_t *const roi, const uint8_t(*const xtrans)[6]) |
| static int | fcol (const int row, const int col, const uint32_t filters, const uint8_t(*const xtrans)[6]) |
Variables | |
| void *const | ovoid |
| void *const const size_t | width |
| void *const const size_t const size_t | height |
| float *const __restrict__ | out = (float *const)ovoid |
| #define ALPHA 3 |
| #define BLUE 2 |
| #define GREEN 1 |
| #define RED 0 |
Copy alpha channel 1:1 from input to output
| void dt_iop_clip_and_zoom | ( | float * | out, |
| const float *const | in, | ||
| const struct dt_iop_roi_t *const | roi_out, | ||
| const struct dt_iop_roi_t *const | roi_in, | ||
| const int32_t | out_stride, | ||
| const int32_t | in_stride | ||
| ) |
for homebrew pixel pipe: zoom pixel array.
| void dt_iop_clip_and_zoom_8 | ( | const uint8_t * | i, |
| int32_t | ix, | ||
| int32_t | iy, | ||
| int32_t | iw, | ||
| int32_t | ih, | ||
| int32_t | ibw, | ||
| int32_t | ibh, | ||
| uint8_t * | o, | ||
| int32_t | ox, | ||
| int32_t | oy, | ||
| int32_t | ow, | ||
| int32_t | oh, | ||
| int32_t | obw, | ||
| int32_t | obh | ||
| ) |
| int dt_iop_clip_and_zoom_cl | ( | int | devid, |
| cl_mem | dev_out, | ||
| cl_mem | dev_in, | ||
| const struct dt_iop_roi_t *const | roi_out, | ||
| const struct dt_iop_roi_t *const | roi_in | ||
| ) |
| void dt_iop_clip_and_zoom_demosaic_half_size_f | ( | float * | out, |
| const float *const | in, | ||
| const struct dt_iop_roi_t *const | roi_out, | ||
| const struct dt_iop_roi_t *const | roi_in, | ||
| const int32_t | out_stride, | ||
| const int32_t | in_stride, | ||
| const uint32_t | filters | ||
| ) |
| void dt_iop_clip_and_zoom_demosaic_passthrough_monochrome_f | ( | float * | out, |
| const float *const | in, | ||
| const struct dt_iop_roi_t *const | roi_out, | ||
| const struct dt_iop_roi_t *const | roi_in, | ||
| const int32_t | out_stride, | ||
| const int32_t | in_stride | ||
| ) |
| void dt_iop_clip_and_zoom_demosaic_third_size_xtrans_f | ( | float * | out, |
| const float *const | in, | ||
| const struct dt_iop_roi_t *const | roi_out, | ||
| const struct dt_iop_roi_t *const | roi_in, | ||
| const int32_t | out_stride, | ||
| const int32_t | in_stride, | ||
| const uint8_t(*) | xtrans[6] | ||
| ) |
x-trans sensor downscaling
| void dt_iop_clip_and_zoom_mosaic_half_size | ( | uint16_t *const | out, |
| const uint16_t *const | in, | ||
| const dt_iop_roi_t *const | roi_out, | ||
| const dt_iop_roi_t *const | roi_in, | ||
| const int32_t | out_stride, | ||
| const int32_t | in_stride, | ||
| const uint32_t | filters | ||
| ) |
References __OMP_PARALLEL_FOR__, CLAMPS, FC(), fx, dt_iop_roi_t::height, MIN, out, dt_iop_roi_t::scale, dt_iop_roi_t::width, x, dt_iop_roi_t::x, and dt_iop_roi_t::y.
Referenced by _init_f().
| void dt_iop_clip_and_zoom_mosaic_half_size_f | ( | float *const | out, |
| const float *const | in, | ||
| const dt_iop_roi_t *const | roi_out, | ||
| const dt_iop_roi_t *const | roi_in, | ||
| const int32_t | out_stride, | ||
| const int32_t | in_stride, | ||
| const uint32_t | filters | ||
| ) |
References __OMP_PARALLEL_FOR__, FC(), fx, dt_iop_roi_t::height, i, MIN, out, p, dt_iop_roi_t::scale, dt_iop_roi_t::width, x, dt_iop_roi_t::x, and dt_iop_roi_t::y.
Referenced by _init_f().
| void dt_iop_clip_and_zoom_mosaic_third_size_xtrans | ( | uint16_t *const | out, |
| const uint16_t *const | in, | ||
| const dt_iop_roi_t *const | roi_out, | ||
| const dt_iop_roi_t *const | roi_in, | ||
| const int32_t | out_stride, | ||
| const int32_t | in_stride, | ||
| const uint8_t(*) | xtrans[6] | ||
| ) |
downscales and clips a Fujifilm X-Trans mosaiced buffer (in) to the given region of interest (r_*) and writes it to out.
References __OMP_PARALLEL_FOR__, FCxtrans(), fx, dt_iop_roi_t::height, MAX, MIN, out, dt_iop_roi_t::scale, dt_iop_roi_t::width, x, dt_iop_roi_t::x, and dt_iop_roi_t::y.
Referenced by _init_f().
| void dt_iop_clip_and_zoom_mosaic_third_size_xtrans_f | ( | float *const | out, |
| const float *const | in, | ||
| const dt_iop_roi_t *const | roi_out, | ||
| const dt_iop_roi_t *const | roi_in, | ||
| const int32_t | out_stride, | ||
| const int32_t | in_stride, | ||
| const uint8_t(*) | xtrans[6] | ||
| ) |
References __OMP_PARALLEL_FOR__, FCxtrans(), fx, dt_iop_roi_t::height, MAX, MIN, out, dt_iop_roi_t::scale, dt_iop_roi_t::width, x, dt_iop_roi_t::x, and dt_iop_roi_t::y.
Referenced by _init_f().
| void dt_iop_clip_and_zoom_roi | ( | float * | out, |
| const float *const | in, | ||
| const struct dt_iop_roi_t *const | roi_out, | ||
| const struct dt_iop_roi_t *const | roi_in, | ||
| const int32_t | out_stride, | ||
| const int32_t | in_stride | ||
| ) |
zoom pixel array for roi buffers.
| int dt_iop_clip_and_zoom_roi_cl | ( | int | devid, |
| cl_mem | dev_out, | ||
| cl_mem | dev_in, | ||
| const struct dt_iop_roi_t *const | roi_out, | ||
| const struct dt_iop_roi_t *const | roi_in | ||
| ) |
| void dt_iop_estimate_cubic | ( | const float | x[4], |
| const float | y[4], | ||
| float | a[4] | ||
| ) |
takes four points (x,y) in two arrays and fills the cubic coefficients a, such that y = [X] * a, where [X] is the matrix containing all x^3 x^2 x^1 x^0 lines for all four x.
References mat4inv(), mat4mulv(), and x.
|
inlinestatic |
estimates an exponential form f(x) = a*x^g from a few (num) points (x, y). the largest point should be (1.0, y) to really get good data.
References coeff, g, k, and x.
Referenced by _area_draw_callback(), _generate_curve_lut(), _init_unbounded_coeffs(), commit_params(), commit_params(), dt_iop_basecurve_draw(), and dt_iop_tonecurve_draw().
|
inlinestatic |
evaluates the cubic fit, i.e. returns y = a^t [x^3 x^2 x^1 1]
References x.
|
inlinestatic |
evaluates the exp fit.
Referenced by _area_draw_callback(), apply_curve(), apply_legacy_curve(), dt_iop_basecurve_draw(), dt_iop_tonecurve_draw(), process(), process(), and process().
| void dt_iop_flip_and_zoom_8 | ( | const uint8_t * | in, |
| int32_t | iw, | ||
| int32_t | ih, | ||
| uint8_t * | out, | ||
| int32_t | ow, | ||
| int32_t | oh, | ||
| const dt_image_orientation_t | orientation, | ||
| uint32_t * | width, | ||
| uint32_t * | height | ||
| ) |
flip according to orientation bits, also zoom to given size.
References __OMP_PARALLEL_FOR__, bpp, height, i, k, MAX, MIN, ORIENTATION_FLIP_X, ORIENTATION_FLIP_Y, ORIENTATION_SWAP_XY, out, t, and width.
Referenced by _init_8(), _load_jpg(), and dt_mipmap_cache_swap_at_size().
| void dt_iop_RGB_to_YCbCr | ( | const dt_aligned_pixel_t | rgb, |
| dt_aligned_pixel_t | yuv | ||
| ) |
References rgb.
| void dt_iop_YCbCr_to_RGB | ( | const dt_aligned_pixel_t | yuv, |
| dt_aligned_pixel_t | rgb | ||
| ) |
References rgb.
|
inlinestatic |
|
inlinestatic |
References FC(), FCxtrans(), and row.
Referenced by lin_interpolate(), process_vng_cl(), and vng_interpolate().
|
inlinestatic |
Calculate the xtrans pattern color from the row and column
References IS_NULL_PTR, row, dt_iop_roi_t::x, and dt_iop_roi_t::y.
Referenced by fcol().
| for | ( | ) |
| void* const const size_t const size_t height |
| float* const __restrict__ out = (float *const)ovoid |
| void* const ovoid |
Referenced by __attribute__(), _default_process_tiling_cl_ptp(), _default_process_tiling_cl_roi(), _default_process_tiling_ptp(), _default_process_tiling_roi(), default_process_tiling(), default_process_tiling_cl(), dt_develop_blend_process(), interpolate_color(), interpolate_color_xtrans(), process(), process(), process(), process(), process(), process_bayer(), process_clip(), process_cmatrix_bm(), process_cmatrix_fastpath_clipping(), process_cmatrix_fastpath_simple(), process_cmatrix_proper(), process_common_cleanup(), process_display(), process_drago(), process_filmic(), process_floyd_steinberg(), process_fusion(), process_internal(), process_laplacian_bayer(), process_laplacian_xtrans(), process_lch_bayer(), process_lch_xtrans(), process_lcms2_bm(), process_lcms2_proper(), process_lut(), process_random(), process_reinhard(), process_v1(), process_v3(), process_visualize(), process_wavelets(), and process_xtrans().
| void* const const size_t width |