![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "widgets/widget_settings.h"#include "database/database.h"#include "database/history_repository.h"#include <assert.h>#include "system/openmp.h"#include "system/mem_alloc.h"#include "common/logging.h"#include "common/module_versioning.h"#include <gdk/gdkkeysyms.h>#include <gtk/gtk.h>#include <inttypes.h>#include <math.h>#include <stdlib.h>#include <string.h>#include "imageio/imageio_core.h"#include "common/opencl.h"#include "develop/develop.h"#include "develop/geometry/geometry.h"#include "develop/imageop.h"#include "develop/imageop_gui.h"#include "gui/presets.h"#include "iop/iop_api.h"
Include dependency graph for flip.c:Go to the source code of this file.
Data Structures | |
| struct | dt_iop_flip_params_t |
| struct | dt_iop_flip_global_data_t |
| struct | dt_iop_flip_geometry_t |
Typedefs | |
| typedef struct dt_iop_flip_params_t | dt_iop_flip_params_t |
| typedef struct dt_iop_flip_params_t | dt_iop_flip_data_t |
| typedef struct dt_iop_flip_global_data_t | dt_iop_flip_global_data_t |
| typedef struct dt_iop_flip_geometry_t | dt_iop_flip_geometry_t |
Variables | |
| static const dt_geometry_vtable_t | _flip_geometry_vtable |
| typedef struct dt_iop_flip_params_t dt_iop_flip_data_t |
| typedef struct dt_iop_flip_geometry_t dt_iop_flip_geometry_t |
| typedef struct dt_iop_flip_global_data_t dt_iop_flip_global_data_t |
| typedef struct dt_iop_flip_params_t dt_iop_flip_params_t |
|
static |
Definition at line 493 of file flip.c.
References dt_iop_roi_t::height, i, dt_geometry_record_t::in, ORIENTATION_FLIP_X, ORIENTATION_FLIP_Y, ORIENTATION_SWAP_XY, dt_iop_roi_t::width, and x.
|
static |
Definition at line 466 of file flip.c.
References _flip_map_size(), and out.
|
static |
Definition at line 471 of file flip.c.
References dt_iop_roi_t::height, i, dt_geometry_record_t::in, ORIENTATION_FLIP_X, ORIENTATION_FLIP_Y, ORIENTATION_SWAP_XY, dt_iop_roi_t::width, and x.
|
static |
Definition at line 647 of file flip.c.
References dt_iop_module_t::dev, dt_dev_add_history_item, dt_image_orientation(), dt_develop_t::image_storage, ORIENTATION_FLIP_HORIZONTALLY, ORIENTATION_FLIP_VERTICALLY, ORIENTATION_NULL, ORIENTATION_SWAP_XY, p, dt_iop_module_t::params, and TRUE.
Referenced by gui_init().
|
static |
Input rect -> output rect: a swap, or nothing.
Definition at line 250 of file flip.c.
References dt_iop_roi_t::height, ORIENTATION_SWAP_XY, and dt_iop_roi_t::width.
Referenced by _flip_geometry_map_size(), and modify_roi_out().
|
static |
The orientation this module will actually apply.
ORIENTATION_NULL means "whatever the file says", which is resolved from the image's EXIF here rather than stored in params – so the resolution has to happen identically wherever the orientation is consumed, or a record would describe a rotation the pipe is not doing.
Definition at line 243 of file flip.c.
References dt_iop_module_t::dev, dt_image_orientation(), dt_develop_t::image_storage, ORIENTATION_NULL, and p.
Referenced by commit_params(), and geometry_record().
|
static |
Definition at line 661 of file flip.c.
References dt_iop_module_t::dev, dt_dev_add_history_item, dt_image_orientation(), dt_develop_t::image_storage, ORIENTATION_FLIP_HORIZONTALLY, ORIENTATION_FLIP_VERTICALLY, ORIENTATION_NULL, ORIENTATION_SWAP_XY, p, dt_iop_module_t::params, and TRUE.
Referenced by gui_init().
|
static |
|
static |
Definition at line 203 of file flip.c.
References o, ORIENTATION_FLIP_X, ORIENTATION_FLIP_Y, ORIENTATION_SWAP_XY, and x.
Referenced by modify_roi_in().
| void cleanup_global | ( | dt_iop_module_so_t * | self | ) |
Definition at line 441 of file flip.c.
References dt_iop_module_so_t::data, dt_free, dt_opencl_free_kernel(), and dt_iop_flip_global_data_t::kernel_flip.
| void cleanup_pipe | ( | struct dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 548 of file flip.c.
References dt_free_align, and 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 | ||
| ) |
Definition at line 448 of file flip.c.
References _flip_resolve(), d, ORIENTATION_NONE, p, and piece.
| int default_colorspace | ( | dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| const dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 125 of file flip.c.
References IOP_CS_RGB.
| int default_group | ( | ) |
Definition at line 110 of file flip.c.
References IOP_GROUP_TECHNICAL.
| const char ** description | ( | struct dt_iop_module_t * | self | ) |
Definition at line 130 of file flip.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 *const restrict | points, | ||
| size_t | points_count | ||
| ) |
Definition at line 290 of file flip.c.
References __OMP_PARALLEL_FOR__, d, i, ORIENTATION_FLIP_X, ORIENTATION_FLIP_Y, ORIENTATION_SWAP_XY, piece, and x.
| 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 322 of file flip.c.
References bpp, d, dt_imageio_flip_buffers(), dt_iop_roi_t::height, out, piece, pipe, 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 *const restrict | points, | ||
| size_t | points_count | ||
| ) |
Definition at line 263 of file flip.c.
References __OMP_PARALLEL_FOR__, d, i, ORIENTATION_FLIP_X, ORIENTATION_FLIP_Y, ORIENTATION_SWAP_XY, piece, and x.
|
static |
Definition at line 613 of file flip.c.
References dt_iop_module_t::dev, dt_dev_add_history_item, dt_image_orientation(), dt_develop_t::image_storage, ORIENTATION_FLIP_X, ORIENTATION_FLIP_Y, ORIENTATION_NULL, ORIENTATION_SWAP_XY, p, dt_iop_module_t::params, and TRUE.
Referenced by rotate_ccw(), and rotate_cw().
| int flags | ( | ) |
Definition at line 120 of file flip.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 521 of file flip.c.
References _flip_geometry_vtable, _flip_resolve(), dt_geometry_record_t::data, dt_free_gpointer(), FALSE, dt_geometry_record_t::free_data, IS_NULL_PTR, dt_iop_flip_geometry_t::orientation, ORIENTATION_NONE, params, TRUE, and dt_geometry_record_t::vtable.
|
static |
| void gui_cleanup | ( | struct dt_iop_module_t * | self | ) |
Definition at line 701 of file flip.c.
References dt_iop_module_t::gui, and dt_iop_module_gui_t::gui_data.
| void gui_init | ( | struct dt_iop_module_t * | self | ) |
Definition at line 676 of file flip.c.
References _flip_h(), _flip_v(), DT_GUI_BOX_SPACING, dt_iop_button_new(), dt_iop_gui_reset_label_new(), dtgtk_cairo_paint_flip(), dtgtk_cairo_paint_refresh(), FALSE, dt_iop_module_t::gui, dt_iop_module_gui_t::gui_data, p, dt_iop_module_t::params, rotate_ccw(), rotate_cw(), TRUE, and dt_iop_module_gui_t::widget.
| void init_global | ( | dt_iop_module_so_t * | self | ) |
Definition at line 433 of file flip.c.
References dt_iop_module_so_t::data, dt_opencl_create_kernel(), and dt_iop_flip_global_data_t::kernel_flip.
| void init_pipe | ( | struct dt_iop_module_t * | self, |
| dt_dev_pixelpipe_t * | pipe, | ||
| dt_dev_pixelpipe_iop_t * | piece | ||
| ) |
Definition at line 542 of file flip.c.
References dt_calloc_align(), and piece.
| void init_presets | ( | dt_iop_module_so_t * | self | ) |
Definition at line 554 of file flip.c.
References dt_database_release_transaction, dt_database_start_transaction, dt_gui_presets_add_generic(), dt_gui_presets_update_autoapply(), dt_iop_module_so_t::op, ORIENTATION_FLIP_HORIZONTALLY, ORIENTATION_FLIP_VERTICALLY, ORIENTATION_NONE, ORIENTATION_NULL, ORIENTATION_ROTATE_180_DEG, ORIENTATION_ROTATE_CCW_90_DEG, ORIENTATION_ROTATE_CW_90_DEG, and p.
| int legacy_params | ( | dt_iop_module_t * | self, |
| const void *const | old_params, | ||
| const int | old_version, | ||
| void * | new_params, | ||
| const int | new_version | ||
| ) |
Definition at line 173 of file flip.c.
References d, dt_iop_module_t::default_params, dt_iop_module_t::dev, dt_image_orientation(), dt_develop_t::image_storage, merge_two_orientations(), n, and ORIENTATION_NONE.
|
static |
Merges raw camera orientation with user-specified orientation
| raw_orientation | Camera/EXIF orientation (bits: Y=1, X=2, XY=4) |
| user_orientation | User rotation/flip request (same bit format) |
When user requests XY swap, we must swap the X/Y flip bits in raw orientation before applying the XOR combination. This ensures proper coordinate transformation.
Definition at line 145 of file flip.c.
References ORIENTATION_FLIP_X, ORIENTATION_FLIP_Y, and ORIENTATION_SWAP_XY.
Referenced by legacy_params(), and reload_defaults().
| void modify_roi_in | ( | struct dt_iop_module_t * | self, |
| const struct dt_dev_pixelpipe_t * | pipe, | ||
| struct dt_dev_pixelpipe_iop_t * | piece, | ||
| const dt_iop_roi_t * | roi_out, | ||
| dt_iop_roi_t * | roi_in | ||
| ) |
Definition at line 347 of file flip.c.
References adjust_aabb(), backtransform(), d, get_corner(), dt_iop_roi_t::height, o, p, piece, dt_iop_roi_t::scale, dt_iop_roi_t::width, dt_iop_roi_t::x, and dt_iop_roi_t::y.
| void modify_roi_out | ( | struct dt_iop_module_t * | self, |
| const struct dt_dev_pixelpipe_t * | pipe, | ||
| struct dt_dev_pixelpipe_iop_t * | piece, | ||
| dt_iop_roi_t * | roi_out, | ||
| const dt_iop_roi_t * | roi_in | ||
| ) |
Definition at line 338 of file flip.c.
References _flip_map_size(), d, and piece.
| int operation_tags | ( | ) |
Definition at line 115 of file flip.c.
References IOP_TAG_DISTORT.
| int process | ( | struct 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 388 of file flip.c.
References bpp, d, dt_imageio_flip_buffers(), dt_iop_roi_t::height, ovoid, piece, and dt_iop_roi_t::width.
| int process_cl | ( | struct dt_iop_module_t * | self, |
| const dt_dev_pixelpipe_t * | pipe, | ||
| const dt_dev_pixelpipe_iop_t * | piece, | ||
| cl_mem | dev_in, | ||
| cl_mem | dev_out | ||
| ) |
Definition at line 403 of file flip.c.
References dt_dev_pixelpipe_t::devid, DT_DEBUG_OPENCL, dt_opencl_enqueue_kernel_2d(), dt_opencl_set_kernel_arg(), dt_print(), error(), FALSE, dt_iop_module_t::global_data, height, dt_iop_roi_t::height, dt_iop_flip_global_data_t::kernel_flip, dt_iop_flip_params_t::orientation, piece, pipe, ROUNDUPDHT, ROUNDUPDWD, TRUE, width, and dt_iop_roi_t::width.
| void reload_defaults | ( | dt_iop_module_t * | self | ) |
Definition at line 591 of file flip.c.
References d, dt_iop_module_t::default_enabled, dt_iop_module_t::default_params, dt_iop_module_t::dev, dt_history_repository_module_exists(), dt_image_orientation(), dt_image_t::id, dt_develop_t::image_storage, dt_image_t::legacy_flip, merge_two_orientations(), ORIENTATION_NULL, and dt_image_raw_parameters_t::user_flip.
|
static |
|
static |
|
static |
Definition at line 515 of file flip.c.
Referenced by geometry_record().