![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "develop/imageop_gui.h"#include "widgets/bauhaus.h"#include "common/module_versioning.h"#include "system/target_clones.h"#include "pixel/interpolation.h"#include "develop/geometry/geometry.h"#include "develop/imageop.h"#include "develop/tiling.h"#include "iop/iop_api.h"#include <gtk/gtk.h>#include <stdlib.h>#include "widgets/label.h"
Include dependency graph for scalepixels.c:Go to the source code of this file.
Data Structures | |
| struct | dt_iop_scalepixels_params_t |
| struct | dt_iop_scalepixels_gui_data_t |
| struct | dt_iop_scalepixels_data_t |
| struct | dt_iop_scalepixels_geometry_t |
Typedefs | |
| typedef struct dt_iop_scalepixels_params_t | dt_iop_scalepixels_params_t |
| typedef struct dt_iop_scalepixels_gui_data_t | dt_iop_scalepixels_gui_data_t |
| typedef struct dt_iop_scalepixels_data_t | dt_iop_scalepixels_data_t |
| typedef struct dt_iop_scalepixels_geometry_t | dt_iop_scalepixels_geometry_t |
Variables | |
| static const dt_geometry_vtable_t | _scalepixels_geometry_vtable |
| typedef struct dt_iop_scalepixels_data_t dt_iop_scalepixels_data_t |
| typedef struct dt_iop_scalepixels_geometry_t dt_iop_scalepixels_geometry_t |
| typedef struct dt_iop_scalepixels_gui_data_t dt_iop_scalepixels_gui_data_t |
| typedef struct dt_iop_scalepixels_params_t dt_iop_scalepixels_params_t |
|
static |
Definition at line 333 of file scalepixels.c.
References g, i, and dt_iop_scalepixels_geometry_t::x_scale.
|
static |
Definition at line 301 of file scalepixels.c.
References g, dt_iop_roi_t::height, out, dt_iop_roi_t::width, dt_iop_roi_t::x, and dt_iop_roi_t::y.
|
static |
Definition at line 321 of file scalepixels.c.
References g, i, and dt_iop_scalepixels_geometry_t::x_scale.
|
static |
The axis scales this module applies, from its one parameter. THE constructor.
These used to be obtained by calling modify_roi_in() on a SHALLOW COPY of the piece with roi_out set to the full input size – a copy whose ‘data’ pointer still aliased the real one, so the callback's writes landed in the real piece. Working the algebra through shows the dimensions cancel and the result is a pure function of the pixel aspect ratio:
hw = { H, W } transformed -> par < 1 : { H, W/par }, par >= 1 : { H*par, W } reduction = max(hw[0]/H, hw[1]/W) -> par < 1 : 1/par, par >= 1 : par both divided by reduction -> par < 1 : { H*par, W }, par >= 1 : { H, W/par } x_scale = width/W, y_scale = height/H
so x_scale = 1, y_scale = par below one, and x_scale = 1/par, y_scale = 1 at or above it. Same numbers, no aliased copy, and one place that says what the scaling is – which is what the geometry record needs, having no piece to fake.
Definition at line 136 of file scalepixels.c.
Referenced by geometry_record(), and precalculate_scale().
| void cleanup_pipe | ( | dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 378 of file scalepixels.c.
References dt_dev_pixelpipe_iop_t::data, and dt_free_align.
| void commit_params | ( | dt_iop_module_t * | self, |
| dt_iop_params_t * | params, | ||
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 280 of file scalepixels.c.
References d, dt_dev_pixelpipe_iop_t::data, dt_dev_pixelpipe_iop_t::enabled, and p.
| int default_colorspace | ( | dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| const dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 92 of file scalepixels.c.
References IOP_CS_RGB.
| int default_group | ( | ) |
Definition at line 82 of file scalepixels.c.
References IOP_GROUP_TECHNICAL.
| const char ** description | ( | struct dt_iop_module_t * | self | ) |
Definition at line 97 of file scalepixels.c.
References dt_iop_set_description().
| int distort_backtransform | ( | dt_iop_module_t * | self, |
| const dt_dev_pixelpipe_t * | pipe, | ||
| const dt_dev_pixelpipe_iop_t * | piece, | ||
| float * | points, | ||
| size_t | points_count | ||
| ) |
Definition at line 174 of file scalepixels.c.
References d, dt_dev_pixelpipe_iop_t::data, i, and precalculate_scale().
| void distort_mask | ( | struct dt_iop_module_t * | self, |
| const struct dt_dev_pixelpipe_t * | pipe, | ||
| struct dt_dev_pixelpipe_iop_t * | piece, | ||
| const float *const | in, | ||
| float *const | out, | ||
| const dt_iop_roi_t *const | roi_in, | ||
| const dt_iop_roi_t *const | roi_out | ||
| ) |
Definition at line 189 of file scalepixels.c.
References dt_iop_roi_t::height, out, void(), and dt_iop_roi_t::width.
| int distort_transform | ( | dt_iop_module_t * | self, |
| const dt_dev_pixelpipe_t * | pipe, | ||
| const dt_dev_pixelpipe_iop_t * | piece, | ||
| float * | points, | ||
| size_t | points_count | ||
| ) |
Definition at line 159 of file scalepixels.c.
References d, dt_dev_pixelpipe_iop_t::data, i, and precalculate_scale().
| int flags | ( | ) |
Definition at line 76 of file scalepixels.c.
References IOP_FLAGS_ALLOW_TILING, IOP_FLAGS_ONE_INSTANCE, IOP_FLAGS_TILING_FULL_ROI, and IOP_FLAGS_UNSAFE_COPY.
| gboolean geometry_record | ( | dt_iop_module_t * | self, |
| const void * | params, | ||
| dt_geometry_record_t * | record | ||
| ) |
Definition at line 352 of file scalepixels.c.
References _scalepixels_geometry_vtable, _scalepixels_scales(), dt_geometry_record_t::data, dt_free_gpointer(), FALSE, dt_geometry_record_t::free_data, IS_NULL_PTR, p, TRUE, dt_geometry_record_t::vtable, dt_iop_scalepixels_geometry_t::x_scale, and dt_iop_scalepixels_geometry_t::y_scale.
| void gui_init | ( | dt_iop_module_t * | self | ) |
Definition at line 408 of file scalepixels.c.
References dt_ui_label_new(), dt_iop_module_t::gui, IOP_GUI_ALLOC, TRUE, and dt_iop_module_gui_t::widget.
| void gui_update | ( | dt_iop_module_t * | self | ) |
Refresh GUI controls from current params and configuration.
Definition at line 401 of file scalepixels.c.
References dt_iop_module_t::default_enabled, dt_iop_module_t::gui, and dt_iop_module_gui_t::widget.
| void init_pipe | ( | dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 372 of file scalepixels.c.
References dt_dev_pixelpipe_iop_t::data, dt_dev_pixelpipe_iop_t::data_size, and dt_calloc_align().
| void modify_roi_in | ( | dt_iop_module_t * | self, |
| const dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece, | ||
| const dt_iop_roi_t *const | roi_out, | ||
| dt_iop_roi_t * | roi_in | ||
| ) |
Definition at line 223 of file scalepixels.c.
References dt_dev_pixelpipe_iop_t::buf_in, d, dt_dev_pixelpipe_iop_t::data, dt_iop_roi_t::height, MAX, dt_iop_roi_t::scale, transform(), dt_iop_roi_t::width, dt_iop_roi_t::x, and dt_iop_roi_t::y.
| void modify_roi_out | ( | dt_iop_module_t * | self, |
| const dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece, | ||
| dt_iop_roi_t * | roi_out, | ||
| const dt_iop_roi_t *const | roi_in | ||
| ) |
Definition at line 199 of file scalepixels.c.
References dt_iop_roi_t::height, transform(), dt_iop_roi_t::width, dt_iop_roi_t::x, and dt_iop_roi_t::y.
| const char * name | ( | ) |
Definition at line 71 of file scalepixels.c.
| int operation_tags | ( | ) |
Definition at line 87 of file scalepixels.c.
References IOP_TAG_DISTORT.
|
static |
Definition at line 150 of file scalepixels.c.
References _scalepixels_scales(), d, and dt_dev_pixelpipe_iop_t::data.
Referenced by distort_backtransform(), and distort_transform().
| __DT_CLONE_TARGETS__ int process | ( | dt_iop_module_t * | self, |
| const dt_dev_pixelpipe_t * | pipe, | ||
| const dt_dev_pixelpipe_iop_t * | piece, | ||
| const void *const | ivoid, | ||
| void *const | ovoid | ||
| ) |
Definition at line 252 of file scalepixels.c.
References __OMP_PARALLEL_FOR__, ch, dt_iop_buffer_dsc_t::channels, d, dt_dev_pixelpipe_iop_t::data, dt_dev_pixelpipe_iop_t::dsc_in, dt_interpolation_compute_pixel4c(), dt_interpolation_new(), DT_INTERPOLATION_USERPREF, dt_iop_roi_t::height, i, out, ovoid, dt_dev_pixelpipe_iop_t::roi_in, dt_dev_pixelpipe_iop_t::roi_out, void(), dt_iop_roi_t::width, and x.
| void reload_defaults | ( | dt_iop_module_t * | self | ) |
Definition at line 384 of file scalepixels.c.
References d, dt_iop_module_t::default_enabled, dt_iop_module_t::default_params, dt_iop_module_t::dev, dt_iop_module_t::hide_enable_button, dt_develop_t::image_storage, and dt_image_t::pixel_aspect_ratio.
|
static |
Definition at line 105 of file scalepixels.c.
References d, dt_dev_pixelpipe_iop_t::data, and p.
Referenced by modify_roi_in(), and modify_roi_out().
|
static |
Definition at line 346 of file scalepixels.c.
Referenced by geometry_record().