![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
Include dependency graph for interpolation.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Data Structures | |
| struct | dt_interpolation |
| struct | dt_interpolation_cl_global_t |
Typedefs | |
| typedef float(* | dt_interpolation_func) (float *taps, size_t num_taps, float width, float first_tap, float interval) |
| typedef struct dt_interpolation_cl_global_t | dt_interpolation_cl_global_t |
Enumerations | |
| enum | dt_interpolation_type { DT_INTERPOLATION_FIRST = 0 , DT_INTERPOLATION_BILINEAR = DT_INTERPOLATION_FIRST , DT_INTERPOLATION_BICUBIC , DT_INTERPOLATION_LANCZOS2 , DT_INTERPOLATION_LANCZOS3 , DT_INTERPOLATION_LAST , DT_INTERPOLATION_DEFAULT = DT_INTERPOLATION_BILINEAR , DT_INTERPOLATION_DEFAULT_WARP = DT_INTERPOLATION_BICUBIC , DT_INTERPOLATION_USERPREF , DT_INTERPOLATION_USERPREF_WARP } |
Functions | |
| float | dt_interpolation_compute_sample (const struct dt_interpolation *itor, const float *in, const float x, const float y, const int width, const int height, const int samplestride, const int linestride) |
| void | dt_interpolation_compute_pixel4c (const struct dt_interpolation *itor, const float *in, float *out, const float x, const float y, const int width, const int height, const int linestride) |
| const struct dt_interpolation * | dt_interpolation_new (enum dt_interpolation_type type) |
| void | dt_interpolation_resample (const struct dt_interpolation *itor, float *out, const dt_iop_roi_t *const roi_out, const float *const in, const dt_iop_roi_t *const roi_in) |
| void | dt_interpolation_resample_roi (const struct dt_interpolation *itor, float *out, const dt_iop_roi_t *const roi_out, const float *const in, const dt_iop_roi_t *const roi_in) |
| dt_interpolation_cl_global_t * | dt_interpolation_init_cl_global (void) |
| void | dt_interpolation_free_cl_global (dt_interpolation_cl_global_t *g) |
| int | dt_interpolation_resample_cl (const struct dt_interpolation *itor, int devid, cl_mem dev_out, const dt_iop_roi_t *const roi_out, cl_mem dev_in, const dt_iop_roi_t *const roi_in) |
| int | dt_interpolation_resample_roi_cl (const struct dt_interpolation *itor, int devid, cl_mem dev_out, const dt_iop_roi_t *const roi_out, cl_mem dev_in, const dt_iop_roi_t *const roi_in) |
| void | dt_interpolation_resample_1c (const struct dt_interpolation *itor, float *out, const dt_iop_roi_t *const roi_out, const float *const in, const dt_iop_roi_t *const roi_in) |
| void | dt_interpolation_resample_roi_1c (const struct dt_interpolation *itor, float *out, const dt_iop_roi_t *const roi_out, const float *const in, const dt_iop_roi_t *const roi_in) |
| typedef struct dt_interpolation_cl_global_t dt_interpolation_cl_global_t |
| typedef float(* dt_interpolation_func) (float *taps, size_t num_taps, float width, float first_tap, float interval) |
Interpolation function
Available interpolations
| void dt_interpolation_compute_pixel4c | ( | const struct dt_interpolation * | itor, |
| const float * | in, | ||
| float * | out, | ||
| const float | x, | ||
| const float | y, | ||
| const int | width, | ||
| const int | height, | ||
| const int | linestride | ||
| ) |
Compute an interpolated 4 component pixel.
This function computes a full 4 component pixel. This helps a bit speedwise as interpolation coordinates are supposed to be the same for all components. Thus we can share horizontal and vertical interpolation kernels across all components
NB: a pixel is to be four floats big in stride
| in | Pointer to the input image |
| out | Pointer to the output sample |
| itor | interpolator to be used |
| x | X-Coordinate of the requested sample |
| y | Y-Coordinate of the requested sample |
| width | Width of the input image |
| height | Width of the input image |
| linestride | Stride in number of pixels for complete line |
References BORDER_CLAMP, DT_ALIGNED_ARRAY, dt_simd_set1(), dt_store_simd(), height, i, INTERPOLATION_BORDER_MODE, MAX_HALF_FILTER_WIDTH, MAX_KERNEL_REQ, out, width, dt_interpolation::width, and x.
Referenced by apply_global_distortion_map(), distort_mask(), process(), and process().
| float dt_interpolation_compute_sample | ( | const struct dt_interpolation * | itor, |
| const float * | in, | ||
| const float | x, | ||
| const float | y, | ||
| const int | width, | ||
| const int | height, | ||
| const int | samplestride, | ||
| const int | linestride | ||
| ) |
Compute a single interpolated sample.
This function computes a single interpolated sample. Implied costs are:
| in | Input image |
| itor | interpolator to be used |
| x | X-Coordinate of the requested sample |
| y | Y-Coordinate of the requested sample |
| width | Width of the input image |
| height | Width of the input image |
| samplestride | Stride in bytes for a sample |
| linestride | Stride in bytes for complete line |
References BORDER_CLAMP, DT_ALIGNED_ARRAY, height, i, INTERPOLATION_BORDER_MODE, MAX_HALF_FILTER_WIDTH, MAX_KERNEL_REQ, r, width, dt_interpolation::width, and x.
Referenced by apply_global_distortion_map(), distort_mask(), and process().
| void dt_interpolation_free_cl_global | ( | dt_interpolation_cl_global_t * | g | ) |
References dt_free, dt_opencl_free_kernel(), g, and IS_NULL_PTR.
Referenced by dt_opencl_cleanup().
| dt_interpolation_cl_global_t * dt_interpolation_init_cl_global | ( | void | ) |
References dt_opencl_create_kernel(), g, and dt_interpolation_cl_global_t::kernel_interpolation_resample.
Referenced by dt_opencl_init().
| const struct dt_interpolation * dt_interpolation_new | ( | enum dt_interpolation_type | type | ) |
Get an interpolator from type
| type | Interpolator to search for |
References dt_conf_get_string_const(), DT_INTERPOLATION_DEFAULT, DT_INTERPOLATION_DEFAULT_WARP, DT_INTERPOLATION_FIRST, DT_INTERPOLATION_LAST, DT_INTERPOLATION_USERPREF, DT_INTERPOLATION_USERPREF_WARP, dt_interpolator, i, IS_NULL_PTR, name, and type.
Referenced by _aspect_ratio_get(), _ratio_get_aspect(), apply_global_distortion_map(), apply_global_distortion_map_cl(), distort_mask(), dt_dev_distort_detail_mask(), dt_iop_clip_and_zoom(), dt_iop_clip_and_zoom_cl(), dt_iop_clip_and_zoom_roi(), dt_iop_clip_and_zoom_roi_cl(), modify_roi_in(), modify_roi_in(), modify_roi_out(), process(), process(), and process_cl().
| void dt_interpolation_resample | ( | const struct dt_interpolation * | itor, |
| float * | out, | ||
| const dt_iop_roi_t *const | roi_out, | ||
| const float *const | in, | ||
| const dt_iop_roi_t *const | roi_in | ||
| ) |
Image resampler.
Resamples the image "in" to "out" according to roi values. Here is the exact contract:
| itor | [in] Interpolator to use |
| out | [out] Will hold the resampled image |
| roi_out | [in] Region of interest of the resampled image |
| out_stride | [in] Output line stride in bytes |
| in | [in] Will hold the resampled image |
| roi_in | [in] Region of interest of the original image |
| in_stride | [in] Input line stride in bytes |
Applies resampling (re-scaling) on full input and output buffers. roi_in and roi_out define the part of the buffers that is affected.
References _interpolation_resample_plain(), and out.
Referenced by dt_interpolation_resample_roi(), and dt_iop_clip_and_zoom().
| void dt_interpolation_resample_1c | ( | const struct dt_interpolation * | itor, |
| float * | out, | ||
| const dt_iop_roi_t *const | roi_out, | ||
| const float *const | in, | ||
| const dt_iop_roi_t *const | roi_in | ||
| ) |
Applies resampling (re-scaling) on full input and output buffers. roi_in and roi_out define the part of the buffers that is affected.
References _interpolation_resample_1c_plain(), and out.
Referenced by dt_interpolation_resample_roi_1c().
| int dt_interpolation_resample_cl | ( | const struct dt_interpolation * | itor, |
| const int | devid, | ||
| cl_mem | dev_out, | ||
| const dt_iop_roi_t *const | roi_out, | ||
| cl_mem | dev_in, | ||
| const dt_iop_roi_t *const | roi_in | ||
| ) |
Image resampler OpenCL version.
Resamples the image "in" to "out" according to roi values. Here is the exact contract:
| itor | [in] Interpolator to use |
| devid | [in] The device to run on |
| dev_out | [out] Will hold the resampled image |
| roi_out | [in] Region of interest of the resampled image |
| out_stride | [in] Output line stride in bytes |
| dev_in | [in] Will hold the resampled image |
| roi_in | [in] Region of interest of the original image |
| in_stride | [in] Input line stride in bytes |
Applies resampling (re-scaling) on full input and output buffers. roi_in and roi_out define the part of the buffers that is affected.
References _prepare_resampling_plan(), darktable, dt_opencl_copy_host_to_device_constant(), DT_OPENCL_DEFAULT_ERROR, dt_opencl_enqueue_copy_image(), dt_opencl_enqueue_kernel_2d_with_local(), dt_opencl_local_buffer_opt(), dt_opencl_release_mem_object(), dt_opencl_set_kernel_arg(), dt_pixelpipe_cache_free_align, error(), height, dt_iop_roi_t::height, dt_opencl_t::interpolation, IS_NULL_PTR, k, kernel(), dt_interpolation_cl_global_t::kernel_interpolation_resample, MAX, darktable_t::opencl, roundToNextPowerOfTwo(), ROUNDUP, ROUNDUPDWD, dt_iop_roi_t::scale, dt_opencl_local_buffer_t::sizey, width, dt_iop_roi_t::width, dt_iop_roi_t::x, dt_opencl_local_buffer_t::xoffset, and dt_iop_roi_t::y.
Referenced by dt_interpolation_resample_roi_cl(), and dt_iop_clip_and_zoom_cl().
| void dt_interpolation_resample_roi | ( | const struct dt_interpolation * | itor, |
| float * | out, | ||
| const dt_iop_roi_t *const | roi_out, | ||
| const float *const | in, | ||
| const dt_iop_roi_t *const | roi_in | ||
| ) |
Applies resampling (re-scaling) on a specific region-of-interest of an image. The input and output buffers hold exactly those roi's. roi_in and roi_out define the relative positions of the roi's within the full input and output image, respectively.
References dt_interpolation_resample(), and out.
Referenced by dt_iop_clip_and_zoom_roi().
| void dt_interpolation_resample_roi_1c | ( | const struct dt_interpolation * | itor, |
| float * | out, | ||
| const dt_iop_roi_t *const | roi_out, | ||
| const float *const | in, | ||
| const dt_iop_roi_t *const | roi_in | ||
| ) |
Applies resampling (re-scaling) on a specific region-of-interest of an image. The input and output buffers hold exactly those roi's. roi_in and roi_out define the relative positions of the roi's within the full input and output image, respectively.
References dt_interpolation_resample_1c(), and out.
Referenced by distort_mask(), and dt_dev_distort_detail_mask().
| int dt_interpolation_resample_roi_cl | ( | const struct dt_interpolation * | itor, |
| const int | devid, | ||
| cl_mem | dev_out, | ||
| const dt_iop_roi_t *const | roi_out, | ||
| cl_mem | dev_in, | ||
| const dt_iop_roi_t *const | roi_in | ||
| ) |
Applies resampling (re-scaling) on a specific region-of-interest of an image. The input and output buffers hold exactly those roi's. roi_in and roi_out define the relative positions of the roi's within the full input and output image, respectively.
References dt_interpolation_resample_cl().
Referenced by dt_iop_clip_and_zoom_roi_cl().