CaptureSizing class
Pure size and framing maths for CaptureRequest (BCL only, unit-tested on CI). The framework’s capture uses exactly these functions, so a plugin can show the real output size and a truthful frame guide before the shot.
public static class CaptureSizingPublic Members
Section titled “Public Members”| name | description |
|---|---|
| const MaxLongSide | Longest side a capture may have, in pixels (also lowered to the GPU’s own texture limit). |
| const MaxPixels | Total output pixels (64 MP = a 256 MB RGBA frame); above it a supersampled grab risks running out of memory. |
| static EffectiveScale(…) | The scale a window-shaped capture (no Aspect) really uses: 4× → 2× → 1× until the image fits the long-side limit (MaxLongSide, or a smaller maxTextureSize) and MaxPixels. Scale 1 is never lowered. |
| static GuideRect(…) | Where the photo sits on the screen: the largest rectangle of aspect centred in the window (full height for shapes narrower than the window, full width for wider ones). The capture frames exactly this rectangle of the on-screen view, so it is the frame guide. No shape (or an invalid one / empty window) = the whole window. |
| static OutputSize(…) | The photo’s real size in pixels. No aspect = the window × the effective scale (EffectiveScale). With a shape: the LONG side is the window’s long side × scale and the short side follows the shape, rounded to an even pixel count (2× on 1920 × 1080: 9:16 = 2160 × 3840, 21:9 = 3840 × 1646). When that exceeds the long-side limit or MaxPixels, both sides shrink by the same factor until it fits (the shape is kept). An invalid shape or a non-positive window gives an empty size. |
| static VerticalFieldOfView(…) | The camera’s vertical view angle for the capture render, so the photo frames GuideRect: a shape narrower than (or as wide as) the window keeps the on-screen vertical angle (same scene height, narrower); a wider shape keeps the on-screen HORIZONTAL angle, so its vertical angle narrows (same scene width, shorter). |
See Also
Section titled “See Also”- namespace Stellar.Abstractions.Domain