pub mod camera;
pub mod cloud;
pub mod densify;
pub mod pipeline;
pub mod ply;
pub mod project;
pub mod train;
pub mod project_backward;
pub mod rasterize;
pub mod sort;
pub use camera::{Camera, Intrinsics};
pub use cloud::GaussianCloud;
pub use pipeline::Rasterizer;
pub use ply::{load_ply, PlyError};
pub const TILE_SIZE: u32 = 16;
#[derive(Debug, Clone)]
pub struct RasterConfig {
pub width: u32,
pub height: u32,
pub sh_degree: u32,
pub bg_color: [f32; 3],
pub near: f32,
pub far: f32,
}
impl Default for RasterConfig {
fn default() -> Self {
Self {
width: 512,
height: 512,
sh_degree: 0,
bg_color: [0.0, 0.0, 0.0],
near: 0.01,
far: 100.0,
}
}
}
pub struct ForwardContext {
pub final_transmittance: Vec<f32>,
pub n_contrib: Vec<u32>,
pub sorted_indices: Vec<u32>,
pub tile_ranges: Vec<[u32; 2]>,
pub means_2d: Vec<[f32; 2]>,
pub conics: Vec<[f32; 3]>,
pub radii: Vec<u32>,
}
pub struct RenderOutput {
pub image: Vec<f32>,
pub ctx: ForwardContext,
}
pub struct GaussianGradients {
pub positions: Vec<[f32; 3]>,
pub scales: Vec<[f32; 3]>,
pub rotations: Vec<[f32; 4]>,
pub opacities: Vec<f32>,
pub sh_coeffs: Vec<f32>,
pub _conics: Vec<[f32; 3]>,
pub _means_2d: Vec<[f32; 2]>,
}