Skip to main content

Module render

Module render 

Source
Expand description

Compositing the stored layer pixels into a canvas image (R10).

The layers are drawn bottom to top (the first child of a folder is its bottom layer) with visibility, opacity, blending mode, clipping, layer masks and folders. Vector, gradient and correction layers, which CSP draws when it opens a file, are drawn from their settings; text and 3D layers without stored pixels are skipped and counted in the report.

Rendering uses the mipmap level nearest above the wanted scale, so a render at the size of CanvasPreview decodes only that level. Colours are blended as premultiplied f32 in the stored (sRGB) values. The mapping of LayerComposite values to modes is in BlendMode; its confidence is recorded in docs/spec/.

Animated files are drawn at a frame (render_frame, R17): only the cel an animation folder shows at that frame, keyframed layers moved by their transform and cameras applied to their folders. render draws the current frame as CSP’s canvas shows it, without the camera (a keyframed layer’s LayerRenderMipmap is not stored: CSP rebuilds it from TimeLineOriginalMipmap). Light-table reference layers are never drawn.

Structs§

RenderOptions
Options for render.
RenderReport
What the renderer did, by layer count.

Enums§

BlendMode
Blending modes, numbered as in LayerComposite.

Functions§

psnr
PSNR in dB of the RGB channels after compositing both images on white.
render
Render the canvas. The image has the canvas size × options.scale. An animated file is drawn at its current frame (see the module notes).
render_frame
Render the canvas as a frame’s state changes it (see Animation::frame_state). Crop to Animation::frame for what an image-sequence export shows.
render_like_preview
Render at the size of the stored CanvasPreview.