Make the camera module private and just re-export partial_render_scene()
This commit is contained in:
parent
c3902d3221
commit
63afdfa36e
|
|
@ -1,6 +1,6 @@
|
||||||
use criterion::{criterion_group, criterion_main, Criterion};
|
use criterion::{criterion_group, criterion_main, Criterion};
|
||||||
|
|
||||||
use vanrijn::camera::partial_render_scene;
|
use vanrijn::partial_render_scene;
|
||||||
use vanrijn::colour::{ColourRgbF, NamedColour};
|
use vanrijn::colour::{ColourRgbF, NamedColour};
|
||||||
use vanrijn::materials::{LambertianMaterial, PhongMaterial, ReflectiveMaterial};
|
use vanrijn::materials::{LambertianMaterial, PhongMaterial, ReflectiveMaterial};
|
||||||
use vanrijn::mesh::load_obj;
|
use vanrijn::mesh::load_obj;
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ pub fn partial_render_scene<T: Real>(
|
||||||
tile: Tile,
|
tile: Tile,
|
||||||
height: usize,
|
height: usize,
|
||||||
width: usize,
|
width: usize,
|
||||||
) -> (Tile, ImageRgbF<T>) {
|
) -> ImageRgbF<T> {
|
||||||
let mut output_image_tile = ImageRgbF::new(tile.width(), tile.height());
|
let mut output_image_tile = ImageRgbF::new(tile.width(), tile.height());
|
||||||
let image_sampler = ImageSampler::new(width, height, scene.camera_location);
|
let image_sampler = ImageSampler::new(width, height, scene.camera_location);
|
||||||
let ambient_intensity: T = convert(0.0);
|
let ambient_intensity: T = convert(0.0);
|
||||||
|
|
@ -110,7 +110,7 @@ pub fn partial_render_scene<T: Real>(
|
||||||
output_image_tile.set_colour(row, column, colour);
|
output_image_tile.set_colour(row, column, colour);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
(tile, output_image_tile)
|
output_image_tile
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
#![feature(external_doc)]
|
#![feature(external_doc)]
|
||||||
#![doc(include = "../README.md")]
|
#![doc(include = "../README.md")]
|
||||||
|
|
||||||
pub mod camera;
|
mod camera;
|
||||||
pub mod colour;
|
pub mod colour;
|
||||||
pub mod image;
|
pub mod image;
|
||||||
pub mod integrators;
|
pub mod integrators;
|
||||||
|
|
@ -13,5 +13,7 @@ pub mod sampler;
|
||||||
pub mod scene;
|
pub mod scene;
|
||||||
pub mod util;
|
pub mod util;
|
||||||
|
|
||||||
|
pub use camera::partial_render_scene;
|
||||||
|
|
||||||
use realtype::Real;
|
use realtype::Real;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ use nalgebra::{Point3, Vector3};
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use std::sync::{mpsc, Arc};
|
use std::sync::{mpsc, Arc};
|
||||||
|
|
||||||
use vanrijn::camera::partial_render_scene;
|
use vanrijn::partial_render_scene;
|
||||||
use vanrijn::colour::{ColourRgbF, NamedColour};
|
use vanrijn::colour::{ColourRgbF, NamedColour};
|
||||||
use vanrijn::image::{ClampingToneMapper, ImageRgbU8, ToneMapper};
|
use vanrijn::image::{ClampingToneMapper, ImageRgbU8, ToneMapper};
|
||||||
use vanrijn::materials::{LambertianMaterial, PhongMaterial, ReflectiveMaterial};
|
use vanrijn::materials::{LambertianMaterial, PhongMaterial, ReflectiveMaterial};
|
||||||
|
|
@ -140,7 +140,7 @@ pub fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
|
|
||||||
// There's nothing we can do if this fails, and we're already
|
// There's nothing we can do if this fails, and we're already
|
||||||
// at the end of the function anyway, so just ignore result.
|
// at the end of the function anyway, so just ignore result.
|
||||||
tx.send(rendered_tile).ok()
|
tx.send((tile, rendered_tile)).ok()
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue