![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <math.h>
#include <unistd.h>
#include <string.h>
#include <getopt.h>
#include <inttypes.h>
#include <errno.h>
#include "../../src/common/curve_tools.c"
Data Structures | |
struct | dt_iop_basecurve_node_t |
struct | dt_iop_basecurve_params_t |
struct | dt_iop_tonecurve_node_t |
struct | dt_iop_tonecurve_params_t |
struct | options |
Macros | |
#define | CURVE_RESOLUTION 0x10000 |
#define | BASECURVE_PARAMS_VERSION 2 |
#define | DT_IOP_BASECURVE_MAXNODES 20 |
#define | TONECURVE_PARAMS_VERSION 4 |
#define | DT_IOP_TONECURVE_MAXNODES 20 |
#define | SQUARE(a) ((a)*(a)) |
#define | CUBIC(a) ((a)*SQUARE((a))) |
Typedefs | |
typedef struct dt_iop_basecurve_node_t | dt_iop_basecurve_node_t |
typedef struct dt_iop_basecurve_params_t | dt_iop_basecurve_params_t |
typedef struct dt_iop_tonecurve_node_t | dt_iop_tonecurve_node_t |
typedef struct dt_iop_tonecurve_params_t | dt_iop_tonecurve_params_t |
Enumerations | |
enum | module_type { MODULE_BASECURVE = 0 , MODULE_TONECURVE = 1 , MODULE_MAX } |
Functions | |
int | exif_get_ascii_datafield (const char *filename, const char *key, char *buf, size_t buflen) |
static void | hexify (uint8_t *out, const uint8_t *in, size_t len) |
static int | read_ppm_header (FILE *f, int *wd, int *ht) |
static uint16_t * | read_ppm16 (const char *filename, int *wd, int *ht) |
static uint8_t * | read_ppm8 (const char *filename, int *wd, int *ht) |
static float | get_error (CurveData *c, CurveSample *csample, float *basecurve, uint32_t *cnt) |
static void | mutate (CurveData *c, CurveData *t, float *basecurve) |
static float | linearize_sRGB (float val) |
static float | Lab (float val) |
static void | RGB2Lab (float *L, float *a, float *b, float R, float G, float B) |
static void | Lab2UnitCube (float *L, float *a, float *b) |
static void | linearize_8bit (int width, int height, uint8_t *_s, float *_d) |
static void | linearize_16bit (int width, int height, uint16_t *_s, float *_d) |
static void | build_channel_basecurve (int width_jpeg, int height_jpeg, float *buf_jpeg, int offx_raw, int offy_raw, int width_raw, float *buf_raw, int ch, float *curve, uint32_t *cnt) |
static void | build_tonecurve (int width_jpeg, int height_jpeg, float *buf_jpeg, int offx_raw, int offy_raw, int width_raw, float *buf_raw, float *curve, uint32_t *hist) |
static void | fit_curve (CurveData *best, int *nopt, float *minsqerr, CurveSample *csample, int num_nodes, float *curve, uint32_t *cnt) |
static int | is_bigendian () |
static void | print_usage (const char *name) |
static void | set_default_options (struct options *opts) |
static int | parse_arguments (int argc, char **argv, struct options *opts) |
void | read_curveset (FILE *f, float *curve, uint32_t *hist) |
int | write_curveset (FILE *f, float *curve, uint32_t *hist) |
int | main (int argc, char **argv) |
#define BASECURVE_PARAMS_VERSION 2 |
#define CUBIC | ( | a | ) | ((a)*SQUARE((a))) |
#define CURVE_RESOLUTION 0x10000 |
#define DT_IOP_BASECURVE_MAXNODES 20 |
#define DT_IOP_TONECURVE_MAXNODES 20 |
#define SQUARE | ( | a | ) | ((a)*(a)) |
#define TONECURVE_PARAMS_VERSION 4 |
typedef struct dt_iop_basecurve_node_t dt_iop_basecurve_node_t |
typedef struct dt_iop_basecurve_params_t dt_iop_basecurve_params_t |
typedef struct dt_iop_tonecurve_node_t dt_iop_tonecurve_node_t |
typedef struct dt_iop_tonecurve_params_t dt_iop_tonecurve_params_t |
enum module_type |
|
static |
References CURVE_RESOLUTION.
Referenced by main().
|
static |
References CURVE_RESOLUTION, Lab2UnitCube(), and RGB2Lab().
Referenced by main().
|
extern |
|
static |
References CURVE_RESOLUTION, get_error(), m, CurveData::m_anchors, CurveData::m_max_x, CurveData::m_max_y, CurveData::m_min_x, CurveData::m_min_y, CurveData::m_numAnchors, CurveData::m_spline_type, mutate(), CurveAnchorPoint::x, and CurveAnchorPoint::y.
Referenced by main().
|
inlinestatic |
References CURVE_RESOLUTION, CurveDataSample(), and CurveSample::m_Samples.
Referenced by fit_curve().
|
inlinestatic |
References __attribute__().
Referenced by main().
|
inlinestatic |
Referenced by _auto_set_exposure(), _auto_set_illuminant(), _colormanage_ui_color(), _paint_hue(), _read_chunky_16_Lab(), _read_chunky_8_Lab(), _target_color_draw(), checker_draw(), checker_set_color(), cluster_preview_draw(), color_picker_apply(), commit_params(), dt_iop_colorcorrection_draw(), dt_iop_monochrome_draw(), dt_Lab_2_LCH(), dt_Lab_to_prophotorgb(), dt_Lab_to_XYZ(), dt_LCH_2_Lab(), dt_prophotorgb_to_Lab(), dt_XYZ_to_Lab(), get_Lab_from_box(), get_skin_tones_range(), hue_conversion(), image_lab2rgb(), kmeans(), kmeans(), Lab_2_LCH(), Lab_to_prophotorgb(), Lab_to_XYZ(), Lch_to_color_name(), paint_hue(), process(), process_data(), RGB2Lab(), rt_process_stats(), target_color_draw(), and update_table().
|
inlinestatic |
Referenced by build_tonecurve().
|
static |
|
static |
References height, linearize_sRGB(), and width.
Referenced by main().
|
inlinestatic |
Referenced by linearize_8bit().
int main | ( | int | argc, |
char ** | argv | ||
) |
References BASECURVE_PARAMS_VERSION, build_channel_basecurve(), build_tonecurve(), CURVE_RESOLUTION, CurveDataSample(), exif_get_ascii_datafield(), f(), options::filename_basecurve, options::filename_basecurve_fit, options::filename_exif, options::filename_jpeg, options::filename_raw, options::filename_state, options::filename_tonecurve, options::filename_tonecurve_fit, options::finalize, fit_curve(), hexify(), is_bigendian(), linearize_16bit(), linearize_8bit(), CurveData::m_anchors, CurveData::m_numAnchors, CurveSample::m_outputRes, CurveSample::m_Samples, CurveSample::m_samplingRes, maker, model, MONOTONE_HERMITE, options::num_nodes, parse_arguments(), read_curveset(), read_ppm16(), read_ppm8(), options::scale_ab, set_default_options(), TONECURVE_PARAMS_VERSION, write_curveset(), CurveAnchorPoint::x, and CurveAnchorPoint::y.
References CURVE_RESOLUTION, CurveData::m_anchors, CurveData::m_numAnchors, CurveAnchorPoint::x, and CurveAnchorPoint::y.
Referenced by fit_curve().
|
static |
References options::filename_basecurve, options::filename_basecurve_fit, options::filename_exif, options::filename_jpeg, options::filename_raw, options::filename_state, options::filename_tonecurve, options::filename_tonecurve_fit, options::finalize, options::num_nodes, print_usage(), and options::scale_ab.
Referenced by main().
|
static |
References name.
Referenced by parse_arguments().
void read_curveset | ( | FILE * | f, |
float * | curve, | ||
uint32_t * | hist | ||
) |
References CURVE_RESOLUTION, and f().
Referenced by main().
|
static |
References f(), and read_ppm_header().
Referenced by main().
|
static |
References f(), and read_ppm_header().
Referenced by main().
|
static |
References f().
Referenced by read_ppm16(), and read_ppm8().
|
inlinestatic |
Referenced by build_tonecurve().
References options::filename_basecurve, options::filename_basecurve_fit, options::filename_exif, options::filename_jpeg, options::filename_raw, options::filename_state, options::filename_tonecurve, options::filename_tonecurve_fit, options::finalize, options::num_nodes, and options::scale_ab.
Referenced by main().
int write_curveset | ( | FILE * | f, |
float * | curve, | ||
uint32_t * | hist | ||
) |
References CURVE_RESOLUTION, and f().
Referenced by main().