Module ui.libvg

ui.libvg
Dependencies from vmod:
0
Imports:
8
Imported by:
2
Repository:
OS-specific
Show selected OS-specific symbols.
Backend-specific
Show selected Backend-specific symbols.

Dependencies defined in v.mod

This section is empty.

Imports

Imported by

Aliases

This section is empty.

Constants

This section is empty.

Sum types

This section is empty.

Functions

#fn bitmap_text_style

fn bitmap_text_style() &BitmapTextStyle

TODO: documentation

#fn hex_color

fn hex_color(c gx.Color) string

Color (because of cycle modules copy here)

#fn raster

fn raster(p RasterParams) &Raster

TODO: documentation

#fn svg

fn svg(p SvgParams) &Svg

TODO: documentation

#fn svg_text_style

fn svg_text_style() &SvgTextStyle

TODO: documentation

Structs

#struct BitmapTextStyle

pub struct BitmapTextStyle {
pub mut:
	font_name      string
	font_path      string
	size           int
	color          gx.Color
	align          ttf.Text_align
	vertical_align f32
}

#fn (&BitmapTextStyle) set_align

fn (mut ts &BitmapTextStyle) set_align(align int)

TODO: documentation

#fn (&BitmapTextStyle) set_vertical_align

fn (mut ts &BitmapTextStyle) set_vertical_align(align int)

TODO: documentation

#struct Raster

heap
pub struct Raster {
pub mut:
	width     int
	height    int
	channels  int = 4
	data      []byte
	ttf_font  &ttf.TTF_File = unsafe { nil }
	ttf_fonts map[string]ttf.TTF_File
	bmp       &ttf.BitMap = unsafe { nil }
	color     gx.Color
	// to remove
	filler [][]int
	style  ttf.Style
}

#fn (&Raster) clear

fn (mut r &Raster) clear()

TODO: documentation

#fn (&Raster) load

fn (mut r &Raster) load(img &gg.Image)

TODO: documentation

#fn (&Raster) load_image

fn (mut r &Raster) load_image(mut ctx &gg.Context, path string)

TODO: documentation

#fn (&Raster) save_image_as

fn (r &Raster) save_image_as(path string)

TODO: documentation

#fn (&Raster) get_pixel

fn (r &Raster) get_pixel(i int, j int) gx.Color

TODO: documentation

#fn (&Raster) set_pixel

fn (mut r &Raster) set_pixel(i int, j int, color gx.Color)

TODO: documentation

#fn (&Raster) rectangle_filled

fn (mut r &Raster) rectangle_filled(x int, y int, w int, h int, color gx.Color)

TODO: documentation

#fn (&Raster) copy

fn (mut r &Raster) copy(r2 &Raster, x int, y int, w int, h int)

TODO: documentation

#fn (&Raster) init_filler

fn (mut r &Raster) init_filler()

TODO: documentation

#fn (&Raster) clear_filler

fn (mut r &Raster) clear_filler()

TODO: documentation

#fn (&Raster) exec_filler

fn (mut r &Raster) exec_filler(color gx.Color)

TODO: documentation

#fn (&Raster) fline

fn (mut r &Raster) fline(in_x0 int, in_y0 int, in_x1 int, in_y1 int, c gx.Color)

TODO: documentation

#fn (&Raster) aline

inline
fn (mut r &Raster) aline(in_x0 int, in_y0 int, in_x1 int, in_y1 int, c gx.Color)

aline draw an aliased line on the bitmap

#fn (&Raster) line

fn (mut r &Raster) line(in_x0 int, in_y0 int, in_x1 int, in_y1 int, c gx.Color)

TODO: documentation

#fn (&Raster) box

fn (mut r &Raster) box(in_x0 int, in_y0 int, in_x1 int, in_y1 int, c gx.Color)

TODO: documentation

#fn (&Raster) quadratic

fn (mut r &Raster) quadratic(in_x0 int, in_y0 int, in_x1 int, in_y1 int, in_cx int, in_cy int, c gx.Color)

TODO: documentation

#fn (&Raster) draw_notdef_glyph

fn (mut r &Raster) draw_notdef_glyph(in_x int, in_w int)

#fn (&Raster) draw_text

fn (mut r &Raster) draw_text(in_string string) (int, int)

TODO: documentation

#fn (&Raster) draw_glyph

fn (mut r &Raster) draw_glyph(index u16) (int, int)

TODO: documentation

#fn (&Raster) draw_text_block

fn (mut r &Raster) draw_text_block(text string, block TextBlockParams)

write out a text

#fn (&Raster) attach_bitmap

fn (mut r &Raster) attach_bitmap()

TODO: documentation

#fn (&Raster) add_ttf

fn (mut r &Raster) add_ttf(ttf_filename string)

TODO: documentation

#fn (&Raster) attach_ttf

fn (mut r &Raster) attach_ttf(ttf_filename string)

TODO: documentation

#fn (&Raster) get_info_string

fn (r &Raster) get_info_string()

TODO: documentation

#fn (&Raster) set_font_size

fn (mut r &Raster) set_font_size(p SetFontSizeParams)

TODO: documentation

#fn (&Raster) init_style

fn (mut r &Raster) init_style(ts BitmapTextStyle)

TODO: documentation

#fn (&Raster) get_y_base

fn (r &Raster) get_y_base() f32

TODO: documentation

#struct RasterParams

params
pub struct RasterParams {
	width    int = 16
	height   int = 16
	channels int = 4
}

#struct TextBlockParams

params
pub struct TextBlockParams {
	x         int  // x postion of the left high corner
	y         int  // y postion of the left high corner
	w         int  // width of the text block
	h         int  // heigth of the text block
	cut_lines bool = true // force to cut the line if the length is over the text block width
}

#struct SetFontSizeParams

params
pub struct SetFontSizeParams {
	font_size  int
	device_dpi int = 72
}

#struct Svg

pub struct Svg {
pub mut:
	height   int
	width    int
	offset_x int
	offset_y int
	buffer   strings.Builder  = strings.new_builder(32768)
	content  &strings.Builder = unsafe { nil }
}

#fn (&Svg) free

unsafe
fn (r &Svg) free()

TODO: documentation

#fn (&Svg) resize

fn (mut s &Svg) resize(w int, h int)

TODO: documentation

#fn (&Svg) begin

fn (mut s &Svg) begin()

TODO: documentation

#fn (&Svg) end

fn (mut s &Svg) end()

TODO: documentation

#fn (&Svg) save

fn (mut s &Svg) save(filepath string) !

TODO: documentation

#fn (&Svg) circle

fn (mut s &Svg) circle(x int, y int, r int, p Params)

TODO: documentation

#fn (&Svg) line

fn (mut s &Svg) line(x1 int, y1 int, x2 int, y2 int, p Params)

TODO: documentation

#fn (&Svg) rectangle

fn (mut s &Svg) rectangle(x int, y int, width int, height int, p Params)

TODO: documentation

#fn (&Svg) fill

fn (mut s &Svg) fill(fill string)

TODO: documentation

#fn (&Svg) text

fn (mut s &Svg) text(x int, y int, text string, fill string, ts SvgTextStyle)

TODO: documentation

#fn (&Svg) ellipse

fn (mut s &Svg) ellipse(x int, y int, rx int, ry int, p Params)

TODO: documentation

#fn (&Svg) polygon

fn (mut s &Svg) polygon(points string, p Params)

TODO: documentation

#fn (&Svg) polyline

fn (mut s &Svg) polyline(points string, p Params)

TODO: documentation

#fn (&Svg) path

fn (mut s &Svg) path(d string, p Params)

TODO: documentation

#fn (&Svg) image

fn (mut s &Svg) image(x int, y int, width int, height int, path string)

TODO: documentation

#struct SvgParams

params
pub struct SvgParams {
	height int
	width  int
}

#struct Params

params
pub struct Params {
	stroke      string = 'none'
	strokewidth int
	fill        string = 'none'
	rx          int
	ry          int
	linecap     string = 'butt'
	linejoin    string = 'bevel'
}

#struct SvgTextStyle

pub struct SvgTextStyle {
pub mut:
	font_name      string
	font_path      string
	size           int
	color          gx.Color
	align          string
	vertical_align string
}

#fn (&SvgTextStyle) set_align

fn (mut ts &SvgTextStyle) set_align(align int)

TODO: documentation

#fn (&SvgTextStyle) set_vertical_align

fn (mut ts &SvgTextStyle) set_vertical_align(align int)

TODO: documentation

Interfaces

This section is empty.

Enums

This section is empty.