metropolis 0.9.1

A high level easy to use graphics renderer
b0VIM 8.1?.^��guylguyl-HP-EliteBook-840-G1~guyl/Desktop/rust_things/metropolis/src/canvas.rsutf-8
3210#"! Utp
1&Yp{�9�E�/;DU�<�)�`f	ipyt�jO[�Z	fn35,+
����������ad_�`��oX*����hQ"�
�
�
�
�
h
Q
 
����~dA'���\4�
�
�
i
R
#
�	�	�	�	�	i	R	!	����eB(�����W��_@���U"���pC���}O����lG&���    pub fn rect(&mut self,x: u16, y: u16, width: u16, height: u16) {///built.///rec             if self.key.keep_key == false{            self= draw_fn(self);            //draw_fn(self.clone());            self.stroke_vec = vec![];            self.tex_vec = vec![];            self.fill_vec = vec![];            self.text_vec = vec![];            }            self.fps =counter1 as f32/(end-start).as_secs() as f32;            if end- start>Duration::new(1,0){            end = Instant::now();                }                    }                            Box::new(sync::now(env.device.clone())) as Box<_>;                        previous_frame_end =                        println!("{:?}", e);                    Err(e) => {                    }                            Box::new(sync::now(env.device.clone())) as Box<_>;                        previous_frame_end =                        recreate_swapchain = true;                    Err(FlushError::OutOfDate) => {                    }                        previous_frame_end = Box::new(future) as Box<_>;                        future.wait(None).unwrap();                    Ok(future) => {                match future {                    .then_signal_fence_and_flush();                    .then_swapchain_present(env.queue.clone(), env.swapchain.clone(), image_num)                    .unwrap()                    .then_execute(env.queue.clone(), command_buffer)                    .join(acquire_future)                let future = previous_frame_end                    }                        };                }                .unwrap();                .build()                .unwrap()                .end_render_pass()                .unwrap()                )                    (),                    (),                    vec![stroke_vertex_buffer.clone()],                    &env.dynamic_state,                    env.stroke_pipeline.clone(),                .draw(                .unwrap()                )                    (),                    (),                    vec![fill_vertex_buffer.clone()],                    &env.dynamic_state,                    env.fill_pipeline.clone(),                .draw(                .unwrap()                .begin_render_pass(env.framebuffers[image_num].clone(), false, clear_values)                .unwrap()                )                    env.queue.family(),                    env.device.clone(),                    command_buffer = AutoCommandBufferBuilder::primary_one_time_submit(                        None=>{                            },                .unwrap();                .build()                .unwrap()                .end_render_pass()                .unwrap()                )                    (),                    (),                    vec![stroke_vertex_buffer.clone()],                    &env.dynamic_state,                    env.stroke_pipeline.clone(),                .draw(                .unwrap()                )                    (),                    (),                    vec![fill_vertex_buffer.clone()],                    &env.dynamic_state,                    env.fill_pipeline.clone(),                .draw(                .unwrap()                )                    (),                    set.clone(),                    vec![tex_vertex_buffer.clone()],                    &env.dynamic_state,                    env.tex_pipeline.clone(),                .draw(                .unwrap()                .begin_render_pass(env.framebuffers[image_num].clone(), false, clear_values)                .unwrap()ad<��f6�zh6�
�
�
J
$


��sB��>$�
�
|
T
,


�	�	r	D		�����k<�����k:����~[A��vG�����vE�����fL����sJ����                )                    env.queue.family(),                    env.device.clone(),                        command_buffer = AutoCommandBufferBuilder::primary_one_time_submit(                            Some(set)=>{                        match set.clone(){                    }else{                        };                },                .unwrap();                .build()                .draw_text(&mut text, image_num)                .unwrap()                .end_render_pass()                .unwrap()                )                    (),                    (),                    vec![stroke_vertex_buffer.clone()],                    &env.dynamic_state,                    env.stroke_pipeline.clone(),                .draw(                .unwrap()                )                    (),                    (),                    vec![fill_vertex_buffer.clone()],                    &env.dynamic_state,                    env.fill_pipeline.clone(),                .draw(                .unwrap()                .begin_render_pass(env.framebuffers[image_num].clone(), false, clear_values)                            .draw_text(&mut text, image_num)                .unwrap()                .end_render_pass()                .unwrap()                )                    (),                    (),                    vec![stroke_vertex_buffer.clone()],                    &env.dynamic_state,                    env.stroke_pipeline.clone(),                .draw(                .unwrap()                )                    (),                    (),                    vec![fill_vertex_buffer.clone()],                    &env.dynamic_state,                    env.fill_pipeline.clone(),                .draw(                .unwrap()                )                    (),                    set.clone(),                    vec![tex_vertex_buffer.clone()],                    &env.dynamic_state,                    env.tex_pipeline.clone(),                .draw(                .unwrap()                .begin_render_pass(env.framebuffers[image_num].clone(), false, clear_values)                .unwrap()                )                    env.queue.family(),                    env.device.clone(),                command_buffer = AutoCommandBufferBuilder::primary_one_time_submit(                            Some(set)=>{                        match set.clone(){                        }                            text.queue_text(txt.position[0],txt.position[0], self.text_size, txt.color,txt.text);                        for txt in self.text_vec{                if self.text_vec.len()>0{                let command_buffer:AutoCommandBuffer;                //println!("{:?}",clear_values);                let clear_values = vec![self.background_color.into()];                    };                        Err(err) => panic!("{:?}", err),                        }                            continue;                            recreate_swapchain = true;                        Err(AcquireError::OutOfDate) => {                        Ok(r) => r,                    match swapchain::acquire_next_image(env.swapchain.clone(), None) {                let (image_num, acquire_future) =                }                    recreate_swapchain = false;                    text = DrawText::new(env.device.clone(), env.queue.clone(), env.swapchain.clone(), &new_images);                    );                        &mut env.dynamic_state,                        env.render_pass.clone(),                        &new_images,                    env.framebuffers = window_size_dependent_setup(ad�
	��]��e%5@�
�
�
�
�
c
L
$

����~V7 �����bRH/�
�
�
�
s
I
*

�	�	�	�	{	S	C		�����bK#����{Q2�����[KA?���{U����[<%�����gW/����zc;+�                position: b_l,            self.fill_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: t_l,            self.fill_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: t_l,            self.fill_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: t_r,            self.fill_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: b_r,            self.fill_vec.push(Vertex {            let color = self.fill_color;        if self.fill {        let b_l = map([x, y + width], scale);        let t_r = map([x + width, y], scale);        let b_r = map([x + width, y + width], scale);        let t_l = map([x, y], scale);        let scale = [self.size.0, self.size.1];    pub fn square(&mut self,x: u16, y: u16, width: u16) {///recieves the x and y of the top spot and then the width of the sqaure you want built.}        }            });                tex_coords:[0f32,0f32],                color,                position: t_l,            self.stroke_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: b_l,            self.stroke_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: b_l,            self.stroke_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: b_r,            self.stroke_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: b_r,            self.stroke_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: t_r,            self.stroke_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: t_r,            self.stroke_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: t_l,            self.stroke_vec.push(Vertex {            let color = self.color;        if self.stroke {        }            });                tex_coords:[0f32,0f32],                color,                position: b_r,            self.fill_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: b_l,            self.fill_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: t_l,            self.fill_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: t_l,            self.fill_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                          }              }            t_l = map([x, y-self.stroke_weight as u16], scale);        }else if y>=self.stroke_weight as u16{            t_l = map([x-self.stroke_weight as u16, y], scale);        }else if x>=self.stroke_weight as u16{            t_l = map([x-self.stroke_weight as u16, y-self.stroke_weight as u16], scale);        if x>=self.stroke_weight as u16 && y>=self.stroke_weight as u16{        let mut t_l = map([x, y], scale);        let scale = [self.size.0, self.size.1];ad�t����jS+����tL<�
�
�
�
z
[
D


����tJ+����|TD�
�
�
�
�
�
<
&
�	�	�	�	i	I	#		�����mE97���[3���{\E
����wO0�����pQ:���zj@!
����rJ:�                position: pt3,            self.stroke_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: pt3,            self.stroke_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: pt2,            self.stroke_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: pt2,            self.stroke_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: pt1,            self.stroke_vec.push(Vertex {            let color = self.color;        if self.stroke {        }            });                tex_coords:[0f32,0f32],                color,                position: pt3,            self.fill_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: pt2,            self.fill_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: pt1,            self.fill_vec.push(Vertex {            let color = self.fill_color;        if self.fill {        let pt3 = map([x3, y3], scale);        let pt2 = map([x2, y2], scale);        let pt1 = map([x1, y1], scale);        let scale = [self.size.0, self.size.1];    pub fn triangle(&mut self,x1: u16, y1: u16, x2: u16, y2: u16, x3: u16, y3: u16) {///recieves the x and y of the 3 points of the triangle and creates it based on them}        });                tex_coords:[0f32,0f32],            color,            position: fin,        self.stroke_vec.push(Vertex {        });                tex_coords:[0f32,0f32],            color,            position: srt,        self.stroke_vec.push(Vertex {        let color = self.color;        let fin = map([x2, y2], scale);        let srt = map([x, y], scale);        let scale = [self.size.0, self.size.1];    pub fn line(&mut self,x: u16, y: u16, x2: u16, y2: u16) {///line between them.///recieves the x and y of the top point and then the x and the y of the bottom point and creates a}        }            });                tex_coords:[0f32,0f32],                color,                position: t_l,            self.stroke_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: b_l,            self.stroke_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: b_l,            self.stroke_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: b_r,            self.stroke_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: t_r,            self.stroke_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: t_r,            self.stroke_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: t_l,            self.stroke_vec.push(Vertex {            let color = self.color;        if self.stroke {        }            });                tex_coords:[0f32,0f32],                color,                position: b_r,            self.fill_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,ad�j����hQ)
�\W'�
�
�
�
p
G


����jS+�����]>'�
�
�
�
�
~
_
H
 

�	�	�	�	x	N	/		�����XH�����gP(�����V7 ����{]"��sN"�zL���~C��                });                tex_coords:[0f32,0f32],                    color: self.color,                    position: map_circ([ptx, pty], scale),                self.stroke_vec.push(Vertex {                });                tex_coords:[0f32,0f32],                    color: self.color,                    position: map_circ([pt_x, pt_y], scale),                self.stroke_vec.push(Vertex {                let pty = y as f32 + ((an as f32 / 360.0) * 6.28).sin() * b as f32;                let ptx = x as f32 + ((an as f32 / 360.0) * 6.28).cos() * a as f32;            for an in (0..360).step_by(6) {            let mut pt_y = y as f32;            let mut pt_x = x as f32 + a as f32;        if self.stroke && !(self.fill && self.color == self.fill_color) {        let scale = [self.size.0, self.size.1];    pub fn ellipse(&mut self,x: u16, y: u16, a: u16, b: u16) {///and creates it accordingly///recieves the x and the y of the center of the ellipse and the width and height of the ellipse}        }            });                tex_coords:[0f32,0f32],                color,                position: pt1,            self.stroke_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: pt4,            self.stroke_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: pt4,            self.stroke_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: pt3,            self.stroke_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: pt3,            self.stroke_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: pt2,            self.stroke_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: pt2,            self.stroke_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: pt1,            self.stroke_vec.push(Vertex {            let color = self.color;        if self.stroke {        }            });                tex_coords:[0f32,0f32],                color,                position: pt4,            self.fill_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: pt3,            self.fill_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: pt2,            self.fill_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: pt1,            self.fill_vec.push(Vertex {            let color = self.fill_color;        if self.fill {        let pt4 = map([x4, y4], scale);        let pt3 = map([x3, y3], scale);        let pt2 = map([x2, y2], scale);        let pt1 = map([x1, y1], scale);        let scale = [self.size.0, self.size.1];    pub fn quad(&mut self,x1: u16, y1: u16, x2: u16, y2: u16, x3: u16, y3: u16, x4: u16, y4: u16) {///recieves the x and y of the 4 points of the quad and creates it based on them}        }            });                tex_coords:[0f32,0f32],                color,                position: pt1,            self.stroke_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,ad�[����W4����H%�
�
�
�
�
w
K
��w:���k?�
�
f
>
*

�	�	�	�	[	3	#	���qI!���XH><���w-���V��oC/��s_C'���k[+��                position: map_circ([pt_x, pt_y], scale),            self.stroke_vec.push(Vertex {            pt_y = y as f32 + 0.5;            pt_x = x as f32 + rad as f32 + 0.5;            });                tex_coords:[0f32,0f32],                color: self.color,                position: map_circ([pt_x, pt_y], scale),            self.stroke_vec.push(Vertex {            }                pt_y = pty;                pt_x = ptx;                });                    tex_coords:[0f32,0f32],                    color: self.color,                    position: map_circ([ptx, pty], scale),                self.stroke_vec.push(Vertex {                });                    tex_coords:[0f32,0f32],                    color: self.color,                    position: map_circ([pt_x, pt_y], scale),                self.stroke_vec.push(Vertex {                let pty = y as f32 + ((a as f32 / 360.0) * 6.28).sin() * rad as f32;                let ptx = x as f32 + ((a as f32 / 360.0) * 6.28).cos() * rad as f32;            for a in (0..360).step_by(6) {            let mut pt_y = y as f32;            let mut pt_x = x as f32 + rad as f32;        if self.stroke && !(self.fill && self.color == self.fill_color) {        let scale = [self.size.0, self.size.1];    pub fn circle(&mut self,x: u16, y: u16, rad: u16) {///recieves the x and y of the center of the circle and the radius and builds it with them.}        }            });                tex_coords:[0f32,0f32],                color: self.fill_color,                position: map_circ([x as f32, y as f32], scale),            self.fill_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color: self.fill_color,                position: map_circ([pt_x, pt_y], scale),            self.fill_vec.push(Vertex {            pt_y = y as f32 + 0.5;            pt_x = x as f32 + a as f32 + 0.5;            });                tex_coords:[0f32,0f32],                color: self.fill_color,                position: map_circ([pt_x, pt_y], scale),            self.fill_vec.push(Vertex {            }                pt_y = pty;                pt_x = ptx;                });                tex_coords:[0f32,0f32],                    color: self.fill_color,                    position: map_circ([x as f32, y as f32], scale),                self.fill_vec.push(Vertex {                });                tex_coords:[0f32,0f32],                    color: self.fill_color,                    position: map_circ([ptx, pty], scale),                self.fill_vec.push(Vertex {                });                tex_coords:[0f32,0f32],                    color: self.fill_color,                    position: map_circ([pt_x, pt_y], scale),                self.fill_vec.push(Vertex {                let pty = y as f32 + ((an as f32 / 360.0) * 6.28).sin() * b as f32;                let ptx = x as f32 + ((an as f32 / 360.0) * 6.28).cos() * a as f32;            for an in (0..360).step_by(6) {            let mut pt_y = y as f32;            let mut pt_x = x as f32 + a as f32;        if self.fill {        }            });                tex_coords:[0f32,0f32],                color: self.color,                position: map_circ([pt_x, pt_y], scale),            self.stroke_vec.push(Vertex {            pt_y = y as f32 + 0.5;            pt_x = x as f32 + a as f32 + 0.5;            });                tex_coords:[0f32,0f32],                color: self.color,                position: map_circ([pt_x, pt_y], scale),            self.stroke_vec.push(Vertex {            }                pt_y = pty;                pt_x = ptx;ad�Z�����R-�X,�
�
�
�
W

����?�����e,�
�
�
y
Q

�	�	�	�	O	'	�����ZU5����vt���j ���E���^2���bN2����a��                self.fill_vec.push(Vertex {                let pty = y as f32 + ((a as f32 / 360.0) * 6.28).sin() * rad as f32;                let ptx = x as f32 + ((a as f32 / 360.0) * 6.28).cos() * rad as f32;            for a in (0..deg + 6).step_by(6) {            let mut pt_y = y as f32;            let mut pt_x = x as f32 + rad as f32;        if self.fill {        }            }                pt_y = pty;                pt_x = ptx;                });                    tex_coords:[0f32,0f32],                    color: self.color,                    position: map_circ([ptx, pty], scale),                self.stroke_vec.push(Vertex {                });                    tex_coords:[0f32,0f32],                    color: self.color,                    position: map_circ([pt_x, pt_y], scale),                self.stroke_vec.push(Vertex {                let pty = y as f32 + ((a as f32 / 360.0) * 6.28).sin() * rad as f32;                let ptx = x as f32 + ((a as f32 / 360.0) * 6.28).cos() * rad as f32;            for a in (0..deg + 6).step_by(6) {            let mut pt_y = y as f32;            let mut pt_x = x as f32 + rad as f32;        if self.stroke && !(self.fill && self.color == self.fill_color) {        let scale = [self.size.0, self.size.1];    pub fn arc(&mut self,x: u16, y: u16, rad: u16, deg: u16) {///covered by the arc (360 degree arc is a full circle).///create an arc from a circle, recieves the center of the circle and the radius and the degrees}        self.fill = fil;        self.stroke = stro;        self.circle(x, y, self.stroke_weight as u16);        self.fill = true;        self.stroke = false;        let fil = self.fill;        let stro = self.stroke;    pub fn point(&mut self,x: u16, y: u16) {///recieves the x and the y and makes a small circle in the spot(size depends on strokeWeight).}        }            });                tex_coords:[0f32,0f32],                color: self.fill_color,                position: map_circ([x as f32, y as f32], scale),            self.fill_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color: self.fill_color,                position: map_circ([pt_x, pt_y], scale),            self.fill_vec.push(Vertex {            pt_y = y as f32 + 0.5;            pt_x = x as f32 + rad as f32 + 0.5;            });                tex_coords:[0f32,0f32],                color: self.fill_color,                position: map_circ([pt_x, pt_y], scale),            self.fill_vec.push(Vertex {            }                pt_y = pty;                pt_x = ptx;                });                    tex_coords:[0f32,0f32],                    color: self.fill_color,                    position: map_circ([x as f32, y as f32], scale),                self.fill_vec.push(Vertex {                });                    tex_coords:[0f32,0f32],                    color: self.fill_color,                    position: map_circ([ptx, pty], scale),                self.fill_vec.push(Vertex {                });                    tex_coords:[0f32,0f32],                    color: self.fill_color,                    position: map_circ([pt_x, pt_y], scale),                self.fill_vec.push(Vertex {                let pty = y as f32 + ((a as f32 / 360.0) * 6.28).sin() * rad as f32;                let ptx = x as f32 + ((a as f32 / 360.0) * 6.28).cos() * rad as f32;            for a in (0..360).step_by(6) {            let mut pt_y = y as f32;            let mut pt_x = x as f32 + rad as f32;        if self.fill {        }            });                tex_coords:[0f32,0f32],                color: self.color,ad^f��kW+����X�
�
�
�
o
a
W
U

���tP3����qPA71/�
�
�
j
Q
8

�	�	�	�	�		y	w	4		�up@#����rhf"	�a\,���vN>����tjh*�����k_]���q\)���             let height1 = self.clone().height() as u32;        let width_img = i        let x1 = 0f32;//(x11 as u32 % img.dimensions.width()) as f32/2.0;        let x = x11;        let scale = [self.size.0, self.size.1];pub fn display(&mut self,img:Image,x11:u16,y11:u16){    ///simply displays a loaded image    ///this function shoould be used inside the draw loop, because it does not load an image, it}        });            text: text,            color: self.color,            position: [x as f32,y as f32],        self.text_vec.push(Stext{    pub fn text(&mut self,x:u16,y:u16,text:&'static str){///drawes a text of a certain color and locaion on the canvas}        }            ptnxt = *pt;            });                tex_coords:[0f32,0f32],                color: self.color,                position: mapf(*pt, scale),            self.stroke_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color: self.color,                position: mapf(ptnxt, scale),            self.stroke_vec.push(Vertex {        for pt in c.iter() {        let mut ptnxt = c[0];        let scale = [self.size.0, self.size.1];        let c = bezier_points(x1, y1, x2, y2, x3, y3, x4, y4);pub fn bezierCurveVertex(&mut self,x1: i64, y1: i64, x2: i64, y2: i64, x3: i64, y3: i64, x4: i64, y4: i64) {#[allow(non_snake_case)]///uses the cubic bezier curve algorithm in order to create a curve}        }            });                tex_coords:[0f32,0f32],                color: self.color,                position: mapf(*pt, scale),            self.stroke_vec.push(Vertex {        for pt in c.iter() {        let scale = [self.size.0, self.size.1];        let c = catmull_rom_chain(x1, y1, x2, y2, x3, y3, x4, y4);pub fn curveVertex(&mut self,x1: i64, y1: i64, x2: i64, y2: i64, x3: i64, y3: i64, x4: i64, y4: i64) {#[allow(non_snake_case)]///uses the catmull rom chain algorithm in order to create a curve}    }        );            ptvec[i + 3][1],            ptvec[i + 3][0],            ptvec[i + 2][1],            ptvec[i + 2][0],            ptvec[i + 1][1],            ptvec[i + 1][0],            ptvec[i][1],            ptvec[i][0],        self.bezierCurveVertex(    for i in 0..(ptvec.len() - 3) {pub fn curve(&mut self,ptvec: Vec<[i64; 2]>) {///loopes over the array and uses curveVertex to create a catmull rom chain curve}    }        }            );                ptvec[i + 3][1],                ptvec[i + 3][0],                ptvec[i + 2][1],                ptvec[i + 2][0],                ptvec[i + 1][1],                ptvec[i + 1][0],                ptvec[i][1],                ptvec[i][0],            self.bezierCurveVertex(        if (i + 1) % 4 == 0 || i == 0 {    for i in 0..(ptvec.len() - 3) {pub fn bezierCurve(&mut self,ptvec: Vec<[i64; 2]>) {#[allow(non_snake_case)]///loopes over the array and uses curveVertex to create a bezier curve}        }            }                pt_y = pty;                pt_x = ptx;                });                    tex_coords:[0f32,0f32],                    color: self.fill_color,                    position: map_circ([x as f32, y as f32], scale),                self.fill_vec.push(Vertex {                });                    tex_coords:[0f32,0f32],                    color: self.fill_color,                    position: map_circ([ptx, pty], scale),                self.fill_vec.push(Vertex {                });                    tex_coords:[0f32,0f32],                    color: self.fill_color,                    position: map_circ([pt_x, pt_y], scale),ad-y��O1
�����{yb}}}}}}}} }}}}}}}}}}}}}        Image{image_data,dimensions}        }*/            image_data[x] = None;        for x in cnt..100000{        }            cnt+=1;            image_data[cnt] = Some(i);        for i in image_data1{        let mut image_data:[Option<u8>;100000] = [None;100000];        /*let mut cnt =0;        let dimensions = Dimensions::Dim2d { width: info.width, height: info.height };ad��E���^@:�����sT93�
�
�
q
R
3

����A$����T/)�
�
�
�
~
i
c
<




�	�	�	y	g	F	0		�����}hP>*�������YSB���~]0	���sM+�a#��u,������        let start = Instant::now();        let mut counter1 = 0;        let mut text = DrawText::new(env.device.clone(), env.queue.clone(), env.swapchain.clone(), &env.images);        };            }                previous_frame_end =Box::new(env.previous_frame_end.unwrap());                set =None;            None =>{            },        previous_frame_end = Box::new(tex_future) as Box<dyn GpuFuture>;    .build().unwrap()));    .add_sampled_image(texture.clone(), sampler.clone()).unwrap()    set = Some(Arc::new(PersistentDescriptorSet::start(env.tex_pipeline.clone(),0)    SamplerAddressMode::Repeat, 0.0, 1.0, 0.0, 0.0).unwrap();    MipmapMode::Nearest, SamplerAddressMode::Repeat, SamplerAddressMode::Repeat,    let sampler = Sampler::new(env.device.clone(), Filter::Linear, Filter::Linear,        };                ).unwrap()                env.queue.clone()                Format::R8G8B8A8Srgb,                dimensions,                vec_tex.iter().cloned(),                ImmutableImage::from_iter(        let (texture, tex_future) = {                let dimensions = dim1;                let vec_tex = vec1.to_vec();            Some((vec1,dim1))=>{        match self.texture.clone(){        //draw_fn();        self = draw_fn(self);        let (mut env, mut events_loop) = init(self.size.0, self.size.1);        let mut previous_frame_end;        let set;    {        F: FnMut(Self)->Canvas + 'static,    where    pub fn show<F>(mut self, mut draw_fn: F)    ///this is the fun    mo     mouse_scroll:MouseScroll::new(),    mouse:Mouse::new(),    cursor_pos:(0,0),    key:Key::new(),    texture:None,    stroke_vec: vec![],    tex_vec: vec![],    fill_vec: vec![],    text_vec: vec![],    text_size: 18.0,    fps: 60.0,    background_color: [1.0, 1.0, 1.0, 1.0],    fill_color: [1.0, 1.0, 1.0, 1.0],    fill: false,    stroke_weight: 1,    color: [0.0, 0.0, 0.0, 1.0],    stroke: true,    size: (width, height),        Canvas{    pub fn new(width:u16,height:u16)->Canvas{    ///creates a new canvas surface for rendering    }        self.size.0     pub fn width(self)->u16{    ///returns the width of the canvas    }        self.size.1     pub fn height(self)->u16{    ///returns the height of the canvas    }        self.size    pub fn get_size(self)->(u16,u16) {    ///returns the size of the canvas    }        self.size = (width, height);    pub fn size(&mut self,width: u16, height: u16) {    ///creates the canvas with the width and height sent to this function    }        self.text_size = sz as f32;    pub fn textSize(&mut self,sz:u8) {    #[allow(non_snake_case)]    ///recieves f32 ext size and sets the canvases text_size to that size    }        //println!("{:?}",self.fill_color);        self.fill_color = mapping::map_colors([r, g, b, a]);        self.fill = true;        let a = color.get_a();        let b = color.get_b();        let g = color.get_g();        let r = color.get_r();    pub fn fill(&mut self, color:Color) {    ///the color.    ///enables fill and receives the color of the fill(the struct color) and sets the fill color to be    }        self.fill = false;    pub fn noFill(&mut self) {    #[allow(non_snake_case)]    ///disables fill on the canvas.    }        self.stroke = false;    pub fn noStroke(&mut self){    #[allow(non_snake_case)]    ///disables stroke on the canvas.    }        self.stroke = stroke;    pub fn set_stroke(&mut self,stroke:bool){    ///only sets stroke on, no need to send in color, last stroke color will e used    }        self.fill = fill;ad-D����|E���{V"�
�
�
_
2
���z_D-���YF�
�
v
I

�	�	�	�	:	'	���nW������x`R��k.��h-���{T���[&��_��x                    env.swapchain = new_swapchain;                        };                            Err(err) => panic!("{:?}", err),                            Err(SwapchainCreationError::UnsupportedDimensions) => continue,                            Ok(r) => r,                        match env.swapchain.recreate_with_dimension(dimensions) {                    let (new_swapchain, new_images) =                    };                        [dimensions.0, dimensions.1]                            .into();                            .to_physical(window.get_hidpi_factor())                            .unwrap()                            .get_inner_size()                        let dimensions: (u32, u32) = window                    let dimensions = {                if recreate_swapchain {                le                    self.fill_vec.data.iter().clo,//.clone().iter().clon                                                                    self.fill_vec.clone().iter().cloned(),                    BufferUsage::all(),                    env.device.clone(),                let fill_vertex_buffer = CpuAccessibleBuffer::from_iter(                .unwrap();                )                    self.stroke_vec.clone().iter().cloned(),                    BufferUsage::all(),                    env.device.clone(),                let stroke_vertex_buffer = CpuAccessibleBuffer::from_iter(            env.dynamic_state.line_width = Some(self.stroke_weight as f32);            }                return;            if done {            });                _ => (),            }                _=>{},                },                    self.mouse_scroll = MouseScroll{delta:(pos.x as i64,pos.y as i64),moder:modifiers};                } => {                            ..                            modifiers,                            delta: MouseScrollDelta::PixelDelta(pos),                    WindowEvent::MouseWheel{                },                    self.mouse = Mouse{btn:Some(button1),moder:modifiers};                } => {                            ..                            modifiers,                            button: button1,                            state: ElementState::Pressed,                    WindowEvent::MouseInput{                   }=>{self.cursor_pos = (posx as u16,posy as u16);},                        ..                        position:LogicalPosition{x:posx,y:posy},                    WindowEvent::CursorMoved{                },                    self.key = Key{keycode:Some(key),moder:modifiers,keep_key:false};                    }                        done = true;                    if key == VirtualKeyCode::W && modifiers.ctrl{                } => {                        ..                        },                            ..                            modifiers,                            virtual_keycode: Some(key),                            state: ElementState::Pressed,                        input:KeyboardInput{                    WindowEvent::KeyboardInput{                match event{                Event::WindowEvent{event,..}=>                } => recreate_swapchain = true,                    ..                    event: WindowEvent::Resized(_),                Event::WindowEvent {                } => done = true,                    ..                    event: WindowEvent::CloseRequested,                Event::WindowEvent {            events_loop.poll_events(|ev| match ev {                previous_frame_end.cleanup_finished();            let mut done = false;        loop {        let mut recreate_swapchain = env.recreate_swapchain;        let mut end;adB�����/���v6#�
�
�
i
L
 
���?"	�����kO/�
�
j
=
<


�	�	�	f	e	Z	J	3		����c'����p^B#!��}`=/����S$�����ui@.%	���mXA1�����~\2%��    mouse_scroll:MouseScroll,    mouse:Mouse,    cursor_pos:(u16,u16),    key:Key,    texture:Option<(Vec<u8>,Dimensions)>,    stroke_vec: Vec<Vertex>,         text_vec: Vec<Stext>,       fill_vec: Vec<Vertex>,         text_size: f32,    resizeable: bool,    pub fps: f32,    background_color: [f32; 4],    fill_color: [f32; 4],    fill: bool,    stroke_weight: u8,    color: [f32; 4],    stroke: bool,    size: (u16, u16),pub struct Canvas {#[derive(Clone, PartialEq)]///as you may see the draw loop is designed a bit different.///```///}///   canv.show(draw);///   };///        canvas///       canvas.bezierCurve(curve_vec);///      ];///          [250, 050],///           [150, 150],///           [80, 240],///           [75, 257],///           [50, 300],///           [30, 370],///           [0, 400],///       let curve_vec: Vec<[i64; 2]> = vec![///   let draw = |mut canvas:Canvas|->Canvas {///   canv.background(grayscale(100));///   let mut canv:Canvas= Canvas::new(width,height);///   //size(width, height);///   let width = 800;///       let height = 600;///fn main(){///use metropolis::canvas::Canvas;///use metropolis::color::*;///```///mutithreading safe but needs a slightly different way to use:///the public canvas struct(there is actually an inner one for the static functions). it is}    pub dimensions:Dimensions,    pub image_data:Vec<u8>,pub struct Image{#[derive(Clone)]///framerate in aout 12 fps.///This struct is meant for loading and saving the image once and not every frame, it improves}        .collect::<Vec<_>>()        })            ) as Arc<dyn FramebufferAbstract + Send + Sync>                    .unwrap(),                    .build()                    .unwrap()                    .add(image.clone())                Framebuffer::start(render_pass.clone())            Arc::new(        .map(|image| {        .iter()    images    dynamic_state.viewports = Some(vec![viewport]);    };        depth_range: 0.0..1.0,        dimensions: [dimensions[0] as f32, dimensions[1] as f32],        origin: [0.0, 0.0],    let viewport = Viewport {    let dimensions = images[0].dimensions();) -> Vec<Arc<dyn FramebufferAbstract + Send + Sync>> {    dynamic_state: &mut DynamicState,    render_pass: Arc<dyn RenderPassAbstract + Send + Sync>,    images: &[Arc<SwapchainImage<Window>>],fn window_size_dependent_setup(pub use winit::MouseButton;pub use winit::VirtualKeyCode as keyCode;use crate::math::{bezie//use crate::elements::*;use crate::elements::*;use crate::mapping::*;use crate::mapping;use crate::color::Color;use vulkano::format::Format;use vulkano::descriptor::descriptor_set::PersistentDescriptorSet;use vulkano::sampler::{Sampler, SamplerAddressMode, Filter, MipmapMode};use vulkano::image::{ImmutableImage, Dimensions};use std::time::{Duration, Instant};use crate::text::{DrawText, DrawTextTrait};use winit::MouseScrollDelta;use winit::dpi::LogicalPosition;use winit::{ModifiersState,KeyboardInput,ElementState,Event, WindowEvent,VirtualKeyCode};use winit::Window;use vulkano::sync::{FlushError, GpuFuture};use vulkano::sync;use vulkano::swapchain::{AcquireError, SwapchainCreationError};use vulkano::swapchain;use vulkano::pipeline::viewport::Viewport;use vulkano::image::SwapchainImage;use vulkano::framebuffer::{Framebuffer, FramebufferAbstract, RenderPassAbstract};use vulkano::command_buffer::{AutoCommandBufferBuilder, DynamicState,AutoCommandBuffer};use vulkano::buffer::{BufferUsage, CpuAccessibleBuffer};use std::sync::Arc;use crate::vertex::*;use crate::setup::*;adp
�
��������~�����eL'	�
�
�
�
�
[
U
/

��������l\E6" ���kLB5/-�
�
p
L
7
1


�	�	�	�	�	�	�	z	[		������k@:8
�����O7�������i�������u8���{qkI����uU2����iF@ set    }         self.key.keep_key = true;    pub fn lockKeyEvent(&mut self){    #[allow(non_snake_case)]    ///keeps the key pressed in the key event until a new key is pressed    }        }        None=> {return VirtualKeyCode::Power;}        Some(key)=> {return key;},        match self.key.keycode{    pub fn keyPressed(&mut self)->VirtualKeyCode{    #[allow(non_snake_case)]    ///returns the current key that is pressed.    }        Button::new(/*self,*/x,y)    pub fn button(self,x:u16,y:u16)->Button{    ///creates a defultary button    }        }        None=> {return MouseButton::Other(99);}        Some(btn)=> {return btn;},        match self.mouse.btn{    pub fn mouseClick(&mut self)->MouseButton{    #[allow(non_snake_case)]    ///returns the current key that is pressed on the mouse.impl Canvas {}    }        self.moder    pub fn get_mod(self)->ModifiersState{    }        Key{keycode,moder,keep_key:false}        let keycode = None;        let moder = ModifiersState{shift:false,ctrl:false,alt:false,logo:false};        pub fn new()->Key{impl Key{}    pub keep_key: bool,    pub moder:ModifiersState,    pub keycode:Option<VirtualKeyCode>,struct Key{#[derive(Copy,Clone,PartialEq)]}    }        Mouse{btn,moder}        let btn = None;        let moder = ModifiersState{shift:false,ctrl:false,alt:false,logo:false};        pub fn new()->Mouse{impl Mouse{}    pub moder:ModifiersState,    pub btn:Option<MouseButton>,struct Mouse{#[derive(Copy,Clone,PartialEq)]}    }        self.delta.1//.PixelDelta.y as i64    pub fn delta_y(self)->i64{    }        self.delta.0    pub fn delta_x(self)->i64{    }        MouseScroll{delta,moder}        let delta = (0,0);        let moder = ModifiersState{shift:false,ctrl:false,alt:false,logo:false};        pub fn new()->MouseScroll{impl MouseScroll{}    pub moder:ModifiersState,    pub delta:(i64,i64),struct MouseScroll{#[derive(Copy,Clone,PartialEq)]}    }        self.loc+1    pub fn len(self)->usize{    }        self.loc+=1;        self.data[self.loc] = ver1;    pub fn push(mut self,ver1:Stext){    }        VecishT{data:[Stext{position:[0.0,0.0],color:[0.0,0.0,0.0,0.0],text:""};3000],loc:0,loc_iter:0}    pub fn new()->VecishT{impl VecishT{}    }        None        }            self.loc_iter+=1;             return Some(self.data[self.loc_iter]);            if self.loc_iter<3000{    fn next(&mut self)->Option<Self::Item>{    type Item = Stext;impl Iterator for VecishT {}    loc_iter:usize,    loc:usize,    data:[Stext;3000],stru            }                break;            if cn            }                    }                  }                break;                }                   }                }                b            }                break;                   }                break;                     }                break;            }                         }                          }                break;            if cnt>=self.loc{        for ver in self.data.iter(){        let mut cnt = 0;        let mut vec1 = vec![];    pub fn vec(self)->Vec<Vertex>{    }        self.loc+=1;        self.data[self.loc] = ver1;    pub fn push(&mut self,ver1:Vertex){    }        Vecish{data:[Vertex{position:[0.0,0.0],color:[0.0,0.0,0.0,0.0],tex_coords:[0.0,0.0]};3000],loc:0}    pub fn new()->Vecish{impl Vecish{}    pub loc:usize,    pub data:[Vertex;3000],struct Vecish{#[derive(Copy,Clone)]/*}ad��9���ke6�����cIC�
�
�
�
�
Z
?
9
����tU���`Z�
�
�
�
s
T
5

�	�	�	�	v	p	D	#			��_A                    pub fn set_fill(&mut self,    pub fn set_fill(&mut self,fill:bool){    ///o    pub fn set_fill(&mut self,fill:bool){    ///only sets fill on, no need to send in color, last fill color will e used    }        self.fill    pub fn get_fill(self)->bool{    ///retruns the fill state of the canvas    }        self.stroke    pub fn get_stroke(self)->bool{    ///retruns the stroke state of the canvas    }        self.color = mapping::map_colors([r, g, b, a]);        self.stroke = true;        let a = color.get_a();        let b = color.get_b();        let g = color.get_g();        let r = color.get_r();    pub fn stroke(&mut self,color:Color){    ///the color.    ///enables stroke and receives the color of the stroke(the struct color) and sets the stroke color to be    }        self.stroke_weight = weight;    pub fn strokeWeight(&mut self,weight:u8){    #[allow(non_snake_case)]    ///sets the stroke weight(the width of lines and points    }        self.background_color = mapping::map_colors([r, g, b, a]);        let a = color.get_a();        let b = color.get_b();        let g = color.get_g();        let r = color.get_r();    pub fn background(&mut self,color:Color){    ///sets the background color(using the color struct).    }        self.key.get_mod()    pub fn get_modifiers(self)->ModifiersState{    ///returns the current state of the modifiers    }        self.cursor_pos.1    pub fn mouseY(&self)->u16{    #[allow(non_snake_case)]    ///returns the y position of the mouse    }        self.cursor_pos.0    pub fn mouseX(&self)->u16{    #[allow(non_snake_case)]    ///returns the x position of the mouse    }        self.mouse_scroll.delta_y()    pub fn mouseScrollY(&self)->i64{    #[allow(non_snake_case)]    ///returns the y scroll delta of the mouse    }        self.mouse_scroll.delta_x()    pub fn mouseScrollX(&self)->i64{    #[allow(non_snake_case)]    ///returns the x scroll delta of the mousead h��{N5+��hc     pub fn rect(&mut self,x: u16, y: u16, width: u16, height: u16) {///built.///recieves the x and y of the top spot and then the width and height of the rectangle you want        }        //});        }            counter1+=1;            self.mouse_scroll.delta = (0,0);            self.mouse.btn = Some(MouseButton::Other(99));            }            self.key.keycode = Some(VirtualKeyCode::Power);ad�	M
)����A���hN7�
�
�
z
h
N
7

���vdJ'
����z_4�
�
_
M
#
                )                    env.                )                    env.queue.family(),                    env.device.clone(),                        command_buffer = AutoCommandBufferBuilder::primary_one_time_submit(                            Some(set)=>{                        match set.clone(){                    }else{                        };                },                .unwrap();                .build()                .draw_text(&mut text, image_num)                .unwrap()                .end_render_pass()                .unwrap()                )                    (),                    (),                    vec![stroke_vertex_buffer.clone()],                    &env.dynamic_state,                    env.stroke_pipeline.clone(),                .draw(                .unwrap()                )                    (),                    (),                    vec![fill_vertex_buffer.clone()],                    &env.dynamic_state,                    env.fill_pipeline.clone(),                .draw(                .unwrap()                .begin_render_pass(env.framebuffers[image_num].clone(), false, clear_values)                .unwrap()                )                    env.queue.family(),                    env.device.clone(),                command_buffer = AutoCommandBufferBuilder::primary_one_time_submit(                None=>{                            },                .unwrap();                .build()ad��	1����iI���WV8�
�
�
�

t
d
M
7
����}A6���x\=;�
�
�
z
W
I
-

�	�	{	=	1	��qF:������^R��R'��_4(����+���?������w`P6���}}}    }   }}    }        TEXTURE = Some((self.image_data,self.dimensions));         //println!("pos:{:?}\ntex:{:?}",FILL_VERTECIES.clone()///   let mut canv:Canvas= Canvas::new(width,height);///   //size(width, height);///   let widt///   let mut canv:Canvas= Canvas::new///   let mut canv:Canvas= Canvas::new(///   let mut canv:Canvas= Canvas::new(width,height);///   /////   let mut canv:Canvas= Canvas::new(width,height);///   //size(width, height);///  ///   let mut canv:Canvas= Canvas::new(widt///   let mut canv:Canvas= Canvas::new(wi///   let mut canv:Canvas= Canvas::new///   let mut canv:Canvas= Canvas::new(widt///   let mu///   let mut canv:Canvas= Canvas::new(widt///   let mut canv:Canvas= Canvas::new(width,height);///   //size(width, ///   let mut canv:Canvas= Canvas::new///   let mut canv:Canvas= Canvas::new(width,height);///   //size(width, he///   let mu///   let mut canv:Canvas= Canvas::new(widt///   let mut canv:Canvas= Canvas::new(width,height);///   //size(width, height);///   let width = 800;/////   let mut canv:Canvas= Canvas::new///   let mut canv:Canvas= Canvas::new(width,height);///   //size(width, height);///   let width = 800;/// ///   let mu///   let mut canv:Canvas= Canvas::new(widt///   let mut canv:Canvas= Canvas::new(width,height);///   //size(width, height);///   let width = 800;/////   let mut canv:Canvas= Canvas::new///   let mut canv:Canvas= Canvas::new(width,height);///   //size(width, height);///   let width = 800;/// ///   let mu///   let mut canv:Canvas= Canvas::new(widt///   let mut canv:Canvas= Canvas::new(wi///   let mut canv:Canvas= Canvas::new///   let mut canv:Canvas= Canvas::new(widt///   let mu///   let mut canv:Canvas= Canvas::new(widt///   let mut canv:Canvas= Canvas::new(width,height);///   //size(width, h///   let mut canv:Canvas= Canvas::new///   let mut canv:Canvas= Canvas::new(width,height);///   //size(width, heigh///   let mu///   let mut canv:Canvas= Canvas::new(width,height);///   /////   let mut canv:Canvas= Canvas::new(width,height);///   //size(wi//////   let mut canv:Canvas= Canvas::new(width,height);///   //size(width, height);///   let width = 800;///       let height = 600;///fn main(){///use metropolis::canvas::Canvas;///use metropolis::color::*;///```///mutithreading safe but needs a slightly different way to use:///the public canvas struct(there is actually an inner one for the static functions). it is}    pub dimensions:Dimensions,    pub image_data:Vec<u8>,pub struct Image{#[derive(Clone)]///framerate in aout 12 fps.///This struct is meant for loading and saving the image once and not every frame, it improves}        .collect::<Vec<_>>()        })            ) as Arc<dyn FramebufferAbstract + Send + Sync>                    .unwrap(),                    .build()                    .unwrap()                    .add(image.clone())                Framebuffer::start(render_pass.clone())            Arc::new(        .map(|image| {        .iter()    images    dynamic_state.viewports = Some(vec![viewport]);    };        depth_range: 0.0..1.0,        dimensions: [dimensions[0] as f32, dimensions[1] as f32],        origin: [0.0, 0.0],    let viewport = Viewport {    let dimensions = images[0].dimensions();) -> Vec<Arc<dyn FramebufferAbstract + Send + Sync>> {    dynamic_state: &mut DynamicState,    render_pass: Arc<dyn RenderPassAbstract + Send + Sync>,    images: &[Arc<SwapchainImage<Window>>],fn window_size_dependent_setup(pub use winit::MouseButton;pub use winit::VirtualKeyCode as keyCode;use crate::math::{bezier_points, catmull_rom_chain};use std::fs::File;use png;ad^:p��lU,����nO8�
�
�
z
j
B
#

����vN>������a7�
�
�
�
i
A
1

�	�	�	�	o	P	9			���yi? 	����qI9������<��uG���{SC�����fO'�����Y:                  position: b_l,            self.fill_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: t_l,            self.fill_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: t_l,            self.fill_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: t_r,            self.fill_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: b_r,            self.fill_vec.push(Vertex {            let color = self.fill_color;        if self.fill {        let b_l = map([x, y + width], scale);        let t_r = map([x + width, y], scale);        let b_r = map([x + width, y + width], scale);        let t_l = map([x, y], scale);        let scale = [self.size.0, self.size.1];    pub fn square(&mut self,x: u16, y: u16, width: u16) {///recieves the x and y of the top spot and then the width of the sqaure you want built.}        }            });                tex_coords:[0f32,0f32],                color,                position: t_l,            self.stroke_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: b_l,            self.stroke_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: b_l,            self.stroke_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: b_r,            self.stroke_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: b_r,            self.stroke_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: t_r,            self.stroke_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: t_r,            self.stroke_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: t_l,            self.stroke_vec.push(Vertex {            let color = self.color;        if self.stroke {        }            });                tex_coords:[0f32,0f32],                color,                position: b_r,            self.fill_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: b_l,            self.fill_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: t_l,            self.fill_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: t_l,            self.fill_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: t_r,            self.fill_vec.push(Vertex {            });                tex_coords:[0f32,0f32],                color,                position: b_r,            self.fill_vec.push(Vertex {            let color = self.fill_color;        if self.fill {        let b_l = map([x, y + height], scale);        let t_r = map([x + width, y], scale);        let b_r = map([x + width, y + height], scale);ad��/�����YSB��sO.�
�
�
m
V
B

���tX2���F�
s
Z


�	�	�	u	j	���        let start = Instant::now();        let mut counter1 = 0;        let mut text = DrawText::new(env.device.clone(), env.queue.clone(), env.swapchain.clone(), &env.images);        };            }                previous_frame_end =Box::new(env.previous_frame_end.unwrap());                set =None;            None =>{            },        previous_frame_end = Box::new(tex_future) as Box<dyn GpuFuture>;    .build().unwrap()));    .add_sampled_image(texture.clone(), sampler.clone()).unwrap()    set = Some(Arc::new(PersistentDescriptorSet::start(env.tex_pipeline.clone(),0)    SamplerAddressMode::Repeat, 0.0, 1.0, 0.0, 0.0).unwrap();    MipmapMode::Nearest, SamplerAddressMode::Repeat, SamplerAddressMode::Repeat,    let sampler = Sampler::new(env.device.clone(), Filter::Linear, Filter::Linear,        };                ).unwrap()                env.queue.clone()                Format::R8G8B8A8Srgb,                dimensions,                vec_tex.iter().cloned(),                ImmutableImage::from_iter(        let (texture, tex_future) = {                let dimensions = dim1;                let vec_tex = vec1.to_vec();                }*/                    };                        None=>{},                        Some(x)=>{vec2.push(*x);},                    match u{                for u in vec1.iter(){                /*let mut vec2 = vec![];            Some((vec1,dim1))=>{        match self.texture.clone(){        //println!("{:?}",(self.texture.clone().unwrap().0).len());        self = draw_fn(self);        let (mut env, mut events_loop) = init(self.size.0, self.size.1);        let mut previous_frame_end;        let set;    {        F: FnMut(Self)->Canvas + 'static,    where    pub fn show<F>(mut self, mut draw_fn: F)    ///this is the function used to run the animation    }        }ad�
v���c;���yR�
�
~
Y
$


��]��v                      env.swapchain = new_swapchain;                        };                            Err(err) => panic!("{:?}", err),                            Err(SwapchainCreationError::UnsupportedDimensions) => continue,                            Ok(r) => r,                        match env.swapchain.recreate_with_dimension(dimensions) {                    let (new_swapchain, new_images) =                    };                        [dimensions.0, dimensions.1]                            .into();                            .to_physical(window.get_hidpi_factor())                            .unwrap()                            .get_inner_size()                        let dimensions: (u32, u32) = window                    let dimensions = {                if recreate_swapchain {                let window = env.surface.window();                .unwrap();                )                    self.tex_vec.clone().iter().cloned(),                    BufferUsage::all(),                    env.device.clone(),                let tex_vertex_buffer = CpuAccessibleBuffer::from_iter(                .unwrap();                )ad��{��������xL-���������vgSQ5�
�
�
{
q
d
^
\
N
3
���ze_B1+'������4�
�
�
�
�
�
n
h
f
F
8

�	�	�	�	}	e	L	F	D	$		������B&�������oZXJ
����TJD����rU#����X;���    }                     }         self.key.    }         self.key.keep_key = true;    pub fn lockKeyEvent(&mut self){    #[allow(non_snake_case)]    ///keeps the key pressed in the key event until a new key is pressed    }        }        None=> {return VirtualKeyCode::Power;}        Some(key)=> {return key;},        match self.key.keycode{    pub fn keyPressed(&mut self)->VirtualKeyCode{    #[allow(non_snake_case)]    ///returns the current key that is pressed.    }        element.draw(self);        where P:PageElement {    pub fn attach<P>(&mut self,element:P)    ///attaches a PageElement implementor to the canvas    }        }        None=> {return MouseButton::Other(99);}        Some(btn)=> {return btn;},        match self.mouse.btn{    pub fn mouseClick(&self)->MouseButton{    #[allow(non_snake_case)]    ///returns the current key that is pressed on the mouse.impl Canvas {}    Button::new(x,y)pub fn button(x:u16,y:u16)->Button{///creates a defultary button}    }        self.moder    pub fn get_mod(self)->ModifiersState{    }        Key{keycode,moder,keep_key:false}        let keycode = None;        let moder = ModifiersState{shift:false,ctrl:false,alt:false,logo:false};        pub fn new()->Key{impl Key{}    pub keep_key: bool,    pub moder:ModifiersState,    pub keycode:Option<VirtualKeyCode>,struct Key{#[derive(Copy,Clone,PartialEq)]}    }        Mouse{btn,moder}        let btn = None;        let moder = ModifiersState{shift:false,ctrl:false,alt:false,logo:false};        pub fn new()->Mouse{impl Mouse{}    pub moder:ModifiersState,    pub btn:Option<MouseButton>,struct Mouse{#[derive(Copy,Clone,PartialEq)]}    }        self.delta.1//.PixelDelta.y as i64    pub fn delta_y(self)->i64{    }        self.delta.0    pub fn delta_x(self)->i64{    }        MouseScroll{delta,moder}        let delta = (0,0);        let moder = ModifiersState{shift:false,ctrl:false,alt:false,logo:false};        pub fn new()->MouseScroll{impl MouseScroll{}    pub moder:ModifiersState,    pub delta:(i64,i64),struct MouseScroll{#[derive(Copy,Clone,PartialEq)]}*/    }        self.loc    pub fn len(self)->usize{    }        self.loc+=1;        self.data[self.loc] = ver1;    pub fn push(&mut self,ver1:Stext){    }        VecishT{data:[Stext{position:[0.0,0.0],color:[0.0,0.0,0.0,0.0],text:""};3000],loc:0,loc_iter:0}    pub fn new()->VecishT{impl VecishT{}    }        None        }            return Some(self.data[self.loc_iter-1]);                self.loc_iter+=1;         if self.loc_iter<3000{    fn next(&mut self)->Option<Self::Item>{    type Item = Stext;impl Iterator for VecishT {}    loc_iter:usize,    loc:usize,    data:[Stext;3000],struct VecishT{#[derive(Copy,Clone)]/*}*/    }        None        }            self.loc_iter+=1;             return Some(self.data[self.loc_iter]);            if self.loc_iter<3000{    fn next(&mut self)->Option<Self::Item>{    type Item = Vertex;/*impl Iterator for Vecish {*/}    }        vec1        }            cnt+=1;            vec1.push(*ver);ad}1&��{cJ1������|e`Y�
�
�
�
�
�
y
Y
G
3

����z`O1������y8�
�
           elements:VecEle                mouse    mouse_    mouse    mouse_sc    mouse_scroll:MouseScroll,    mouse:Mouse,    cursor_pos:(u16,u16),    key:Key,    te    mouse_scroll:MouseScroll,    mouse:Mouse,    cursor_pos:(u1    mou    mouse_scroll:MouseScroll,    mouse_scroll:MouseScroll,    m    mouse_scro    mouse_sc    mouse_scroll:MouseScroll,    mouse:Mouse,    mouse_scroll:MouseScroll,    mouse:M    mouse_scroll:MouseScroll,    mouse:Mouse,    cursor_pos:(u16,u16),    key:Key,    texture:Option<(Vec<u8>,Dimensions)>,    stroke_vec: Vec<Vertex>,         text_vec: Vec<Stext>,       tex_vec: Vec<Vertex>,         pub fill_vec: Vec<Vertex>,         text_size: f32,    pub fps: f32,    background_color: [f32; 4],    fill_color: [f32; 4],    fill: bool,    stroke_weight: u8,    color: [f32; 4],    stroke: bool,    size: (u16, u16),pub struct Canvas {#[derive(Clone)]///as you may see the draw loop is designed a bit different.///```///}///   canv.show(draw);///   };///        canvas///       canvas.bezierCurve(curve_vec);///      ];///          [250, 050],///           [150, 150],///           [80, 240],///           [75, 257],///           [50, 300],///           [30, 370],///           [0, 400],///       let curve_vec: Vec<[i64; 2]> = vec![///   let draw = |mut canvas:Canvas|->Canvas {///   canv.background(grayscale(100));adc/,���|Y�����
�
�
t


���h? ���vW�
�
�
z
H
/

�	�	^		��d/��                                                                                                              reader.next_frame(&mut image_data).u                                                          reader.next_frame(&mut image_data).unw               reader.next_frame(&mut image_data).unwrap()        reader.next_frame(&mut image_data).unwrap();        reader.next_frame(&mut image_data).unwrap();        image_data.resize((info.width * info.height        read                                                                                                                                                                                                                                                                                     reader.next_frame(&mut image_data).unwrap();        i        reader.next_frame(&mut image_data).unwrap();        image_data.resize((info.width * info.height * 4) as usize, 0);        let mut image_data = Vec::new();        //let image_data/*1*/ = img.raw_pixels();        //img.resize(img.width() , img.height() ,image::imageops::FilterType::Nearest);        //let img = image::open(path).unwrap();        let (info, mut reader) = decoder.read_info().unwrap();        let decoder = png::Decoder::new(File::open(path).unwrap());pub fn img(path:&str)->Image{#[allow(non_snake_case)]///should strictly be used outside the draw loop!///takes a path to the image and loads it into an Image struct}    }        self.texture = Some((img.image_data.clone(),img.dimensions));         });            tex_coords: map_tex([x1,y1+height_img as f32], scale),            color: self.color,            position: map([x,y+(img.dimensions.height() as u16)], scale),        self.tex_vec.push(Vertex {        });            tex_coords: map_tex([x1,y1], scale),            color: self.color,            position: map([x,y], scale),        self.tex_vec.push(Vertex {        });            tex_coords: map_tex([x1+width_img as f32,y1+height_img as f32], scale),            color: self.color,            position: map([x+(img.dimensions.width() as u16),y+(img.dimensions.height() as u16)], scale),        self.tex_vec.push(Vertex {        });            tex_coords: map_tex([x1+width_img as f32,y1+height_img as f32], scale),            color: self.color,            position: map([x+(img.dimensions.width() as u16),y+(img.dimensions.height() as u16)], scale),        self.tex_vec.push(Vertex {        });            tex_coords: map_tex([x1+width_img as f32,y1], scale),            color: self.color,            position: map([x+(img.dimensions.width() as u16),y], scale),        self.tex_vec.push(Vertex {        });            tex_coords:map_tex([x1,y1], scale),            color: self.color,            position: map([x,y], scale),ad����[��s         self.fill_vec.pus                                                             self.fill_vec.push(Vertex {        let div         self.tex_vec.push(Vertex {        //let diver_h = (height1 as f32/height_img as f32) as f32;        //let diver_w = (width1 as f32/width_img as f32) as f32;        let height_img = self.clone().height();        //let height_img = img.dimensions.height();ad����l:�        //let height1 = self.clone().height() as u32;        let width_img = self.clone().width();        //let width_img = img.dimensions.width();        //let width1 = self.clone().width() as u32;        let y1 = 0f32;//(y11 as u32 % img.dimensions.height()) as f32/2.0;        let y = y11;