Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
lut3d.c File Reference
#include "bauhaus/bauhaus.h"
#include "common/imageio_png.h"
#include "common/imagebuf.h"
#include "common/colorspaces.h"
#include "common/colorspaces_inline_conversions.h"
#include "common/file_location.h"
#include "common/iop_profile.h"
#include "control/control.h"
#include "develop/imageop.h"
#include "develop/imageop_gui.h"
#include "dtgtk/button.h"
#include "gui/gtk.h"
#include "iop/iop_api.h"
#include <gtk/gtk.h>
#include <libgen.h>
#include <png.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <dirent.h>
+ Include dependency graph for lut3d.c:

Data Structures

struct  dt_iop_lut3d_params_t
 
struct  dt_iop_lut3d_gui_data_t
 
struct  dt_iop_lut3d_data_t
 
struct  dt_iop_lut3d_global_data_t
 

Macros

#define DT_IOP_LUT3D_MAX_PATHNAME   512
 
#define DT_IOP_LUT3D_MAX_LUTNAME   128
 
#define DT_IOP_LUT3D_CLUT_LEVEL   48
 
#define DT_IOP_LUT3D_MAX_KEYPOINTS   2048
 

Typedefs

typedef enum dt_iop_lut3d_colorspace_t dt_iop_lut3d_colorspace_t
 
typedef enum dt_iop_lut3d_interpolation_t dt_iop_lut3d_interpolation_t
 
typedef struct dt_iop_lut3d_params_t dt_iop_lut3d_params_t
 
typedef struct dt_iop_lut3d_gui_data_t dt_iop_lut3d_gui_data_t
 
typedef enum dt_lut3d_cols_t dt_lut3d_cols_t
 
typedef struct dt_iop_lut3d_data_t dt_iop_lut3d_data_t
 
typedef struct dt_iop_lut3d_global_data_t dt_iop_lut3d_global_data_t
 

Enumerations

enum  dt_iop_lut3d_colorspace_t {
  DT_IOP_SRGB = 0 ,
  DT_IOP_ARGB ,
  DT_IOP_REC709 ,
  DT_IOP_LIN_REC709 ,
  DT_IOP_LIN_REC2020 ,
  DT_IOP_ITUR_BT1886
}
 
enum  dt_iop_lut3d_interpolation_t {
  DT_IOP_TETRAHEDRAL = 0 ,
  DT_IOP_TRILINEAR = 1 ,
  DT_IOP_PYRAMID = 2
}
 
enum  dt_lut3d_cols_t {
  DT_LUT3D_COL_NAME = 0 ,
  DT_LUT3D_COL_VISIBLE ,
  DT_LUT3D_NUM_COLS
}
 

Functions

const char * name ()
 
const char ** description (struct dt_iop_module_t *self)
 
int flags ()
 
int default_group ()
 
int default_colorspace (dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
 
int legacy_params (dt_iop_module_t *self, const void *const old_params, const int old_version, void *new_params, const int new_version)
 
void correct_pixel_trilinear (const float *const in, float *const out, const size_t pixel_nb, const float *const restrict clut, const uint16_t level)
 
void correct_pixel_tetrahedral (const float *const in, float *const out, const size_t pixel_nb, const float *const restrict clut, const uint16_t level)
 
void correct_pixel_pyramid (const float *const in, float *const out, const size_t pixel_nb, const float *const restrict clut, const uint16_t level)
 
void get_cache_filename (const char *const lutname, char *const cache_filename)
 
uint16_t calculate_clut_haldclut (dt_iop_lut3d_params_t *const p, const char *const filepath, float **clut)
 
double dt_atof (const char *str)
 
uint8_t parse_cube_line (char *line, char(*token)[50])
 
uint16_t calculate_clut_cube (const char *const filepath, float **clut)
 
uint16_t calculate_clut_3dl (const char *const filepath, float **clut)
 
void process (struct dt_iop_module_t *self, dt_dev_pixelpipe_iop_t *piece, const void *const ibuf, void *const obuf, const dt_iop_roi_t *const roi_in, const dt_iop_roi_t *const roi_out)
 
void filepath_set_unix_separator (char *filepath)
 
void init_global (dt_iop_module_so_t *module)
 
void cleanup_global (dt_iop_module_so_t *module)
 
static int calculate_clut (dt_iop_lut3d_params_t *const p, float **clut)
 
void commit_params (struct dt_iop_module_t *self, dt_iop_params_t *p1, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
 
void init_pipe (struct dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
 
void cleanup_pipe (struct dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
 
static void filepath_callback (GtkWidget *widget, dt_iop_module_t *self)
 
static void remove_root_from_path (const char *const lutfolder, char *const filepath)
 
gboolean check_extension (char *filename)
 
static gint array_str_cmp (gconstpointer a, gconstpointer b)
 
static void update_filepath_combobox (dt_iop_lut3d_gui_data_t *g, char *filepath, char *lutfolder)
 
static void button_clicked (GtkWidget *widget, dt_iop_module_t *self)
 
static void _show_hide_colorspace (dt_iop_module_t *self)
 
void gui_update (dt_iop_module_t *self)
 
void module_moved_callback (gpointer instance, dt_iop_module_t *self)
 
void gui_init (dt_iop_module_t *self)
 
void gui_cleanup (dt_iop_module_t *self)
 

Variables

const char invalid_filepath_prefix [] = "INVALID >> "
 

Macro Definition Documentation

◆ DT_IOP_LUT3D_CLUT_LEVEL

#define DT_IOP_LUT3D_CLUT_LEVEL   48

◆ DT_IOP_LUT3D_MAX_KEYPOINTS

#define DT_IOP_LUT3D_MAX_KEYPOINTS   2048

◆ DT_IOP_LUT3D_MAX_LUTNAME

#define DT_IOP_LUT3D_MAX_LUTNAME   128

◆ DT_IOP_LUT3D_MAX_PATHNAME

#define DT_IOP_LUT3D_MAX_PATHNAME   512

Typedef Documentation

◆ dt_iop_lut3d_colorspace_t

◆ dt_iop_lut3d_data_t

◆ dt_iop_lut3d_global_data_t

◆ dt_iop_lut3d_gui_data_t

◆ dt_iop_lut3d_interpolation_t

◆ dt_iop_lut3d_params_t

◆ dt_lut3d_cols_t

Enumeration Type Documentation

◆ dt_iop_lut3d_colorspace_t

Enumerator
DT_IOP_SRGB 
DT_IOP_ARGB 
DT_IOP_REC709 
DT_IOP_LIN_REC709 
DT_IOP_LIN_REC2020 
DT_IOP_ITUR_BT1886 

◆ dt_iop_lut3d_interpolation_t

Enumerator
DT_IOP_TETRAHEDRAL 
DT_IOP_TRILINEAR 
DT_IOP_PYRAMID 

◆ dt_lut3d_cols_t

Enumerator
DT_LUT3D_COL_NAME 
DT_LUT3D_COL_VISIBLE 
DT_LUT3D_NUM_COLS 

Function Documentation

◆ _show_hide_colorspace()

◆ array_str_cmp()

static gint array_str_cmp ( gconstpointer  a,
gconstpointer  b 
)
static

◆ button_clicked()

◆ calculate_clut()

static int calculate_clut ( dt_iop_lut3d_params_t *const  p,
float **  clut 
)
static

◆ calculate_clut_3dl()

uint16_t calculate_clut_3dl ( const char *const  filepath,
float **  clut 
)

◆ calculate_clut_cube()

uint16_t calculate_clut_cube ( const char *const  filepath,
float **  clut 
)

◆ calculate_clut_haldclut()

◆ check_extension()

gboolean check_extension ( char *  filename)

References FALSE, and TRUE.

Referenced by update_filepath_combobox().

◆ cleanup_global()

◆ cleanup_pipe()

◆ commit_params()

◆ correct_pixel_pyramid()

void correct_pixel_pyramid ( const float *const  in,
float *const  out,
const size_t  pixel_nb,
const float *const restrict  clut,
const uint16_t  level 
)

Referenced by process().

◆ correct_pixel_tetrahedral()

void correct_pixel_tetrahedral ( const float *const  in,
float *const  out,
const size_t  pixel_nb,
const float *const restrict  clut,
const uint16_t  level 
)

Referenced by process().

◆ correct_pixel_trilinear()

void correct_pixel_trilinear ( const float *const  in,
float *const  out,
const size_t  pixel_nb,
const float *const restrict  clut,
const uint16_t  level 
)

Referenced by process().

◆ default_colorspace()

int default_colorspace ( dt_iop_module_t self,
dt_dev_pixelpipe_t pipe,
dt_dev_pixelpipe_iop_t piece 
)

References IOP_CS_RGB.

◆ default_group()

int default_group ( )

References IOP_GROUP_COLOR.

◆ description()

const char ** description ( struct dt_iop_module_t self)

◆ dt_atof()

double dt_atof ( const char *  str)

References sign().

Referenced by calculate_clut_cube().

◆ filepath_callback()

◆ filepath_set_unix_separator()

void filepath_set_unix_separator ( char *  filepath)

◆ flags()

◆ get_cache_filename()

void get_cache_filename ( const char *const  lutname,
char *const  cache_filename 
)

◆ gui_cleanup()

◆ gui_init()

◆ gui_update()

◆ init_global()

◆ init_pipe()

◆ legacy_params()

◆ module_moved_callback()

void module_moved_callback ( gpointer  instance,
dt_iop_module_t self 
)

References _show_hide_colorspace().

Referenced by gui_cleanup(), and gui_init().

◆ name()

const char * name ( )

◆ parse_cube_line()

uint8_t parse_cube_line ( char *  line,
char(*)  token[50] 
)

◆ process()

◆ remove_root_from_path()

static void remove_root_from_path ( const char *const  lutfolder,
char *const  filepath 
)
static

Referenced by button_clicked().

◆ update_filepath_combobox()

Variable Documentation

◆ invalid_filepath_prefix

const char invalid_filepath_prefix[] = "INVALID >> "