Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
dev_backbuf.c File Reference
#include "views/dev_backbuf.h"
#include "bauhaus/bauhaus.h"
#include "common/colorspaces.h"
#include "common/colorspaces_inline_conversions.h"
#include "common/darktable.h"
#include "control/control.h"
#include "develop/develop.h"
#include "develop/pixelpipe_cache.h"
#include "develop/pixelpipe_hb.h"
#include "develop/supervisor.h"
#include <pango/pangocairo.h>
+ Include dependency graph for dev_backbuf.c:

Go to the source code of this file.

Functions

static void _colormanage_ui_color (const float L, const float a, const float b, dt_aligned_pixel_t RGB)
 
void dt_dev_get_background_color (const dt_develop_t *dev, dt_aligned_pixel_t bg_color)
 
void dt_dev_draw_iso12646_border (cairo_t *cr, double width, double height, int border)
 
void dt_dev_draw_profile_mode_label (cairo_t *cri, int height)
 
void dt_dev_release_locked_surface (dt_dev_locked_surface_t *locked)
 
static void _dev_backbuf_restart_cache_wait (gpointer user_data)
 
gboolean dt_dev_lock_pipe_surface (dt_develop_t *dev, dt_dev_pixelpipe_t *pipe, dt_dev_locked_surface_t *locked, dt_dev_pixelpipe_cache_wait_t *wait, const char *wait_owner_tag, gboolean keep_previous_on_fail)
 
gboolean dt_dev_render_locked_surface (cairo_t *cr, const dt_develop_t *dev, dt_dev_locked_surface_t *locked, const int width, const int height, const int border, const dt_aligned_pixel_t bg_color)
 
gboolean dt_dev_paint_main_backbuf (dt_dev_locked_surface_t *locked, dt_dev_pixelpipe_cache_wait_t *wait, const char *wait_owner_tag, cairo_t *cr, dt_develop_t *dev, int width, int height, int border, const dt_aligned_pixel_t bg_color, gboolean keep_previous_on_fail)
 

Function Documentation

◆ _colormanage_ui_color()

static void _colormanage_ui_color ( const float  L,
const float  a,
const float  b,
dt_aligned_pixel_t  RGB 
)
static

Shared pixelpipe-backbuffer-to-screen compositing for any view owning its own dt_develop_t (darkroom, Studio Capture...). Extracted from darkroom.c, which keeps its own multi-tier main/preview/fallback cascade on top of the primitives here; a caller wanting just the main pipe's live output (no separate preview-pipe substitution tier) uses dt_dev_paint_main_backbuf().

Definition at line 36 of file dev_backbuf.c.

References darktable_t::color_profiles, darktable, dt_Lab_to_XYZ(), L, Lab, RGB, dt_colorspaces_t::transform_xyz_to_display, and XYZ.

Referenced by dt_dev_get_background_color().

◆ _dev_backbuf_restart_cache_wait()

static void _dev_backbuf_restart_cache_wait ( gpointer  user_data)
static

◆ dt_dev_draw_iso12646_border()

void dt_dev_draw_iso12646_border ( cairo_t *  cr,
double  width,
double  height,
int  border 
)

Draw the ISO 12646 white surround rectangle around a width x height image with border px margin.

Definition at line 53 of file dev_backbuf.c.

References height, and width.

Referenced by _build_preview_fallback_surface(), dt_dev_render_locked_surface(), and expose().

◆ dt_dev_draw_profile_mode_label()

void dt_dev_draw_profile_mode_label ( cairo_t *  cri,
int  height 
)

Draw the "soft proof" / "gamut check" text overlay in the bottom-left corner when darktable.color_profiles->mode is not DT_PROFILE_NORMAL; a no-op otherwise.

Definition at line 61 of file dev_backbuf.c.

References darktable_t::bauhaus, darktable_t::color_profiles, darktable, DT_PIXEL_APPLY_DPI, DT_PROFILE_GAMUTCHECK, DT_PROFILE_NORMAL, height, dt_colorspaces_t::mode, and dt_bauhaus_t::pango_font_desc.

Referenced by expose(), and expose().

◆ dt_dev_get_background_color()

void dt_dev_get_background_color ( const dt_develop_t dev,
dt_aligned_pixel_t  bg_color 
)

◆ dt_dev_lock_pipe_surface()

gboolean dt_dev_lock_pipe_surface ( struct dt_develop_t dev,
struct dt_dev_pixelpipe_t pipe,
dt_dev_locked_surface_t locked,
dt_dev_pixelpipe_cache_wait_t wait,
const char *  wait_owner_tag,
gboolean  keep_previous_on_fail 
)

◆ dt_dev_paint_main_backbuf()

gboolean dt_dev_paint_main_backbuf ( dt_dev_locked_surface_t locked,
dt_dev_pixelpipe_cache_wait_t wait,
const char *  wait_owner_tag,
cairo_t *  cr,
struct dt_develop_t dev,
int  width,
int  height,
int  border,
const dt_aligned_pixel_t  bg_color,
gboolean  keep_previous_on_fail 
)

Convenience for a caller that only wants the main (FULL) pipe's tier, with no separate preview-pipe substitution: lock + render dev->pipe in one call. This is what Studio Capture uses; darkroom's own multi-tier fallback cascade calls dt_dev_lock_pipe_surface()/dt_dev_render_locked_surface() directly instead.

Definition at line 232 of file dev_backbuf.c.

References dt_dev_lock_pipe_surface(), dt_dev_render_locked_surface(), FALSE, height, IS_NULL_PTR, dt_develop_t::pipe, dt_dev_locked_surface_t::surface, and width.

◆ dt_dev_release_locked_surface()

void dt_dev_release_locked_surface ( dt_dev_locked_surface_t locked)

Drop everything locked references. Does not touch the pipe cache entry itself (pixelpipe_hb.c owns it). Callers MUST call this, on every instance they own, before their dev's pipeline nodes/backbufs are torn down.

Definition at line 87 of file dev_backbuf.c.

References dt_dev_locked_surface_t::data, DT_PIXELPIPE_CACHE_HASH_INVALID, dt_dev_locked_surface_t::entry, dt_dev_locked_surface_t::hash, dt_dev_locked_surface_t::height, IS_NULL_PTR, dt_dev_locked_surface_t::surface, and dt_dev_locked_surface_t::width.

Referenced by _release_expose_source_caches(), _studio_dev_teardown(), and dt_dev_lock_pipe_surface().

◆ dt_dev_render_locked_surface()