@@ -45,8 +45,10 @@ pub fn evcxr_figure<
45
45
SVGWrapper ( buffer, "" . to_string ( ) )
46
46
}
47
47
48
+ #[ cfg( feature = "evcxr_bitmap_figure" ) ]
48
49
pub struct BitMapWrapper ( String , String ) ;
49
50
51
+ #[ cfg( feature = "evcxr_bitmap_figure" ) ]
50
52
impl BitMapWrapper {
51
53
pub fn evcxr_display ( & self ) {
52
54
println ! ( "{:?}" , self ) ;
@@ -58,6 +60,7 @@ impl BitMapWrapper {
58
60
}
59
61
}
60
62
63
+ #[ cfg( feature = "evcxr_bitmap_figure" ) ]
61
64
impl std:: fmt:: Debug for BitMapWrapper {
62
65
fn fmt ( & self , formatter : & mut std:: fmt:: Formatter ) -> std:: fmt:: Result {
63
66
let enc = self . 0 . as_str ( ) ;
@@ -69,6 +72,7 @@ impl std::fmt::Debug for BitMapWrapper {
69
72
}
70
73
}
71
74
75
+ #[ cfg( feature = "evcxr_bitmap_figure" ) ]
72
76
fn encode_png < P , Container > ( img : & ImageBuffer < P , Container > ) -> Result < Vec < u8 > , ImageError >
73
77
where
74
78
P : Pixel < Subpixel = u8 > + ' static ,
80
84
Ok ( buf)
81
85
}
82
86
87
+ #[ cfg( feature = "evcxr_bitmap_figure" ) ]
83
88
/// Start drawing an evcxr figure
84
89
pub fn evcxr_bitmap_figure <
85
90
Draw : FnOnce ( DrawingArea < BitMapBackend , Shift > ) -> Result < ( ) , Box < dyn std:: error:: Error > > ,
@@ -98,13 +103,14 @@ pub fn evcxr_bitmap_figure<
98
103
BitMapWrapper ( buffer, "" . to_string ( ) )
99
104
}
100
105
101
- pub fn evcxr_animation <
102
- Draw : FnOnce ( DrawingArea < SVGBackend , Shift > ) -> Result < ( ) , Box < dyn std:: error:: Error > > ,
103
- > (
104
- drawing_area : & DrawingArea < SVGBackend , Shift > ,
105
- draws : Draw ,
106
- frames : usize ,
107
- interval : usize ,
108
- ) -> SVGWrapper {
109
- todo ! ( ) ;
110
- }
106
+ // #[cfg(feature = "evcxr_bitmap_figure")]
107
+ // pub fn evcxr_animation<
108
+ // Draw: FnOnce(DrawingArea<SVGBackend, Shift>) -> Result<(), Box<dyn std::error::Error>>,
109
+ // >(
110
+ // drawing_area: &DrawingArea<SVGBackend, Shift>,
111
+ // draws: Draw,
112
+ // frames: usize,
113
+ // interval: usize,
114
+ // ) -> SVGWrapper {
115
+ // todo!();
116
+ // }
0 commit comments