pub struct RenderOutput {
pub rgba: Vec<u8>,
pub depth: Vec<f64>,
pub width: u32,
pub height: u32,
pub intrinsics: CameraIntrinsics,
pub camera_transform: Transform,
pub object_rotation: ObjectRotation,
pub target_point: Vec3,
pub targeting_policy: TargetingPolicy,
}Expand description
Output from headless rendering containing RGBA and depth data.
Fields§
§rgba: Vec<u8>RGBA pixel data in row-major order (width * height * 4 bytes)
depth: Vec<f64>Depth values in meters, row-major order (width * height f64s) Values are linear depth from camera, not normalized. Uses f64 for TBP numerical precision compatibility.
width: u32Image width in pixels
height: u32Image height in pixels
intrinsics: CameraIntrinsicsCamera intrinsics used for this render
camera_transform: TransformCamera transform (world position and orientation)
object_rotation: ObjectRotationObject rotation applied during render
target_point: Vec3Point the camera was intended to target for this render.
targeting_policy: TargetingPolicyPolicy used to derive target_point.
Implementations§
Source§impl RenderOutput
impl RenderOutput
Sourcepub const TBP_FAR_PLANE_METERS: f64 = 10.0
pub const TBP_FAR_PLANE_METERS: f64 = 10.0
Default far plane used by TBP render helpers.
Sourcepub fn with_targeting(
self,
target_point: Vec3,
targeting_policy: TargetingPolicy,
) -> Self
pub fn with_targeting( self, target_point: Vec3, targeting_policy: TargetingPolicy, ) -> Self
Attach the render target metadata used to generate this camera transform.
Sourcepub fn get_rgba(&self, x: u32, y: u32) -> Option<[u8; 4]>
pub fn get_rgba(&self, x: u32, y: u32) -> Option<[u8; 4]>
Get RGBA pixel at (x, y). Returns None if out of bounds.
Sourcepub fn get_depth(&self, x: u32, y: u32) -> Option<f64>
pub fn get_depth(&self, x: u32, y: u32) -> Option<f64>
Get depth value at (x, y) in meters. Returns None if out of bounds.
Sourcepub fn get_rgb(&self, x: u32, y: u32) -> Option<[u8; 3]>
pub fn get_rgb(&self, x: u32, y: u32) -> Option<[u8; 3]>
Get RGB pixel (without alpha) at (x, y).
Sourcepub fn center_pixel(&self) -> Option<[u32; 2]>
pub fn center_pixel(&self) -> Option<[u32; 2]>
Pixel nearest the camera principal point, clamped to image bounds.
Sourcepub fn center_pixel_raw_depth(&self) -> Option<f64>
pub fn center_pixel_raw_depth(&self) -> Option<f64>
Raw center-pixel depth, including far-plane/background values.
Sourcepub fn center_pixel_depth(&self) -> Option<f64>
pub fn center_pixel_depth(&self) -> Option<f64>
Center-pixel object depth using the TBP default far plane.
Sourcepub fn center_pixel_depth_with_far_plane(&self, far_plane: f64) -> Option<f64>
pub fn center_pixel_depth_with_far_plane(&self, far_plane: f64) -> Option<f64>
Center-pixel object depth using a caller-provided far plane.
Sourcepub fn is_foreground_depth(depth: f64, far_plane: f64) -> bool
pub fn is_foreground_depth(depth: f64, far_plane: f64) -> bool
Whether a depth value should be treated as foreground/object surface.
Sourcepub fn health(&self) -> RenderHealth
pub fn health(&self) -> RenderHealth
Compute render-health diagnostics using the TBP default far plane.
Sourcepub fn health_with_far_plane(&self, far_plane: f64) -> RenderHealth
pub fn health_with_far_plane(&self, far_plane: f64) -> RenderHealth
Compute render-health diagnostics using a caller-provided far plane.
Sourcepub fn camera_to_world_point(&self, camera_point: [f64; 3]) -> [f64; 3]
pub fn camera_to_world_point(&self, camera_point: [f64; 3]) -> [f64; 3]
Transform a point from Bevy camera-local coordinates into world space.
Sourcepub fn world_to_camera_point(&self, world_point: [f64; 3]) -> [f64; 3]
pub fn world_to_camera_point(&self, world_point: [f64; 3]) -> [f64; 3]
Transform a point from world space into Bevy camera-local coordinates.
Sourcepub fn center_surface_point_world(&self) -> Option<[f64; 3]>
pub fn center_surface_point_world(&self) -> Option<[f64; 3]>
Surface point at the center pixel using the TBP default far plane.
Sourcepub fn center_surface_point_world_with_far_plane(
&self,
far_plane: f64,
) -> Option<[f64; 3]>
pub fn center_surface_point_world_with_far_plane( &self, far_plane: f64, ) -> Option<[f64; 3]>
Surface point at the center pixel using a caller-provided far plane.
Sourcepub fn pixel_surface_point_world(&self, pixel: [u32; 2]) -> Option<[f64; 3]>
pub fn pixel_surface_point_world(&self, pixel: [u32; 2]) -> Option<[f64; 3]>
Surface point at pixel using the TBP default far plane.
Sourcepub fn pixel_surface_point_world_with_far_plane(
&self,
pixel: [u32; 2],
far_plane: f64,
) -> Option<[f64; 3]>
pub fn pixel_surface_point_world_with_far_plane( &self, pixel: [u32; 2], far_plane: f64, ) -> Option<[f64; 3]>
Surface point at pixel using a caller-provided far plane.
Pixel coordinates follow image convention (x right, y down). The
returned point is in world space. Internally this maps to Bevy’s camera
frame (+X right, +Y up, -Z forward).
Sourcepub fn to_rgb_image(&self) -> Vec<Vec<[u8; 3]>>
pub fn to_rgb_image(&self) -> Vec<Vec<[u8; 3]>>
Convert to neocortx-compatible image format: Vec<Vec<[u8; 3]>>
Sourcepub fn to_depth_image(&self) -> Vec<Vec<f64>>
pub fn to_depth_image(&self) -> Vec<Vec<f64>>
Convert depth to neocortx-compatible format: Vec<Vec
Trait Implementations§
Source§impl Clone for RenderOutput
impl Clone for RenderOutput
Source§fn clone(&self) -> RenderOutput
fn clone(&self) -> RenderOutput
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for RenderOutput
impl RefUnwindSafe for RenderOutput
impl Send for RenderOutput
impl Sync for RenderOutput
impl Unpin for RenderOutput
impl UnsafeUnpin for RenderOutput
impl UnwindSafe for RenderOutput
Blanket Implementations§
Source§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
Source§fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
T ShaderType for self. When used in AsBindGroup
derives, it is safe to assume that all images in self exist.Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ConditionalSend for Twhere
T: Send,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more