Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
imageop_math.h File Reference
#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)
 
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)
 
static void dt_iop_alpha_copy (const void *const ivoid, void *const ovoid, const size_t width, const size_t height)
 
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])
 

Macro Definition Documentation

◆ ALPHA

#define ALPHA   3

◆ BLUE

#define BLUE   2

◆ GREEN

#define GREEN   1

◆ RED

#define RED   0

Function Documentation

◆ dt_iop_alpha_copy()

static void dt_iop_alpha_copy ( const void *const  ivoid,
void *const  ovoid,
const size_t  width,
const size_t  height 
)
inlinestatic

◆ dt_iop_clip_and_zoom()

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.

◆ dt_iop_clip_and_zoom_8()

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 
)

as dt_iop_clip_and_zoom, but for rgba 8-bit channels.

References MAX, and MIN.

◆ dt_iop_clip_and_zoom_demosaic_half_size_f()

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 
)

◆ dt_iop_clip_and_zoom_demosaic_passthrough_monochrome_f()

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 
)

◆ dt_iop_clip_and_zoom_demosaic_third_size_xtrans_f()

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

◆ dt_iop_clip_and_zoom_mosaic_half_size()

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 
)

◆ dt_iop_clip_and_zoom_mosaic_half_size_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 
)

◆ dt_iop_clip_and_zoom_mosaic_third_size_xtrans()

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 FCxtrans(), dt_iop_roi_t::height, MAX, MIN, dt_iop_roi_t::scale, dt_iop_roi_t::width, dt_iop_roi_t::x, and dt_iop_roi_t::y.

Referenced by _init_f().

◆ dt_iop_clip_and_zoom_mosaic_third_size_xtrans_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] 
)

◆ dt_iop_clip_and_zoom_roi()

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.

◆ dt_iop_estimate_cubic()

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(), and mat4mulv().

◆ dt_iop_estimate_exp()

static void dt_iop_estimate_exp ( const float *const  x,
const float *const  y,
const int  num,
float *  coeff 
)
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.

Referenced by _area_draw_callback(), _generate_curve_lut(), _init_unbounded_coeffs(), commit_params(), commit_params(), dt_iop_basecurve_draw(), and dt_iop_tonecurve_draw().

◆ dt_iop_eval_cubic()

static float dt_iop_eval_cubic ( const float *const  a,
const float  x 
)
inlinestatic

evaluates the cubic fit, i.e. returns y = a^t [x^3 x^2 x^1 1]

◆ dt_iop_eval_exp()

static float dt_iop_eval_exp ( const float *const  coeff,
const float  x 
)
inlinestatic

◆ dt_iop_flip_and_zoom_8()

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 bpp, height, MAX, MIN, ORIENTATION_FLIP_X, ORIENTATION_FLIP_Y, ORIENTATION_SWAP_XY, and width.

Referenced by _init_8(), and _load_jpg().

◆ dt_iop_RGB_to_YCbCr()

void dt_iop_RGB_to_YCbCr ( const dt_aligned_pixel_t  rgb,
dt_aligned_pixel_t  yuv 
)

◆ dt_iop_YCbCr_to_RGB()

void dt_iop_YCbCr_to_RGB ( const dt_aligned_pixel_t  yuv,
dt_aligned_pixel_t  rgb 
)

◆ FC()

static int FC ( const size_t  row,
const size_t  col,
const uint32_t  filters 
)
inlinestatic

Calculate the bayer pattern color from the row and column

Referenced by fcol().

◆ fcol()

static int fcol ( const int  row,
const int  col,
const uint32_t  filters,
const uint8_t(*)  xtrans[6] 
)
inlinestatic

References FC(), and FCxtrans().

Referenced by lin_interpolate(), and vng_interpolate().

◆ FCxtrans()

static int FCxtrans ( const int  row,
const int  col,
const dt_iop_roi_t *const  roi,
const uint8_t(*)  xtrans[6] 
)
inlinestatic

Calculate the xtrans pattern color from the row and column

References dt_iop_roi_t::x, and dt_iop_roi_t::y.

Referenced by fcol().