[][src]Trait orbtk::Renderer

pub trait Renderer {
    fn width(&self) -> u32;
fn height(&self) -> u32;
fn data(&self) -> &[Color];
fn data_mut(&mut self) -> &mut [Color];
fn sync(&mut self) -> bool;
fn mode(&self) -> &Cell<Mode>; fn pixel(&mut self, x: i32, y: i32, color: Color) { ... }
fn arc(&mut self, x0: i32, y0: i32, radius: i32, parts: u8, color: Color) { ... }
fn circle(&mut self, x0: i32, y0: i32, radius: i32, color: Color) { ... }
fn line4points(&mut self, x0: i32, y0: i32, x: i32, y: i32, color: Color) { ... }
fn line(
        &mut self,
        argx1: i32,
        argy1: i32,
        argx2: i32,
        argy2: i32,
        color: Color
    ) { ... }
fn lines(&mut self, points: &[[i32; 2]], color: Color) { ... }
fn draw_path_stroke(&mut self, graphicspath: GraphicsPath, color: Color) { ... }
fn char(&mut self, x: i32, y: i32, c: char, color: Color) { ... }
fn set(&mut self, color: Color) { ... }
fn clear(&mut self) { ... }
fn rect(&mut self, x: i32, y: i32, w: u32, h: u32, color: Color) { ... }
fn box_blur(&mut self, x: i32, y: i32, w: u32, h: u32, r: i32) { ... }
fn box_shadow(
        &mut self,
        x: i32,
        y: i32,
        w: u32,
        h: u32,
        offset_x: i32,
        offset_y: i32,
        r: i32,
        color: Color
    ) { ... }
fn image(
        &mut self,
        start_x: i32,
        start_y: i32,
        w: u32,
        h: u32,
        data: &[Color]
    ) { ... }
fn image_legacy(
        &mut self,
        start_x: i32,
        start_y: i32,
        w: u32,
        h: u32,
        data: &[Color]
    ) { ... }
fn image_over(&mut self, start: i32, image_data: &[Color]) { ... }
fn image_opaque(
        &mut self,
        start_x: i32,
        start_y: i32,
        w: u32,
        h: u32,
        image_data: &[Color]
    ) { ... }
fn image_fast(
        &mut self,
        start_x: i32,
        start_y: i32,
        w: u32,
        h: u32,
        image_data: &[Color]
    ) { ... }
fn linear_gradient(
        &mut self,
        rect_x: i32,
        rect_y: i32,
        rect_width: u32,
        rect_height: u32,
        start_x: i32,
        start_y: i32,
        end_x: i32,
        end_y: i32,
        start_color: Color,
        end_color: Color
    ) { ... }
fn rounded_rect(
        &mut self,
        x: i32,
        y: i32,
        w: u32,
        h: u32,
        radius: u32,
        filled: bool,
        color: Color
    ) { ... }
fn wu_line(&mut self, x0: i32, y0: i32, x1: i32, y1: i32, color: Color) { ... }
fn wu_circle(&mut self, x0: i32, y0: i32, radius: i32, color: Color) { ... }
fn getpixel(&self, x: i32, y: i32) -> Color { ... } }

Required methods

fn width(&self) -> u32

Get width

fn height(&self) -> u32

Get height

fn data(&self) -> &[Color]

Access the pixel buffer

fn data_mut(&mut self) -> &mut [Color]

Access the pixel buffer mutably

fn sync(&mut self) -> bool

Flip the buffer

fn mode(&self) -> &Cell<Mode>

Set/get drawing mode

Loading content...

Provided methods

fn pixel(&mut self, x: i32, y: i32, color: Color)

Draw a pixel

fn arc(&mut self, x0: i32, y0: i32, radius: i32, parts: u8, color: Color)

Draw a piece of an arc. Negative radius will fill in the inside

fn circle(&mut self, x0: i32, y0: i32, radius: i32, color: Color)

Draw a circle. Negative radius will fill in the inside

fn line4points(&mut self, x0: i32, y0: i32, x: i32, y: i32, color: Color)

fn line(&mut self, argx1: i32, argy1: i32, argx2: i32, argy2: i32, color: Color)

Draw a line

fn lines(&mut self, points: &[[i32; 2]], color: Color)

fn draw_path_stroke(&mut self, graphicspath: GraphicsPath, color: Color)

Draw a path (GraphicsPath)

fn char(&mut self, x: i32, y: i32, c: char, color: Color)

Draw a character, using the loaded font

fn set(&mut self, color: Color)

Set entire window to a color

fn clear(&mut self)

Sets the whole window to black

fn rect(&mut self, x: i32, y: i32, w: u32, h: u32, color: Color)

fn box_blur(&mut self, x: i32, y: i32, w: u32, h: u32, r: i32)

fn box_shadow(
    &mut self,
    x: i32,
    y: i32,
    w: u32,
    h: u32,
    offset_x: i32,
    offset_y: i32,
    r: i32,
    color: Color
)

fn image(&mut self, start_x: i32, start_y: i32, w: u32, h: u32, data: &[Color])

Display an image

fn image_legacy(
    &mut self,
    start_x: i32,
    start_y: i32,
    w: u32,
    h: u32,
    data: &[Color]
)

fn image_over(&mut self, start: i32, image_data: &[Color])

Display an image overwriting a portion of window starting at given line : very quick!!

fn image_opaque(
    &mut self,
    start_x: i32,
    start_y: i32,
    w: u32,
    h: u32,
    image_data: &[Color]
)

Display an image using non transparent method

fn image_fast(
    &mut self,
    start_x: i32,
    start_y: i32,
    w: u32,
    h: u32,
    image_data: &[Color]
)

fn linear_gradient(
    &mut self,
    rect_x: i32,
    rect_y: i32,
    rect_width: u32,
    rect_height: u32,
    start_x: i32,
    start_y: i32,
    end_x: i32,
    end_y: i32,
    start_color: Color,
    end_color: Color
)

Draw a linear gradient in a rectangular region

fn rounded_rect(
    &mut self,
    x: i32,
    y: i32,
    w: u32,
    h: u32,
    radius: u32,
    filled: bool,
    color: Color
)

Draw a rect with rounded corners

fn wu_line(&mut self, x0: i32, y0: i32, x1: i32, y1: i32, color: Color)

Draws antialiased line

fn wu_circle(&mut self, x0: i32, y0: i32, radius: i32, color: Color)

Draws antialiased circle

fn getpixel(&self, x: i32, y: i32) -> Color

Gets pixel color at x,y position

Loading content...

Implementations on Foreign Types

impl Renderer for Image[src]

fn width(&self) -> u32[src]

Get the width of the image in pixels

fn height(&self) -> u32[src]

Get the height of the image in pixels

fn data(&self) -> &[Color][src]

Return a reference to a slice of colors making up the image

fn data_mut(&mut self) -> &mut [Color][src]

Return a mutable reference to a slice of colors making up the image

fn pixel(&mut self, x: i32, y: i32, color: Color)[src]

fn arc(&mut self, x0: i32, y0: i32, radius: i32, parts: u8, color: Color)[src]

fn circle(&mut self, x0: i32, y0: i32, radius: i32, color: Color)[src]

fn line4points(&mut self, x0: i32, y0: i32, x: i32, y: i32, color: Color)[src]

fn line(&mut self, argx1: i32, argy1: i32, argx2: i32, argy2: i32, color: Color)[src]

fn lines(&mut self, points: &[[i32; 2]], color: Color)[src]

fn draw_path_stroke(&mut self, graphicspath: GraphicsPath, color: Color)[src]

fn char(&mut self, x: i32, y: i32, c: char, color: Color)[src]

fn set(&mut self, color: Color)[src]

fn clear(&mut self)[src]

fn rect(&mut self, x: i32, y: i32, w: u32, h: u32, color: Color)[src]

fn box_blur(&mut self, x: i32, y: i32, w: u32, h: u32, r: i32)[src]

fn box_shadow(
    &mut self,
    x: i32,
    y: i32,
    w: u32,
    h: u32,
    offset_x: i32,
    offset_y: i32,
    r: i32,
    color: Color
)
[src]

fn image(&mut self, start_x: i32, start_y: i32, w: u32, h: u32, data: &[Color])[src]

fn image_legacy(
    &mut self,
    start_x: i32,
    start_y: i32,
    w: u32,
    h: u32,
    data: &[Color]
)
[src]

fn image_over(&mut self, start: i32, image_data: &[Color])[src]

fn image_opaque(
    &mut self,
    start_x: i32,
    start_y: i32,
    w: u32,
    h: u32,
    image_data: &[Color]
)
[src]

fn image_fast(
    &mut self,
    start_x: i32,
    start_y: i32,
    w: u32,
    h: u32,
    image_data: &[Color]
)
[src]

fn linear_gradient(
    &mut self,
    rect_x: i32,
    rect_y: i32,
    rect_width: u32,
    rect_height: u32,
    start_x: i32,
    start_y: i32,
    end_x: i32,
    end_y: i32,
    start_color: Color,
    end_color: Color
)
[src]

fn rounded_rect(
    &mut self,
    x: i32,
    y: i32,
    w: u32,
    h: u32,
    radius: u32,
    filled: bool,
    color: Color
)
[src]

fn wu_line(&mut self, x0: i32, y0: i32, x1: i32, y1: i32, color: Color)[src]

fn wu_circle(&mut self, x0: i32, y0: i32, radius: i32, color: Color)[src]

fn getpixel(&self, x: i32, y: i32) -> Color[src]

Loading content...

Implementors

impl Renderer for Window[src]

fn width(&self) -> u32[src]

Get width

fn height(&self) -> u32[src]

Get height

fn data(&self) -> &[Color][src]

Access pixel buffer

fn data_mut(&mut self) -> &mut [Color][src]

Access pixel buffer mutably

fn sync(&mut self) -> bool[src]

Flip the window buffer

fn mode(&self) -> &Cell<Mode>[src]

Set/get mode

fn pixel(&mut self, x: i32, y: i32, color: Color)[src]

fn arc(&mut self, x0: i32, y0: i32, radius: i32, parts: u8, color: Color)[src]

fn circle(&mut self, x0: i32, y0: i32, radius: i32, color: Color)[src]

fn line4points(&mut self, x0: i32, y0: i32, x: i32, y: i32, color: Color)[src]

fn line(&mut self, argx1: i32, argy1: i32, argx2: i32, argy2: i32, color: Color)[src]

fn lines(&mut self, points: &[[i32; 2]], color: Color)[src]

fn draw_path_stroke(&mut self, graphicspath: GraphicsPath, color: Color)[src]

fn char(&mut self, x: i32, y: i32, c: char, color: Color)[src]

fn set(&mut self, color: Color)[src]

fn clear(&mut self)[src]

fn rect(&mut self, x: i32, y: i32, w: u32, h: u32, color: Color)[src]

fn box_blur(&mut self, x: i32, y: i32, w: u32, h: u32, r: i32)[src]

fn box_shadow(
    &mut self,
    x: i32,
    y: i32,
    w: u32,
    h: u32,
    offset_x: i32,
    offset_y: i32,
    r: i32,
    color: Color
)
[src]

fn image(&mut self, start_x: i32, start_y: i32, w: u32, h: u32, data: &[Color])[src]

fn image_legacy(
    &mut self,
    start_x: i32,
    start_y: i32,
    w: u32,
    h: u32,
    data: &[Color]
)
[src]

fn image_over(&mut self, start: i32, image_data: &[Color])[src]

fn image_opaque(
    &mut self,
    start_x: i32,
    start_y: i32,
    w: u32,
    h: u32,
    image_data: &[Color]
)
[src]

fn image_fast(
    &mut self,
    start_x: i32,
    start_y: i32,
    w: u32,
    h: u32,
    image_data: &[Color]
)
[src]

fn linear_gradient(
    &mut self,
    rect_x: i32,
    rect_y: i32,
    rect_width: u32,
    rect_height: u32,
    start_x: i32,
    start_y: i32,
    end_x: i32,
    end_y: i32,
    start_color: Color,
    end_color: Color
)
[src]

fn rounded_rect(
    &mut self,
    x: i32,
    y: i32,
    w: u32,
    h: u32,
    radius: u32,
    filled: bool,
    color: Color
)
[src]

fn wu_line(&mut self, x0: i32, y0: i32, x1: i32, y1: i32, color: Color)[src]

fn wu_circle(&mut self, x0: i32, y0: i32, radius: i32, color: Color)[src]

fn getpixel(&self, x: i32, y: i32) -> Color[src]

impl<'a> Renderer for WindowRenderer<'a>[src]

fn pixel(&mut self, x: i32, y: i32, color: Color)[src]

fn arc(&mut self, x0: i32, y0: i32, radius: i32, parts: u8, color: Color)[src]

fn circle(&mut self, x0: i32, y0: i32, radius: i32, color: Color)[src]

fn line4points(&mut self, x0: i32, y0: i32, x: i32, y: i32, color: Color)[src]

fn line(&mut self, argx1: i32, argy1: i32, argx2: i32, argy2: i32, color: Color)[src]

fn lines(&mut self, points: &[[i32; 2]], color: Color)[src]

fn draw_path_stroke(&mut self, graphicspath: GraphicsPath, color: Color)[src]

fn set(&mut self, color: Color)[src]

fn clear(&mut self)[src]

fn rect(&mut self, x: i32, y: i32, w: u32, h: u32, color: Color)[src]

fn box_blur(&mut self, x: i32, y: i32, w: u32, h: u32, r: i32)[src]

fn box_shadow(
    &mut self,
    x: i32,
    y: i32,
    w: u32,
    h: u32,
    offset_x: i32,
    offset_y: i32,
    r: i32,
    color: Color
)
[src]

fn image(&mut self, start_x: i32, start_y: i32, w: u32, h: u32, data: &[Color])[src]

fn image_legacy(
    &mut self,
    start_x: i32,
    start_y: i32,
    w: u32,
    h: u32,
    data: &[Color]
)
[src]

fn image_over(&mut self, start: i32, image_data: &[Color])[src]

fn image_opaque(
    &mut self,
    start_x: i32,
    start_y: i32,
    w: u32,
    h: u32,
    image_data: &[Color]
)
[src]

fn image_fast(
    &mut self,
    start_x: i32,
    start_y: i32,
    w: u32,
    h: u32,
    image_data: &[Color]
)
[src]

fn linear_gradient(
    &mut self,
    rect_x: i32,
    rect_y: i32,
    rect_width: u32,
    rect_height: u32,
    start_x: i32,
    start_y: i32,
    end_x: i32,
    end_y: i32,
    start_color: Color,
    end_color: Color
)
[src]

fn rounded_rect(
    &mut self,
    x: i32,
    y: i32,
    w: u32,
    h: u32,
    radius: u32,
    filled: bool,
    color: Color
)
[src]

fn wu_line(&mut self, x0: i32, y0: i32, x1: i32, y1: i32, color: Color)[src]

fn wu_circle(&mut self, x0: i32, y0: i32, radius: i32, color: Color)[src]

fn getpixel(&self, x: i32, y: i32) -> Color[src]

Loading content...