![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
Include dependency graph for dev_geometry.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Data Structures | |
| struct | dt_dev_image_geometry_t |
| Objective facts about the image a dev is working on. More... | |
| struct | dt_dev_geometry_store_t |
| Single-writer seqlock around the record. More... | |
Typedefs | |
| typedef struct dt_dev_image_geometry_t | dt_dev_image_geometry_t |
| Objective facts about the image a dev is working on. | |
| typedef struct dt_dev_geometry_store_t | dt_dev_geometry_store_t |
| Single-writer seqlock around the record. | |
Single-writer seqlock around the record.
generation is odd while a publication is in flight and even once it has settled. A reader copies the value, re-reads the generation and retries on a mismatch, so a pipeline thread can never observe a new width paired with an old height – which is the failure this record exists to remove, the pair having been two independent unlocked stores before.
Deliberately not a mutex: one here would create a lock-ordering obligation against history_mutex and the pipe's busy_mutex, both of which are already held across reads of these values.
Objective facts about the image a dev is working on.
This is not GUI state, and the distinction is not academic. Every field here is needed with no GUI at all: export, thumbnail generation and dev_snapshot's frozen dev all resolve drawn-mask geometry against the raw dimensions, and the darkroom worker feeds them to dt_dev_pixelpipe_set_input() on every loop tick.
Leaving them at zero does not fail loudly. dt_dev_coordinates_raw_norm_to_raw_abs() early-returns on raw_width == 0 WITHOUT transforming, so a shape's normalized centre masquerades as absolute pixel coordinates and every mask on the image collapses to within a few hundred pixels of the origin. That shipped once, because these fields were mistaken for GUI state and written only if(dev->gui_attached). See CLAUDE.md, and do not gate dt_dev_geometry_set_raw_size() on anything.
| gboolean dt_dev_geometry_get | ( | const struct dt_develop_t * | dev, |
| dt_dev_image_geometry_t * | out | ||
| ) |
Out-param form, for callers that also want the "is anything published" answer.
| gboolean dt_dev_geometry_get_processed_size | ( | const struct dt_develop_t * | dev, |
| int32_t * | width, | ||
| int32_t * | height | ||
| ) |
Coherent copy of the processed pair. Returns processed_inited, same out-param contract.
| gboolean dt_dev_geometry_get_raw_size | ( | const struct dt_develop_t * | dev, |
| int32_t * | width, | ||
| int32_t * | height | ||
| ) |
Coherent copy of the raw pair. Returns raw_inited; the out-params are written either way, so a caller that ignores the result sees exactly today's values.
| void dt_dev_geometry_init | ( | struct dt_develop_t * | dev | ) |
Seed the store. Call once, from dt_dev_init(), before anything can read it.
Definition at line 42 of file dev_geometry.c.
References dt_atomic_set_uint64(), dt_dev_geometry_store_t::generation, dt_develop_t::geometry, IS_NULL_PTR, L, and dt_dev_geometry_store_t::value.
Referenced by dt_dev_init().
| int32_t dt_dev_geometry_processed_height | ( | const struct dt_develop_t * | dev | ) |
| int32_t dt_dev_geometry_processed_width | ( | const struct dt_develop_t * | dev | ) |
| int32_t dt_dev_geometry_raw_height | ( | const struct dt_develop_t * | dev | ) |
| gboolean dt_dev_geometry_raw_inited | ( | const struct dt_develop_t * | dev | ) |
| int32_t dt_dev_geometry_raw_width | ( | const struct dt_develop_t * | dev | ) |
| void dt_dev_geometry_set_processed_size | ( | struct dt_develop_t * | dev, |
| int32_t | width, | ||
| int32_t | height | ||
| ) |
Publish the processed pair. GUI thread only: its producer runs the virtual pipe.
Definition at line 62 of file dev_geometry.c.
References _publish_begin(), _publish_end(), dt_develop_t::geometry, height, IS_NULL_PTR, dt_dev_image_geometry_t::processed_height, dt_dev_image_geometry_t::processed_inited, dt_dev_image_geometry_t::processed_width, TRUE, dt_dev_geometry_store_t::value, and width.
Referenced by dt_dev_get_thumbnail_size().
| void dt_dev_geometry_set_raw_size | ( | struct dt_develop_t * | dev, |
| int32_t | width, | ||
| int32_t | height, | ||
| gboolean | valid | ||
| ) |
Publish the raw pair, and whether it is usable. MUST NOT be gated on gui_attached.
Definition at line 50 of file dev_geometry.c.
References _publish_begin(), _publish_end(), dt_develop_t::geometry, height, IS_NULL_PTR, dt_dev_image_geometry_t::raw_height, dt_dev_image_geometry_t::raw_inited, dt_dev_image_geometry_t::raw_width, dt_dev_geometry_store_t::value, and width.
Referenced by _dt_dev_mipmap_prefetch_full().
| dt_dev_image_geometry_t dt_dev_geometry_snapshot | ( | const struct dt_develop_t * | dev | ) |
Coherent copy of the whole record, by value – the ordinary way to read it:
const dt_dev_image_geometry_t geometry = dt_dev_geometry_snapshot(dev);
One seqlock read, then plain member access, so a caller that needs several fields cannot accidentally pair them across a publication. Zeroed, with both _inited bits FALSE, when nothing has been published yet.