30#ifndef DT_DEVELOP_IMAGEOP_MATH_H
31#define DT_DEVELOP_IMAGEOP_MATH_H
57 const struct dt_iop_roi_t *
const roi_in,
const int32_t out_stride,
58 const int32_t in_stride);
62 const struct dt_iop_roi_t *
const roi_in,
const int32_t out_stride,
63 const int32_t in_stride);
76 const int32_t out_stride,
const int32_t in_stride,
77 const uint32_t filters);
81 const int32_t out_stride,
const int32_t in_stride,
82 const uint32_t filters);
86 const dt_iop_roi_t *
const roi_in,
const int32_t out_stride,
87 const int32_t in_stride,
const uint8_t (*
const xtrans)[6]);
91 const dt_iop_roi_t *
const roi_in,
const int32_t out_stride,
92 const int32_t in_stride,
const uint8_t (*
const xtrans)[6]);
97 const int32_t out_stride,
98 const int32_t in_stride);
102 const struct dt_iop_roi_t *
const roi_in,
const int32_t out_stride,
103 const int32_t in_stride,
const uint32_t filters);
110 const int32_t out_stride,
const int32_t in_stride,
111 const uint8_t (*
const xtrans)[6]);
115 int32_t ibh, uint8_t *o, int32_t ox, int32_t oy, int32_t ow, int32_t oh,
116 int32_t obw, int32_t obh);
129 const float x4[4] = {
x *
x *
x,
x *
x,
x, 1.0f };
130 return a[3] * x4[3] + a[2] * x4[2] + a[1] * x4[1] + a[0] * x4[0];
140 const float x0 =
x[num - 1], y0 = y[num - 1];
148 for(
int k = 0;
k < num - 1;
k++)
150 const float yy = y[
k] / y0, xx =
x[
k] / x0;
151 if(yy > 0.0f && xx > 0.0f)
153 const float gg = logf(y[
k] / y0) / logf(
x[
k] / x0);
162 coeff[0] = 1.0f / x0;
178static inline
void dt_iop_alpha_copy(const
void *const ivoid,
182 const float *
const __restrict__ in = (
const float *
const)ivoid;
183 float *
const __restrict__
out = (
float *
const)
ovoid;
190static inline int FC(
const size_t row,
const size_t col,
const uint32_t filters)
192 return filters >> (((
row << 1 & 14) + (col & 1)) << 1) & 3;
202 const uint8_t (*
const xtrans)[6])
208 int irow =
row + 600;
209 int icol = col + 600;
210 assert(irow >= 0 && icol >= 0);
218 return xtrans[irow % 6][icol % 6];
223static inline
int fcol(const
int row, const
int col, const uint32_t filters, const uint8_t (*const xtrans)[6])
228 return FC(
row, col, filters);
typedef void((*dt_cache_allocate_t)(void *userdata, dt_cache_entry_t *entry))
const float *const const float coeff[3]
static dt_aligned_pixel_t rgb
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_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(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 *const const size_t const size_t height
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_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])
static int FC(const size_t row, const size_t col, const uint32_t filters)
static float dt_iop_eval_cubic(const float *const a, const float x)
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_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)
for(size_t k=3;k< width *height *4;k+=4) out[k]
static int FCxtrans(const int row, const int col, const dt_iop_roi_t *const roi, const uint8_t(*const xtrans)[6])
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)
static void dt_iop_estimate_exp(const float *const x, const float *const y, const int num, float *coeff)
void dt_iop_estimate_cubic(const float x[4], const float y[4], float a[4])
static int fcol(const int row, const int col, const uint32_t filters, const uint8_t(*const xtrans)[6])
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_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)
float *const __restrict__ out
static float dt_iop_eval_exp(const float *const coeff, const float x)
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_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)
void *const const size_t width
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])
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)
float *const restrict const size_t k
#define IS_NULL_PTR(p)
C is way too permissive with !=, == and if(var) checks, which can mean too many things depending on w...
#define __OMP_DECLARE_SIMD__(...)
#define __OMP_FOR_SIMD__(...)
DT_ALIGNED_PIXEL float dt_aligned_pixel_t[4]
Region of interest passed through the pixelpipe.