Skip to main content

render_offscreen_into

Function render_offscreen_into 

Source
pub fn render_offscreen_into<H: Hal>(
    ctx: &mut H::Context,
    recording: &Recording,
    images: &[&H::Texture],
    format: PixelFormat,
) -> Result<Vec<u8>>
where H::Context: HalContext<Hal = H>,
Expand description

The same, into a target of the caller’s choosing.

Separate rather than a parameter on the call above, because every caller in this workspace wants eight bits and threading the answer through all of them to serve the one that does not is the wrong way round. What this exists for is a target that can hold a color the sRGB primaries cannot describe, which needs a floating-point format and nothing else here does.

The bytes come back in whatever the format packs them as – half-floats for Rgba16Float – rather than converted to anything.