![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
Go to the source code of this file.
Data Structures | |
struct | dt_interpolation |
Typedefs | |
typedef float(* | dt_interpolation_func) (float *taps, size_t num_taps, float width, float first_tap, float interval) |
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) |
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 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 _clip(), _compute_upsampling_kernel(), _prepare_tap_boundaries(), BORDER_CLAMP, copy_pixel(), DT_ALIGNED_ARRAY, for_each_channel, height, INTERPOLATION_BORDER_MODE, MAX_HALF_FILTER_WIDTH, MAX_KERNEL_REQ, width, and dt_interpolation::width.
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 _clip(), _compute_upsampling_kernel(), _prepare_tap_boundaries(), BORDER_CLAMP, DT_ALIGNED_ARRAY, height, INTERPOLATION_BORDER_MODE, MAX_HALF_FILTER_WIDTH, MAX_KERNEL_REQ, width, and dt_interpolation::width.
Referenced by apply_global_distortion_map(), distort_mask(), and process().
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, name, and type.
Referenced by _aspect_ratio_get(), _ratio_get_aspect(), apply_global_distortion_map(), distort_mask(), dt_iop_clip_and_zoom(), dt_iop_clip_and_zoom_roi(), modify_roi_in(), modify_roi_in(), modify_roi_out(), process(), and process().
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().
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().
Referenced by dt_interpolation_resample_roi_1c().
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(), dt_iop_roi_t::x, and dt_iop_roi_t::y.
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(), dt_iop_roi_t::x, and dt_iop_roi_t::y.
Referenced by distort_mask().