oa::render
render module in the OA Ui public surface.
MdRust public API
Public Types
Public Functions
Function Documentation
Deep-copy a packed Texture into independent device storage. This is the currently admitted whole-surface FnTexture::blit equivalent. Rectangle and scaled blits remain unavailable because the C++ donor also rejects them rather than silently selecting different sampling semantics. Errors Returns an error when the device copy cannot be recorded.
Return an independent packed Texture filled with one RGBA8 clear color. The result has the source extent but does not alias source storage. This is Rust’s immutable-value spelling of the C++ donor’s in-place clear. Errors Returns an error for non-finite or out-of-range color components, exhausted texture identity, or failed device allocation/upload.
Compile visible scene instances into one deterministic indexed mesh snapshot.
Compile visible scene nodes into a merged MeshData and one SceneDrawPacket per visible node that contributes geometry. The returned mesh has world-space positions and normals; each packet records the index range within the merged buffer that belongs to that node. Draw order is deterministic (depth-first scene-node order).
Recompute and store the tight axis-aligned bounding box for mesh. Clears bounds_dirty. Empty meshes produce an all-zero Aabb. Donor: oa::FnMesh::computeBounds.
Create a 3D axis-aligned cube (12 triangles, 24 vertices, size × size × size). Each face has its own four vertices with an outward normal and per-face UVs. size must be finite and positive. Donor: oa::FnMesh::createCube. Errors Returns an error for non-finite or non-positive size.
Create a fullscreen NDC quad (2 triangles, 4 vertices) in [-1, 1] XY with top-origin image UVs. Used for post-processing passes. Donor: oa::FnMesh::createFullscreenQuad.
Create a centered quad (2 triangles, 4 vertices) with top-origin image UVs. UV V=0 is the source-image top and world +Y is the quad top. For image/video viewing, pass the pixel dimensions (e.g. 1920, 1080). width and height must be finite and positive. Donor: oa::FnMesh::createQuad. Errors Returns an error for non-finite or non-positive dimensions.
Flip all vertex UVs vertically (V ← 1 − V). Used to convert explicitly bottom-origin source content to top-origin. Never fails. Donor: oa::FnMesh::flipUvsY.
Read and save one packed RGBA8 Texture using its path extension. Supported extensions are .jpg, .jpeg, .png, .webp, .bmp, and .tga. This is an explicit blocking readback and filesystem boundary. Errors Returns an error for unsupported paths, failed device observation, codec failure, or filesystem failure.
Scale all vertex positions and normals. Zero or non-finite scale components fail without modifying the mesh. Donor: oa::FnMesh::scale. Errors Returns an error when any scale component is zero or non-finite.
Convert one packed RGBA8 HWC image into an independent Texture value. The operation retains the texture/image semantic distinction and performs a device-side deep copy. Other image layouts, channel orders, and scalar representations require an explicit image conversion before this boundary. Errors Returns an error unless image is an unbatched U8 HWC RGBA image or its device copy cannot be recorded.
Upload one exact packed row-major RGBA8 host image as a Texture. Errors Returns an error for zero or overflowing dimensions, a mismatched byte count, exhausted semantic identity, or device allocation/upload failure.
Apply an affine matrix to all vertex positions and normals. The mesh is left unchanged when matrix is non-finite, singular, or produces non-finite vertex positions. On success, bounds_dirty is set. Donor: oa::FnMesh::transform. Errors Returns an error when matrix is non-finite, singular (no normal matrix), or produces non-finite vertex positions.
Translate all vertex positions in-place. Always succeeds; bounds are marked dirty. Donor: oa::FnMesh::translate.
Validate one scene without retaining or uploading it.