@@ -36,7 +36,7 @@ impl DataExport {
3636 image_width,
3737 image_height,
3838 rgb : vec ! [ 0u8 ; image_width * image_height * 3 ] ,
39- palette : DataExport :: generate_colour_palette ( ) ,
39+ palette : DataExport :: generate_default_palette ( ) ,
4040 iterations : vec ! [ 0u32 ; image_width * image_height] ,
4141 smooth_f16 : Vec :: new ( ) ,
4242 smooth_f32 : Vec :: new ( ) ,
@@ -75,7 +75,7 @@ impl DataExport {
7575 image_width,
7676 image_height,
7777 rgb : vec ! [ 0u8 ; image_width * image_height * 3 ] ,
78- palette : DataExport :: generate_colour_palette ( ) ,
78+ palette : DataExport :: generate_default_palette ( ) ,
7979 iterations : vec ! [ 0u32 ; image_width * image_height] ,
8080 smooth_f16 : vec ! [ f16:: ZERO ; image_width * image_height] ,
8181 smooth_f32 : Vec :: new ( ) ,
@@ -196,20 +196,20 @@ impl DataExport {
196196 }
197197 }
198198
199- pub fn save ( & mut self , filename : & str , maximum_iteration : usize ) {
199+ pub fn save ( & mut self , filename : & str , maximum_iteration : usize , approximation_order : usize , zoom : & str ) {
200200 match self . data_type {
201201 DataType :: COLOUR => {
202202 self . save_colour ( filename) ;
203203 } ,
204204 DataType :: RAW => {
205- self . save_raw ( filename) ;
205+ self . save_raw ( filename, maximum_iteration , approximation_order , zoom ) ;
206206 } ,
207207 DataType :: KFB => {
208208 self . save_kfb ( filename, maximum_iteration) ;
209209 }
210210 DataType :: BOTH => {
211211 self . save_colour ( filename) ;
212- self . save_raw ( filename) ;
212+ self . save_raw ( filename, maximum_iteration , approximation_order , zoom ) ;
213213 }
214214 }
215215 }
@@ -223,20 +223,22 @@ impl DataExport {
223223 image:: ColorType :: Rgb8 ) . unwrap ( ) ;
224224 }
225225
226- fn save_raw ( & mut self , filename : & str ) {
226+ fn save_raw ( & mut self , filename : & str , maximum_iteration : usize , approximation_order : usize , zoom : & str ) {
227227 let iterations = simple_image:: Channel :: non_color_data ( simple_image:: Text :: from ( "N" ) . unwrap ( ) , simple_image:: Samples :: U32 ( self . iterations . clone ( ) ) ) ;
228228 let smooth = simple_image:: Channel :: non_color_data ( simple_image:: Text :: from ( "NF" ) . unwrap ( ) , simple_image:: Samples :: F16 ( self . smooth_f16 . clone ( ) ) ) ;
229229
230230 let mut layer = simple_image:: Layer :: new ( simple_image:: Text :: from ( "fractal_data" ) . unwrap ( ) , ( self . image_width , self . image_height ) , smallvec:: smallvec![ iterations, smooth] )
231231 . with_compression ( simple_image:: Compression :: PXR24 )
232232 . with_block_format ( None , simple_image:: attribute:: LineOrder :: Increasing ) ;
233233
234-
235- let mut test = HashMap :: new ( ) ;
236- test. insert ( simple_image:: Text :: from ( "IterationsBias" ) . unwrap ( ) , exr:: meta:: attribute:: AttributeValue :: I32 ( 0 ) ) ;
234+ let mut attributes = HashMap :: new ( ) ;
235+ attributes. insert ( simple_image:: Text :: from ( "IterationsBias" ) . unwrap ( ) , exr:: meta:: attribute:: AttributeValue :: I32 ( 0 ) ) ;
236+ attributes. insert ( simple_image:: Text :: from ( "Iterations" ) . unwrap ( ) , exr:: meta:: attribute:: AttributeValue :: I32 ( maximum_iteration as i32 ) ) ;
237+ attributes. insert ( simple_image:: Text :: from ( "Zoom" ) . unwrap ( ) , exr:: meta:: attribute:: AttributeValue :: Text ( simple_image:: Text :: from ( zoom) . unwrap ( ) ) ) ;
238+ attributes. insert ( simple_image:: Text :: from ( "approximation_order" ) . unwrap ( ) , exr:: meta:: attribute:: AttributeValue :: I32 ( approximation_order as i32 ) ) ;
237239
238240 layer. attributes = exr:: meta:: header:: LayerAttributes :: new ( simple_image:: Text :: from ( "fractal_data" ) . unwrap ( ) ) ;
239- layer. attributes . custom = test ;
241+ layer. attributes . custom = attributes ;
240242
241243 let image = simple_image:: Image :: new_from_single_layer ( layer) ;
242244
@@ -251,7 +253,7 @@ impl DataExport {
251253 let test1 = [ self . image_width as u32 , self . image_height as u32 ] ;
252254
253255 // Colours in colourmap
254- let test5 = DataExport :: generate_colour_palette ( ) ;
256+ let test5 = DataExport :: generate_default_palette ( ) ;
255257
256258 // iteration division??
257259 let test3 = [ 1u32 , test5. len ( ) as u32 ] ;
@@ -285,7 +287,7 @@ impl DataExport {
285287
286288 }
287289
288- fn generate_colour_palette ( ) -> Vec < ( u8 , u8 , u8 ) > {
290+ fn generate_default_palette ( ) -> Vec < ( u8 , u8 , u8 ) > {
289291 let mut colours = Vec :: with_capacity ( 1024 ) ;
290292
291293 for i in 0 ..1024 {
0 commit comments