Skip to content

Commit 35b68bb

Browse files
Fix color inconsistency between basic example and main program
1 parent bd1c303 commit 35b68bb

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/core/renderer.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -148,21 +148,15 @@ pub fn render_from_config(config: &Config) -> Result<RgbImage> {
148148
return Err(Error::ConfigError(format!("Unsupported dimension: {}", config.ndims)));
149149
}
150150

151-
// Create RNG for IFS generation
152-
let mut rng_for_ifs = match config.rng_name.as_str() {
151+
// Create RNG
152+
let mut rng = match config.rng_name.as_str() {
153153
"Xoshiro256PlusPlus" => Xoshiro256PlusPlus::seed_from_u64(config.seed),
154154
_ => return Err(Error::ConfigError(format!("Unknown RNG: {}", config.rng_name))),
155155
};
156156

157157
// Create IFS
158-
let ifs = crate::core::ifs::rand_sigma_factor_ifs(&mut rng_for_ifs);
159-
160-
// Create a new RNG for rendering with the same seed
161-
let rng_for_render = match config.rng_name.as_str() {
162-
"Xoshiro256PlusPlus" => Xoshiro256PlusPlus::seed_from_u64(config.seed),
163-
_ => return Err(Error::ConfigError(format!("Unknown RNG: {}", config.rng_name))),
164-
};
158+
let ifs = crate::core::ifs::rand_sigma_factor_ifs(&mut rng);
165159

166160
// Render image
167-
Ok(render(rng_for_render, &ifs, config))
161+
Ok(render(rng, &ifs, config))
168162
}

0 commit comments

Comments
 (0)