Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
dt_dev_viewport_state_t Struct Reference

What the darkroom view asks the pipeline to show: the window onto the image. More...

#include <dev_viewport.h>

+ Collaboration diagram for dt_dev_viewport_state_t:

Data Fields

int32_t widget_width
 
int32_t widget_height
 
int32_t border_size
 
int32_t box_width
 
int32_t box_height
 
float scaling
 
float center_x
 
float center_y
 
gboolean configured
 

Detailed Description

What the darkroom view asks the pipeline to show: the window onto the image.

Meaningless without a GUI, and therefore absent without one – dt_develop_t owns a pointer that is allocated only for a gui_attached dev and NULL otherwise. That NULL IS the flag: it replaces roi.gui_inited, and for this half of the object it replaces dev->gui_attached too.

Two devs can hold one at the same time (the darkroom's and studio capture's), and studio capture swaps which one is global. Nothing here resolves dt_dev_get_global() internally; every entry point takes the dev whose viewport it means.

Definition at line 41 of file dev_viewport.h.

Field Documentation

◆ border_size

int32_t dt_dev_viewport_state_t::border_size

ISO 12646 borders, or user-defined borders, in GUI logical pixels.

Definition at line 48 of file dev_viewport.h.

Referenced by dt_dev_viewport_border_size(), and dt_dev_viewport_set_border().

◆ box_height

int32_t dt_dev_viewport_state_t::box_height

◆ box_width

int32_t dt_dev_viewport_state_t::box_width

(widget size - 2 * border_size) converted to raster pixels through the GUI ppd factor: the surface an image backbuffer actually covers. Derived here, never set from outside. (was roi.width/roi.height)

Definition at line 53 of file dev_viewport.h.

Referenced by dt_dev_roi_request_publish(), dt_dev_viewport_box_width(), and dt_dev_viewport_set_box().

◆ center_x

float dt_dev_viewport_state_t::center_x

Relative coordinates of the centre of the ROI within the whole image. Written and read as a pair – a frame planned from half the old pan and half the new is the failure this object exists to make unrepresentable. (was roi.x/roi.y)

Definition at line 61 of file dev_viewport.h.

Referenced by dt_dev_clamp_viewport_center(), dt_dev_roi_request_publish(), dt_dev_viewport_center_x(), dt_dev_viewport_reset(), and dt_dev_viewport_set_center().

◆ center_y

◆ configured

gboolean dt_dev_viewport_state_t::configured

TRUE once a widget allocation has been handed in. (was roi.gui_inited)

Definition at line 64 of file dev_viewport.h.

Referenced by dt_dev_roi_request_publish(), dt_dev_viewport_configured(), and dt_dev_viewport_set_box().

◆ scaling

float dt_dev_viewport_state_t::scaling

User zoom, applied on top of the natural (fit-to-box) scale.

Definition at line 56 of file dev_viewport.h.

Referenced by dt_dev_roi_request_publish(), dt_dev_viewport_reset(), dt_dev_viewport_scaling(), and dt_dev_viewport_set_scaling().

◆ widget_height

int32_t dt_dev_viewport_state_t::widget_height

◆ widget_width

int32_t dt_dev_viewport_state_t::widget_width

Darkroom main widget size in GUI logical coordinates, as allocated by Gtk from the window minus all panels. NOT the size of the backbuffer. (was roi.orig_width/orig_height)

Definition at line 45 of file dev_viewport.h.

Referenced by dt_dev_viewport_set_widget_size(), and dt_dev_viewport_widget_width().


The documentation for this struct was generated from the following file: