55 return C_(
"modulename",
"Final resampling");
86 if(roi_in->
scale > 1.f)
88 roi_in->
x = (int)roundf((
float)roi_in->
x / roi_out->
scale);
89 roi_in->
y = (int)roundf((
float)roi_in->
y / roi_out->
scale);
95 else if(scaling_pref == 0)
100 roi_in->
scale = 1.0f;
101 const float resample_scale = roi_out->
scale / roi_in->
scale;
102 roi_in->
x = (int)roundf(roi_in->
x / resample_scale);
103 roi_in->
y = (int)roundf(roi_in->
y / resample_scale);
110 const float *
const in,
float *
const out,
const dt_iop_roi_t *
const roi_in,
118 const void *
const ivoid,
void *
const ovoid)
143 const int devid = pipe->
devid;
147 if(err != CL_SUCCESS)
goto error;
184 piece->
enabled = (darkroom_zoom > 1.f)
185 || (
dt_conf_get_int(
"darkroom/render_size") != 1 && darkroom_zoom != 1.f);
224 gtk_label_set_markup(GTK_LABEL(self->
gui->
widget),_(
"This module is used to downscale images at export time. "
225 "Moving it along the pipeline will have diffent effects on exported images. "
226 "<a href='https://ansel.photos/en/doc/modules/processing-modules/finalscale/'>Learn more</a>"));
227 gtk_widget_set_halign(self->
gui->
widget, GTK_ALIGN_START);
228 gtk_label_set_xalign (GTK_LABEL(self->
gui->
widget), 0.0f);
static void error(char *msg)
const dt_colormatrix_t dt_aligned_pixel_t out
int dt_conf_get_int(const char *name)
Integer for name, clamped to the bounds declared in the XML.
dt_dev_roi_request_t dt_dev_roi_request_of_pipe(const dt_dev_pixelpipe_t *pipe)
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)
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)
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)
dt_iop_finalscale_params_t dt_iop_finalscale_data_t
void gui_init(dt_iop_module_t *self)
void cleanup_pipe(dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
int default_colorspace(dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, const dt_dev_pixelpipe_iop_t *piece)
void init(dt_iop_module_t *self)
void commit_params(dt_iop_module_t *self, dt_iop_params_t *params, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
void init_pipe(dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
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)
void cleanup(dt_iop_module_t *self)
@ IOP_FLAGS_TILING_FULL_ROI
@ IOP_FLAGS_NO_HISTORY_STACK
#define IOP_GUI_ALLOC(module)
void dt_iop_clip_and_zoom_roi(float *out, const float *const in, const dt_iop_roi_t *const roi_out, const dt_iop_roi_t *const roi_in, const int32_t out_stride, const int32_t in_stride)
int dt_iop_clip_and_zoom_roi_cl(int devid, cl_mem dev_out, cl_mem dev_in, const dt_iop_roi_t *const roi_out, const dt_iop_roi_t *const roi_in)
const struct dt_interpolation * dt_interpolation_new(enum dt_interpolation_type type)
void dt_interpolation_resample_roi_1c(const struct dt_interpolation *itor, float *out, const dt_iop_roi_t *const roi_out, const float *const in, const dt_iop_roi_t *const roi_in)
@ DT_INTERPOLATION_USERPREF_WARP
void dt_print(dt_debug_thread_t thread, const char *msg,...) __attribute__((format(printf
Print to stdout when thread is enabled, prefixed with seconds since startup.
#define dt_free_align(ptr)
Release memory from dt_alloc_align() and set ptr to NULL.
static void * dt_calloc_align(size_t size)
dt_alloc_align() followed by a zero fill.
#define dt_free(ptr)
g_free() ptr and set it to NULL, skipping both if it is already NULL.
#define DT_MODULE_INTROSPECTION(MODVER, PARAMSTYPE)
DT_MODULE() for a module whose params struct is introspected.
@ DT_DEV_PIXELPIPE_THUMBNAIL
@ DT_DEV_PIXELPIPE_EXPORT
struct dt_iop_module_t *void * data
dt_dev_pixelpipe_type_t type
The coherent set of numbers a darkroom pipe plans its ROI from.
int32_t hide_enable_button
dt_iop_params_t * default_params
struct dt_iop_module_gui_t * gui
Region of interest passed through the pixelpipe.