Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::view::FrameGeometry Struct Reference

The size/scale/viewport a frame is painted against, in one value. More...

#include <plugin_frame_renderer.hpp>

Public Member Functions

bool has_design_viewport () const
std::uint32_t pixel_width () const
 Physical-pixel dimensions: the reported physical size when there is one, else logical × scale, clamped to at least 1 so a collapsed editor cannot ask for a zero-sized surface.
std::uint32_t pixel_height () const

Public Attributes

float width = 0.0f
float height = 0.0f
float scale = 1.0f
float design_width = 0.0f
 0 disables the design viewport
float design_height = 0.0f
bool design_top_align = false
std::uint32_t background_rgb = kEditorHostClearRgb
 0xRRGGBB painted under the view tree: the whole frame before the editor's document mounts, the letterbox bars after.
std::uint32_t physical_width = 0
 The surface's exact physical size, when the platform reports one (the client rect a Windows WM_SIZE carries).
std::uint32_t physical_height = 0

Detailed Description

The size/scale/viewport a frame is painted against, in one value.

width/height are LOGICAL (the view tree's units). scale maps them to physical pixels. A non-zero design_* pair pins the root to that size and letterboxes it into width×height — the mode every plug-in editor runs in.

Member Function Documentation

◆ has_design_viewport()

bool pulp::view::FrameGeometry::has_design_viewport ( ) const
inline

◆ pixel_height()

std::uint32_t pulp::view::FrameGeometry::pixel_height ( ) const
inline

◆ pixel_width()

std::uint32_t pulp::view::FrameGeometry::pixel_width ( ) const
inline

Physical-pixel dimensions: the reported physical size when there is one, else logical × scale, clamped to at least 1 so a collapsed editor cannot ask for a zero-sized surface.

Member Data Documentation

◆ background_rgb

std::uint32_t pulp::view::FrameGeometry::background_rgb = kEditorHostClearRgb

0xRRGGBB painted under the view tree: the whole frame before the editor's document mounts, the letterbox bars after.

Hosts copy it from PluginViewHost::Options::background_rgb.

◆ design_height

float pulp::view::FrameGeometry::design_height = 0.0f

◆ design_top_align

bool pulp::view::FrameGeometry::design_top_align = false

◆ design_width

float pulp::view::FrameGeometry::design_width = 0.0f

0 disables the design viewport

◆ height

float pulp::view::FrameGeometry::height = 0.0f

◆ physical_height

std::uint32_t pulp::view::FrameGeometry::physical_height = 0

◆ physical_width

std::uint32_t pulp::view::FrameGeometry::physical_width = 0

The surface's exact physical size, when the platform reports one (the client rect a Windows WM_SIZE carries).

0 derives it from logical × scale instead, which loses a pixel at a fractional scale: at 1.5× a 1001 px client is 667 logical, and 667 × 1.5 truncates to 1000, so the frame would be stretched over the window by a pixel, blurring it.

◆ scale

float pulp::view::FrameGeometry::scale = 1.0f

◆ width

float pulp::view::FrameGeometry::width = 0.0f

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