![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#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>
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 >> " |
#define DT_IOP_LUT3D_CLUT_LEVEL 48 |
#define DT_IOP_LUT3D_MAX_KEYPOINTS 2048 |
#define DT_IOP_LUT3D_MAX_LUTNAME 128 |
#define DT_IOP_LUT3D_MAX_PATHNAME 512 |
typedef enum dt_iop_lut3d_colorspace_t dt_iop_lut3d_colorspace_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 |
typedef struct dt_iop_lut3d_gui_data_t dt_iop_lut3d_gui_data_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 enum dt_lut3d_cols_t dt_lut3d_cols_t |
enum dt_lut3d_cols_t |
|
static |
References dt_iop_module_t::dev, dt_ioppr_get_iop_order(), dt_iop_module_t::gui_data, dt_develop_t::iop_order_list, dt_iop_module_t::multi_priority, and dt_iop_module_t::op.
Referenced by gui_update(), and module_moved_callback().
|
static |
Referenced by update_filepath_combobox().
|
static |
References darktable, darktable_t::develop, dt_bauhaus_combobox_get_text(), dt_conf_get_string(), dt_control_log(), dt_dev_add_history_item, dt_ui_main_window(), FALSE, filepath_set_unix_separator(), darktable_t::gui, dt_iop_module_t::gui_data, dt_iop_module_t::params, remove_root_from_path(), TRUE, dt_gui_gtk_t::ui, and update_filepath_combobox().
Referenced by gui_init().
|
static |
References calculate_clut_3dl(), calculate_clut_cube(), calculate_clut_haldclut(), and dt_conf_get_string().
Referenced by commit_params().
uint16_t calculate_clut_3dl | ( | const char *const | filepath, |
float ** | clut | ||
) |
References dt_alloc_align, dt_control_log(), DT_DEBUG_DEV, dt_free_align, dt_print(), getline(), and parse_cube_line().
Referenced by calculate_clut().
uint16_t calculate_clut_cube | ( | const char *const | filepath, |
float ** | clut | ||
) |
References dt_alloc_align, dt_atof(), dt_control_log(), DT_DEBUG_DEV, dt_free_align, dt_print(), getline(), and parse_cube_line().
Referenced by calculate_clut().
uint16_t calculate_clut_haldclut | ( | dt_iop_lut3d_params_t *const | p, |
const char *const | filepath, | ||
float ** | clut | ||
) |
References dt_imageio_png_t::bit_depth, dt_imageio_png_t::color_type, dt_alloc_align, dt_control_log(), DT_DEBUG_DEV, dt_free_align, dt_print(), dt_imageio_png_t::f, dt_imageio_png_t::height, dt_imageio_png_t::info_ptr, dt_imageio_png_t::png_ptr, read_header(), read_image(), and dt_imageio_png_t::width.
Referenced by calculate_clut().
gboolean check_extension | ( | char * | filename | ) |
Referenced by update_filepath_combobox().
void cleanup_global | ( | dt_iop_module_so_t * | module | ) |
void cleanup_pipe | ( | struct dt_iop_module_t * | self, |
dt_dev_pixelpipe_t * | pipe, | ||
dt_dev_pixelpipe_iop_t * | piece | ||
) |
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 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().
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().
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().
int default_colorspace | ( | dt_iop_module_t * | self, |
dt_dev_pixelpipe_t * | pipe, | ||
dt_dev_pixelpipe_iop_t * | piece | ||
) |
References IOP_CS_RGB.
int default_group | ( | ) |
References IOP_GROUP_COLOR.
const char ** description | ( | struct dt_iop_module_t * | self | ) |
References dt_iop_set_description().
double dt_atof | ( | const char * | str | ) |
References sign().
Referenced by calculate_clut_cube().
|
static |
References darktable, darktable_t::develop, dt_bauhaus_combobox_get_text(), dt_dev_add_history_item, DT_IOP_LUT3D_MAX_PATHNAME, FALSE, filepath_set_unix_separator(), darktable_t::gui, dt_iop_module_t::gui_data, invalid_filepath_prefix, lut3d_clear_lutname_list(), dt_iop_module_t::params, dt_gui_gtk_t::reset, and TRUE.
Referenced by gui_init().
void filepath_set_unix_separator | ( | char * | filepath | ) |
Referenced by button_clicked(), filepath_callback(), and update_filepath_combobox().
int flags | ( | ) |
References IOP_FLAGS_INCLUDE_IN_STYLES, and IOP_FLAGS_SUPPORTS_BLENDING.
void get_cache_filename | ( | const char *const | lutname, |
char *const | cache_filename | ||
) |
References DT_IOP_LUT3D_MAX_PATHNAME.
void gui_cleanup | ( | dt_iop_module_t * | self | ) |
void gui_init | ( | dt_iop_module_t * | self | ) |
References darktable_t::bauhaus, button_clicked(), CPF_NONE, darktable, dt_accels_disconnect_on_text_input(), dt_bauhaus_combobox_from_params(), dt_bauhaus_combobox_new(), dt_bauhaus_combobox_set_entries_ellipsis(), DT_BAUHAUS_SPACE, DT_DEBUG_CONTROL_SIGNAL_CONNECT, DT_GUI_MODULE, DT_LUT3D_COL_NAME, DT_LUT3D_COL_VISIBLE, DT_LUT3D_NUM_COLS, DT_PIXEL_APPLY_DPI, DT_SIGNAL_DEVELOP_MODULE_MOVED, dtgtk_button_new(), dtgtk_cairo_paint_directory(), entry_callback(), FALSE, filepath_callback(), IOP_GUI_ALLOC, module_moved_callback(), darktable_t::signals, TRUE, view(), and dt_iop_module_t::widget.
void gui_update | ( | dt_iop_module_t * | self | ) |
void init_global | ( | dt_iop_module_so_t * | module | ) |
void init_pipe | ( | struct 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 | ||
) |
References dt_iop_lut3d_params_t::c_clut, dt_iop_lut3d_params_t::colorspace, DT_IOP_LUT3D_MAX_KEYPOINTS, DT_IOP_LUT3D_MAX_LUTNAME, DT_IOP_LUT3D_MAX_PATHNAME, dt_iop_lut3d_params_t::filepath, dt_iop_lut3d_params_t::interpolation, dt_iop_lut3d_params_t::lutname, and dt_iop_lut3d_params_t::nb_keypoints.
void module_moved_callback | ( | gpointer | instance, |
dt_iop_module_t * | self | ||
) |
References _show_hide_colorspace().
Referenced by gui_cleanup(), and gui_init().
const char * name | ( | ) |
uint8_t parse_cube_line | ( | char * | line, |
char(*) | token[50] | ||
) |
Referenced by calculate_clut_3dl(), and calculate_clut_cube().
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 | ||
) |
References dt_iop_lut3d_data_t::clut, dt_dev_pixelpipe_iop_t::colors, dt_iop_lut3d_params_t::colorspace, correct_pixel_pyramid(), correct_pixel_tetrahedral(), correct_pixel_trilinear(), dt_dev_pixelpipe_iop_t::data, dt_iop_module_t::dev, DT_COLORSPACE_ADOBERGB, DT_COLORSPACE_ITUR_BT1886, DT_COLORSPACE_LIN_REC2020, DT_COLORSPACE_LIN_REC709, DT_COLORSPACE_REC709, DT_COLORSPACE_SRGB, DT_IOP_ARGB, dt_iop_image_copy_by_size(), DT_IOP_ITUR_BT1886, DT_IOP_LIN_REC709, DT_IOP_REC709, DT_IOP_SRGB, DT_IOP_TETRAHEDRAL, DT_IOP_TRILINEAR, dt_ioppr_add_profile_info_to_list(), dt_ioppr_get_iop_work_profile_info(), dt_ioppr_transform_image_colorspace_rgb(), FALSE, height, dt_iop_roi_t::height, dt_iop_lut3d_params_t::interpolation, dt_develop_t::iop, dt_iop_lut3d_data_t::level, dt_iop_lut3d_data_t::params, transform(), TRUE, width, and dt_iop_roi_t::width.
|
static |
Referenced by button_clicked().
|
static |
References array_str_cmp(), check_extension(), dt_bauhaus_data_t::combobox, dt_bauhaus_widget_t::data, dt_bauhaus_combobox_add(), dt_bauhaus_combobox_clear(), dt_bauhaus_combobox_set_from_text(), DT_BAUHAUS_WIDGET, dt_bauhaus_combobox_data_t::entries, filepath_set_unix_separator(), and invalid_filepath_prefix.
Referenced by button_clicked(), and gui_update().
const char invalid_filepath_prefix[] = "INVALID >> " |
Referenced by filepath_callback(), and update_filepath_combobox().