Skip to content

Commit 3411204

Browse files
committed
fixed the export to kfb
1 parent 21ed5b0 commit 3411204

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

default.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
image_width = 1920
22
image_height = 1080
3-
frames = 1
4-
export = "raw"
5-
rotate = 0
3+
frames = 50
4+
export = "kfb"
5+
rotate = 0
6+
glitch_tolerance = 0.000001

src/util/data_export.rs

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ impl DataExport {
9696
};
9797
}
9898
},
99-
DataType::RAW | DataType::KFB => {
99+
DataType::RAW => {
100100
let escape_radius_ln = 1e16f32.ln();
101101

102102
for pixel in pixel_data {
@@ -114,6 +114,24 @@ impl DataExport {
114114
self.smooth[k] = 1.0 - (z_norm.ln() / escape_radius_ln).log2();
115115
}
116116
},
117+
DataType::KFB => {
118+
let escape_radius_ln = 1e16f32.ln();
119+
120+
for pixel in pixel_data {
121+
let k = pixel.image_x * self.image_height + pixel.image_y;
122+
123+
self.iterations[k] = if pixel.glitched {
124+
0x00000000
125+
} else if pixel.iteration >= maximum_iteration {
126+
0xFFFFFFFF
127+
} else {
128+
pixel.iteration as u32
129+
};
130+
131+
let z_norm = (reference.reference_data[pixel.iteration - reference.start_iteration].z_fixed + pixel.delta_current.mantissa).norm_sqr() as f32;
132+
self.smooth[k] = 1.0 - (z_norm.ln() / escape_radius_ln).log2();
133+
}
134+
},
117135
DataType::BOTH => {
118136
let escape_radius_ln = 1e16f32.ln();
119137

@@ -197,7 +215,7 @@ impl DataExport {
197215
let test2 = [self.image_height as u32];
198216

199217
// iteration division??
200-
let test3 = [0.1f32];
218+
let test3 = [1u32];
201219

202220
// Colours in colourmap
203221
let test5 = DataExport::generate_colour_palette();

0 commit comments

Comments
 (0)