SWAG

Table of Contents

Namespaces

Structs

image

image/decode

image/encode

painter

poly

render/ogl

text

types

Interfaces

image/decode

image/encode

Enums

image

image/filter

image/transform

painter

poly

text

types

Constants

image/decode

painter

poly

render/ogl

Type Aliases

poly

render/ogl

Functions

image

image/decode

image/encode

image/filter

image/transform

painter

poly

render/ogl

text

types

Module pixel

Content

const Bmp.Constants [src]

BI_BITFIELDS s32
BI_RGB s32
BI_RLE4 s32
BI_RLE8 s32
ClipperScaleCoords f64
InvalidRenderTargetHandle RenderTargetHandle
InvalidRenderTargetSurfaceHandle RenderTargetSurfaceHandle
InvalidShaderHandle ShaderHandle
InvalidShaderParamHandle ShaderParamHandle
InvalidTextureHandle TextureHandle
MaxAAEdge s32

type alias Clipper.Type Aliases [src]

CInt Clipper.CInt
RenderTargetHandle RenderTargetHandle
RenderTargetSurfaceHandle RenderTargetSurfaceHandle
ShaderHandle ShaderHandle
ShaderParamHandle ShaderParamHandle
TextureHandle TextureHandle

enum Pixel.Argb [src]

AliceBlue
AntiqueWhite
Aqua
Aquamarine
Azure
Beige
Bisque
Black
BlanchedAlmond
Blue
BlueViolet
Brown
BurlyWood
CadetBlue
Chartreuse
Chocolate
Coral
CornflowerBlue
Cornsilk
Crimson
Cyan
DarkBlue
DarkCyan
DarkGoldenrod
DarkGray
DarkGreen
DarkKhaki
DarkMagenta
DarkOliveGreen
DarkOrange
DarkOrchid
DarkRed
DarkSalmon
DarkSeaGreen
DarkSlateBlue
DarkSlateGray
DarkTurquoise
DarkViolet
DeepPink
DeepSkyBlue
DimGray
DodgerBlue
Firebrick
FloralWhite
ForestGreen
Fuchsia
Gainsboro
GhostWhite
Gold
Goldenrod
Gray
Green
GreenYellow
Honeydew
HotPink
IndianRed
Indigo
Ivory
Khaki
Lavender
LavenderBlush
LawnGreen
LemonChiffon
LightBlue
LightCoral
LightCyan
LightGoldenrodYellow
LightGray
LightGreen
LightPink
LightSalmon
LightSeaGreen
LightSkyBlue
LightSlateGray
LightSteelBlue
LightYellow
Lime
LimeGreen
Linen
Magenta
Maroon
MediumAquamarine
MediumBlue
MediumOrchid
MediumPurple
MediumSeaGreen
MediumSlateBlue
MediumSpringGreen
MediumTurquoise
MediumVioletRed
MidnightBlue
MintCream
MistyRose
Moccasin
NavajoWhite
Navy
OldLace
Olive
OliveDrab
Orange
OrangeRed
Orchid
PaleGoldenrod
PaleGreen
PaleTurquoise
PaleVioletRed
PapayaWhip
PeachPuff
Peru
Pink
Plum
PowderBlue
Purple
Red
RosyBrown
RoyalBlue
SaddleBrown
Salmon
SandyBrown
SeaGreen
SeaShell
Sienna
Silver
SkyBlue
SlateBlue
SlateGray
Snow
SpringGreen
SteelBlue
Tan
Teal
Thistle
Tomato
Turquoise
Violet
Wheat
White
WhiteSmoke
Yellow
YellowGreen
Zero

func Argb.fromName [src]

Get the Argb value that matches name.

func fromName(name: string)->Argb

enum Pixel.BlendingMode [src]

Copy
Alpha
Add
Sub
SubDst
Min
Max

namespace Pixel.Bmp

Structs

Decoder
Encoder
Header

struct Bmp.Decoder [src]

func IImageDecoder.canDecode [src]

func canDecode(using self, fileName: string)->bool

func IImageDecoder.decode [src]

func decode(using self, buffer: const [..] u8, options: DecodeOptions)->Image throw

struct Bmp.Encoder [src]

func IImageEncoder.canEncode [src]

func canEncode(using self, fileName: string)->bool

func IImageEncoder.encode [src]

func encode(using self, result: *ConcatBuffer, image: Image, options: any) throw

struct Bmp.Header [src]

biSize u32
biWidth s32
biHeight s32
biPlanes u16
biBitCount u16
biCompression u32
biSizeImage u32
biXPelsPerMeter u32
biYPelsPerMeter u32
biClrUsed u32
biClrImportant u32

enum Pixel.BorderPos [src]

None
Inside

struct Pixel.Brush [src]

color Color
type BrushType
hatch HatchStyle
texture Texture
uvMode UVMode
uvRect Core.Math.Rectangle

Functions

createHatch Returns a hatch brush.
createSolid Returns a solid color brush.
createTexture Returns a full texture brush.
createTiled Returns a tiled texture brush.

func Brush.createHatch [src]

Returns a hatch brush.

func createHatch(style: HatchStyle, color: Color)->Brush

func Brush.createSolid [src]

Returns a solid color brush.

func createSolid(color: Color)->Brush

func Brush.createTexture [src]

Returns a full texture brush.

func createTexture(texture: Texture)->Brush

func Brush.createTiled [src]

Returns a tiled texture brush.

func createTiled(texture: Texture)->Brush

enum Pixel.BrushType [src]

SolidColor
Texture
Hatch

namespace Pixel.Clipper

Structs

IntPoint
Transform

Enums

ClipType
InitOptions
JoinType
PolyFillType
PolyType

enum Clipper.ClipType [src]

Intersection
Union
Difference
Xor

enum Clipper.InitOptions [src]

ReverseSolution
StrictlySimple
PreserveCollinear

struct Clipper.IntPoint [src]

x Clipper.CInt
y Clipper.CInt

enum Clipper.JoinType [src]

Square
Round
Miter

enum Clipper.PolyFillType [src]

EvenOdd
NonZero
Positive
Negative

enum Clipper.PolyType [src]

Subject
Clip

struct Clipper.Transform [src]

Special Functions

opDrop

func Transform.opDrop [src]

func opDrop(using self)

enum Pixel.ClippingMode [src]

Set
Clear

struct Pixel.Color [src]

a u8
r u8
g u8
b u8
argb u32

Functions

fromAbgr Create a new Color with specified values.
fromArgb(Argb) Create a new Color with specified values.
fromArgb(u32) Create a new Color with specified values.
fromArgb(u8, Argb) Create a new Color with specified values.
fromArgb(u8, u8, u8, u8) Create a new Color with specified values.
fromArgbf Create a new Color with specified values.
fromHsl Create a new Color with specified values.
fromRgb Create a new Color with specified values.
fromRgbf Create a new Color with specified values.
fromVector4 Create a new Color with specified values.
getBlend Blend two colors.
getBlendKeepAlpha Blend two colors, keeping the alpha channel of col0 untouched.
getDarker Returns a darker color.
getDistanceRgb Returns the distance between the other color.
getLighter Returns a lighter color.
isOpaque
setArgb Set all components.
setArgbf Set all components with floats in the range [0 1].
setHsl Initialize color with hue, saturation, lightness.
setRgb(self, const &Color) Just set r, g and b components.
setRgb(self, u8, u8, u8) Just set r, g and b components.
setRgbf Set r,g,b with floats in the range [0 1].
toArgbf Retrieve all components as floating point values between 0 and 1.
toHsl Returns hue, saturation, lightness.
toRgbf Retrieve all components as floating point values between 0 and 1.
toVector4 Get the color as a [Math.Vector4].

Special Functions

opAffect(self, Argb)
opAffect(self, string)
opAffect(self, u32)
opEquals(self, Argb)
opEquals(self, const &Color)
opEquals(self, u32)

func IPokeValue.poke [src]

func poke(using self, buf: string)->string throw

func Color.fromAbgr [src]

Create a new Color with specified values.

func fromAbgr(abgr: u32)->Color

func Color.fromArgb [src]

Create a new Color with specified values.

func fromArgb(a, r, g, b: u8)->Color func fromArgb(argb: Argb)->Color func fromArgb(alpha: u8, argb: Argb)->Color func fromArgb(argb: u32)->Color

func Color.fromArgbf [src]

Create a new Color with specified values.

func fromArgbf(a, r, g, b: f32)->Color

func Color.fromHsl [src]

Create a new Color with specified values.

func fromHsl(h, s, l: f32)->Color

func Color.fromRgb [src]

Create a new Color with specified values.

func fromRgb(r, g, b: u8)->Color

func Color.fromRgbf [src]

Create a new Color with specified values.

func fromRgbf(r, g, b: f32)->Color

func Color.fromVector4 [src]

Create a new Color with specified values.

func fromVector4(vec: Math.Vector4)->Color

func Color.getBlend [src]

Blend two colors.

func getBlend(col0, col1: Color, factor: f32)->Color

func Color.getBlendKeepAlpha [src]

Blend two colors, keeping the alpha channel of col0 untouched.

func getBlendKeepAlpha(col0, col1: Color, factor: f32)->Color

func Color.getDarker [src]

Returns a darker color.

func getDarker(col: Color, factor: f32)->Color

func Color.getDistanceRgb [src]

Returns the distance between the other color.

func getDistanceRgb(using self, col: Color)->f32

func Color.getLighter [src]

Returns a lighter color.

func getLighter(col: Color, factor: f32)->Color

func Color.isOpaque [src]

func isOpaque(using const self)->bool

func Color.opAffect [src]

func opAffect(self, argb: u32) func opAffect(self, argb: Argb) func opAffect(self, name: string)

func Color.opEquals [src]

func opEquals(self, argb: u32)->bool func opEquals(self, argb: Argb)->bool func opEquals(self, other: Self)->bool

func Color.setArgb [src]

Set all components.

func setArgb(self, a, r, g, b: u8)

func Color.setArgbf [src]

Set all components with floats in the range [0 1].

func setArgbf(self, a, r, g, b: f32)

func Color.setHsl [src]

Initialize color with hue, saturation, lightness.

func setHsl(using self, h, s, l: f32)

func Color.setRgb [src]

Just set r, g and b components.

func setRgb(self, r, g, b: u8)

Alpha will be opaque.

Just set r, g and b components.

func setRgb(using self, rgb: Color)

Alpha will be opaque.

func Color.setRgbf [src]

Set r,g,b with floats in the range [0 1].

func setRgbf(self, r, g, b: f32)

Alpha will be opaque.

func Color.toArgbf [src]

Retrieve all components as floating point values between 0 and 1.

func toArgbf(const self)->{a:f32,r:f32,g:f32,b:f32}

func Color.toHsl [src]

Returns hue, saturation, lightness.

func toHsl(using const self)->{h:f32,s:f32,l:f32}

func Color.toRgbf [src]

Retrieve all components as floating point values between 0 and 1.

func toRgbf(const self)->{r:f32,g:f32,b:f32}

func Color.toVector4 [src]

Get the color as a [Math.Vector4].

func toVector4(const self)->Core.Math.Vector4

struct Pixel.ColorMask [src]

r bool
g bool
b bool
a bool

struct Pixel.Command [src]

id CommandId
using params {clear:{color:Color},drawTriangles:{start:u32,count:u32},transform:{tr:Core.Math.Transform2},clippingRect:{rect:Core.Math.Rectangle},clippingRegion:{mode:ClippingMode},font:{fontRef:*Font},blendingMode:{mode:BlendingMode},textureFont:{font:*Font,atlasIndex:s32},colorMask:ColorMask,renderTgt:{tgt:*RenderTarget,paintAlpha:bool},shader:{shader:*ShaderBase},shaderParam:{param:ShaderParamHandle,type:const *Swag.TypeInfo,_f32:f32,_s32:s32},texture0:{boundRect:Core.Math.Vector4,textureRect:Core.Math.Vector4,type:BrushType,hatch:HatchStyle,uvMode:UVMode,interpolationMode:InterpolationMode,texture:Texture}}

enum Pixel.CommandId [src]

Clear
ColorMask
Transform
DrawTriangles
BindTexture0
ResetTexture0
StartFont
EndFont
BindTextureFont
ResetTextureFont
SetClippingRect
ResetClippingRect
StartClippingRegion
EndClippingRegion
ResetClippingRegion
SetClippingRegionMode
UpdateFont
StartNoOverlap
StopNoOverlap
SetBlendingMode
BindRenderTarget
UnbindRenderTarget
ReleaseRenderTarget
SetShader
SetShaderParam

enum Pixel.DashCapStyle [src]

None
Triangle
Round
Square

enum Pixel.DashStyle [src]

None
Pattern
Dot
Dash
DashDot

struct Pixel.DecodeOptions [src]

decodePixels bool

enum Pixel.DefaultShaderId [src]

Default
Blur

enum Pixel.DrawPathListMode [src]

Separate
Merge

struct Pixel.Element [src]

type ElementType
position Core.Math.Vector2
p1 Core.Math.Vector2
p2 Core.Math.Vector2

enum Pixel.ElementType [src]

Line
Arc
Bezier1
Bezier2
Curve

struct Pixel.Font [src]

ascent f32
descent f32
height f32
underlinePos f32
underlineSize f32
forceBold bool
forceItalic bool
fullname Core.String
typeFace *TypeFace
size u32
atlases Core.Array'(Pixel.GlyphAtlas)
asciiRef [128] GlyphDesc
unicodeRef Core.HashTable'(rune, *Pixel.GlyphDesc)
dirty bool

Functions

create(*TypeFace, u32, bool, bool) Creates a new Font of the given typeface and size.
create(string, u32, bool, bool) Creates a new Font with the given filename and size.
getGlyphDesc Returns the glyph descriptor of a given rune.
release Release the given font.

Special Functions

opDrop

func Font.create [src]

Creates a new Font of the given typeface and size.

func create(typeFace: *TypeFace, size: u32, forceBold, forceItalic = false)->*Font

Creates a new Font with the given filename and size.

func create(fullname: string, size: u32, forceBold, forceItalic = false)->*Font throw

func Font.getGlyphDesc [src]

Returns the glyph descriptor of a given rune.

func getGlyphDesc(using self, c: rune)->const *GlyphDesc

func Font.opDrop [src]

func opDrop(using self)

func Font.release [src]

Release the given font.

func release(font: *Font)

struct Pixel.FontFamily [src]

regular *Font
bold *Font
italic *Font
boldItalic *Font

Functions

createTypeFace Creates a typeface from a FontFamilyEnumerate and FontFamilyStyle.
enumerateFromOs Enumerate the font families available in the os.
getFont Get the font corresponding to the style.
getFromOs Get a FontFamilyEnumerate from a font family name.
setFont Set the font corresponding to a given style.

func FontFamily.createTypeFace [src]

Creates a typeface from a FontFamilyEnumerate and FontFamilyStyle.

func createTypeFace(enumerate: FontFamilyEnumerate, style: FontFamilyStyle)->*TypeFace throw

func FontFamily.enumerateFromOs [src]

Enumerate the font families available in the os.

func enumerateFromOs()->Core.Array'(Pixel.FontFamilyEnumerate)

func FontFamily.getFont [src]

Get the font corresponding to the style.

func getFont(using self, style: FontFamilyStyle)->*Font

If not evailable, get another one.

func FontFamily.getFromOs [src]

Get a FontFamilyEnumerate from a font family name.

func getFromOs(fontFamily: string)->FontFamilyEnumerate

func FontFamily.setFont [src]

Set the font corresponding to a given style.

func setFont(using self, fnt: *Font, style: FontFamilyStyle)

struct Pixel.FontFamilyEnumerate [src]

name Core.String
faces [4] FontFamilyStyleEnumerate

enum Pixel.FontFamilyStyle [src]

Regular
Bold
Italic
BoldItalic

struct Pixel.FontFamilyStyleEnumerate [src]

name Core.String
face Gdi32.LOGFONTW

namespace Pixel.Gif

Structs

Decoder

struct Gif.Decoder [src]

Functions

getFrame Create an image for the current frame.
getNumFrames Returns the number of frames As Gif does not store it, we need to go threw all images (!).
init Initialize the decoder.
nextFrame Get the next frame. Returns false if we have reached the end.
rewind Restart at frame 0.

func IImageDecoder.canDecode [src]

func canDecode(using self, fileName: string)->bool

func IImageDecoder.decode [src]

func decode(using self, buffer: const [..] u8, options: DecodeOptions)->Image throw

func Decoder.getFrame [src]

Create an image for the current frame.

func getFrame(using self, image: *Image, decodePixels = true)

func Decoder.getNumFrames [src]

Returns the number of frames As Gif does not store it, we need to go threw all images (!).

func getNumFrames(using self)->s32 throw

func Decoder.init [src]

Initialize the decoder.

func init(using self, buffer: const [..] u8, decodePixels: bool) throw

func Decoder.nextFrame [src]

Get the next frame. Returns false if we have reached the end.

func nextFrame(using self, img: *Image)->bool throw

func Decoder.rewind [src]

Restart at frame 0.

func rewind(using self)

struct Pixel.GlyphAtlas [src]

texture Texture
width u32
height u32
bpp u32
datas Core.Array'(u8)
dirty bool
curX s32
curY s32
nextY s32

struct Pixel.GlyphDesc [src]

uv Core.Math.Rectangle
atlasIndex s32
advanceX f32
advanceY f32
shiftX f32
shiftY f32
width f32
height f32

enum Pixel.HatchStyle [src]

Dot
Horizontal
HorizontalLight
HorizontalNarrow
Vertical
VerticalLight
VerticalNarrow
SolidDiamond
OutlinedDiamond
HorizontalDark
VerticalDark
Grid
GridLarge
GridDotted
Cross
CrossLarge
Percent5
Percent10
Percent20
Percent25
Percent30
Percent40
Percent50
Percent60
Percent70
Percent75
Percent80
Percent90
CheckBoard
CheckBoardLarge
Weave
DiagonalForward
DiagonalForwardLight
DiagonalBackward
DiagonalBackwardLight
DiagonalCross

interface Pixel.IImageDecoder [src]

Interface to decode a buffer.

canDecode func(*IImageDecoder, string)->bool
decode func(*IImageDecoder, const [..] u8, DecodeOptions)->Image throw

interface Pixel.IImageEncoder [src]

Interface to decode a buffer.

canEncode func(*IImageEncoder, string)->bool
encode func(*IImageEncoder, *Core.ConcatBuffer, Image, any) throw

struct Pixel.Image [src]

An image buffer, in various pixel formats.

pixels Core.Array'(u8) All the pixels.
size u64 Size in bytes.
width s32 The width of the image.
height s32 The height of the image.
width8 s32 The width, in bytes.
pf PixelFormat Format of one pixel.
bpp u8 Bits per pixel.
bpp8 u8 Bytes per pixel.
workingBuffer *Image Temporary buffer for filters and transformations.

Functions

addDecoder Register an image decoder.
addEncoder Register an image encoder.
allocPixels Allocate pixels.
allocWorkingBuffer(self) Allocate a computing buffer with current image size.
allocWorkingBuffer(self, s32, s32, PixelFormat) Allocate a computing buffer with new sizes.
applyKernel Apply a kernel to the image.
applyWorkingBuffer Replace the current image content with the working buffer.
canLoad Returns true if the given filename has a corresponding decoder.
canSave Returns true if the given filename has a corresponding encoder.
clear Clear the content of the image.
colorize Colorize the image by setting the hue and saturation.
contrast Change the contrast. factor is [-1, 1].
copyPixel Copy one pixel, depending on bpp.
create Creates a new image.
crop(self, const &Rectangle)
crop(self, s32, s32, s32, s32) Crop image.
decode Decode the given image buffer.
fade Fade to a given color. factor is [0, 1].
fill Fill image with color.
fillGradient2 Fill with an horizontal gradient from color0 to color1.
fillGradient4 Fill with a gradient with a different color at each corner.
fillHsl
flip Flip image vertically.
freeWorkingBuffer Free the working buffer if allocated.
from(HBITMAP) Creates an image from a windows HBITMAP.
from(HICON) Creates an image from a windows HICON.
gamma Change the gamma.
getPixelColor Returns the color at the given coordinate.
grayScale Transform image to grayscale, with a given factor.
halfSize Divide image size by 2 with a bilinear 2x2 filter.
init Initialize image informations pixels is set to null, and must be initialized after a call to that function This gives the opportunity to set the pixels with an external buffer.
invert Invert colors.
isValid Returns true if the image is valid.
lightness Change the lightness. factor is [-1, 1].
load Load the given image file.
mirror Flip image horizontally.
mix Mix with another image.
noise Fill the image with a noise.
release Release the content of the image.
resize Resize image Put newWidth or newHeight to 0 to keep aspect ratio.
save Save the image to a file.
setAlpha Change the alpha channel.
setChannel Change specified color channels.
setPixelFormat Change image pixel format.
setPixelRGBA8 Set pixel values depending on pixel format.
toApplyKernel Apply a kernel to the image.
toCrop(self, const &Rectangle)
toCrop(self, s32, s32, s32, s32) Crop image.
toFlip Flip image vertically.
toHICON Transform an image to a windows icon.
toHalfSize Divide image size by 2 with a bilinear 2x2 filter.
toMirror Flip image horizontally.
toMix Mix with another image.
toResize Resize image Put newWidth or newHeight to 0 to keep aspect ratio.
toSetPixelFormat Change image pixel format.
toTurn Turn image by a given predefined angle.
turn Turn image by a given predefined angle.
visitPixels Macro to foreach all pixels of the image in parallel chunks.

Special Functions

opDrop
opPostCopy
opVisit

enum Image.ChannelMode [src]

Red
Green
Blue
Alpha
RGB
RGBA

enum Image.ChannelValueMode [src]

Color
MinRGB
MaxRGB
MeanRGB
Alpha

enum Image.FillHslType [src]

HueVert
HueHorz
SaturationVert
SaturationHorz
LightnessVert
LightnessHorz
HueSaturation
HueLightness
SaturationLightness (h,0,1) (h,1,0.5) (h,0,0) (h,1,0).
GreenBlue
RedBlue
RedGreen

enum Image.Kernel [src]

Kernel format is : kernelSize, kernelNormalizeValue, kernelValues...

GaussianBlur3x3A
GaussianBlur3x3B
GaussianBlur5x5A
BoxBlur3x3A
BoxBlur5x5A
Sharpen3x3A
Sharpen3x3B
Soften3x3A
EmbossLeft3x3A
EmbossLeft3x3B
EmbossLeft3x3C
EmbossRight3x3A
EmbossRight3x3B
EmbossRight3x3C
EdgeDetect3x3A
EdgeDetect3x3B
EdgeDetect3x3C
EdgeDetect3x3D
EdgeDetect3x3E
EdgeDetect3x3F
SobelHorizontal3x3A
SobelVertical3x3A
PrevitHorizontal3x3A
PrevitVertical3x3A

enum Image.MixMode [src]

Copy
AlphaBlend

enum Image.ResizeMode [src]

Raw
Bilinear
Bicubic
Gaussian
Quadratic
Hermite
Hamming
Catrom

enum Image.TurnAngle [src]

T90
T180
T270

func Image.addDecoder [src]

Register an image decoder.

func(T) addDecoder()

func Image.addEncoder [src]

Register an image encoder.

func(T) addEncoder()

func Image.allocPixels [src]

Allocate pixels.

func allocPixels(using self)

func Image.allocWorkingBuffer [src]

Allocate a computing buffer with current image size.

func allocWorkingBuffer(using self)

Allocate a computing buffer with new sizes.

func allocWorkingBuffer(using self, newWidth, newHeight: s32, newPf: PixelFormat)

func Image.applyKernel [src]

Apply a kernel to the image.

func applyKernel(using self, kernel: Kernel)

func Image.applyWorkingBuffer [src]

Replace the current image content with the working buffer.

func applyWorkingBuffer(using self)

func Image.canLoad [src]

Returns true if the given filename has a corresponding decoder.

func canLoad(fileName: string)->bool

func Image.canSave [src]

Returns true if the given filename has a corresponding encoder.

func canSave(fileName: string)->bool

func Image.clear [src]

Clear the content of the image.

func clear(using self)

func Image.colorize [src]

Colorize the image by setting the hue and saturation.

func colorize(using self, hue, saturation: f32, strength = 1.0)

func Image.contrast [src]

Change the contrast. factor is [-1, 1].

func contrast(using self, factor: f32 = 0.5)

func Image.copyPixel [src]

Copy one pixel, depending on bpp.

func(BPP: u8) copyPixel(pixDst, pixSrc: ^u8)

func Image.create [src]

Creates a new image.

func create(width, height: s32, pf: PixelFormat, buffer: const [..] u8 = null)->Image

func Image.crop [src]

Crop image.

func crop(using self, x, y, w, h: s32) func crop(using self, cropRect: Math.Rectangle)

func Image.decode [src]

Decode the given image buffer.

func decode(fileName: string, bytes: const [..] u8, options: DecodeOptions = {})->Image throw

func Image.fade [src]

Fade to a given color. factor is [0, 1].

func fade(using self, color: Color, factor: f32 = 0.5)

func Image.fill [src]

Fill image with color.

func fill(using self, color: Color)

func Image.fillGradient2 [src]

Fill with an horizontal gradient from color0 to color1.

func fillGradient2(using self, color0, color1: Color)

func Image.fillGradient4 [src]

Fill with a gradient with a different color at each corner.

func fillGradient4(using self, topLeft, topRight, bottomLeft, bottomRight: Color)

func Image.fillHsl [src]

func fillHsl(using self, fillType: FillHslType, color: Color = Argb.White)

func Image.flip [src]

Flip image vertically.

func flip(using self)

func Image.freeWorkingBuffer [src]

Free the working buffer if allocated.

func freeWorkingBuffer(using self)

func Image.from [src]

Creates an image from a windows HICON.

func from(hicon: HICON)->Image throw

Creates an image from a windows HBITMAP.

func from(hbitmap: HBITMAP)->Image throw

func Image.gamma [src]

Change the gamma.

func gamma(using self, level: f32 = 2.2)

func Image.getPixelColor [src]

Returns the color at the given coordinate.

func getPixelColor(using self, pixX, pixY: s32)->Color

func Image.grayScale [src]

Transform image to grayscale, with a given factor.

func grayScale(using self, factor: f32 = 1)

func Image.halfSize [src]

Divide image size by 2 with a bilinear 2x2 filter.

func halfSize(using self)

func Image.init [src]

Initialize image informations pixels is set to null, and must be initialized after a call to that function This gives the opportunity to set the pixels with an external buffer.

func init(using self, width, height: s32, pf: PixelFormat)

func Image.invert [src]

Invert colors.

func invert(using self)

func Image.isValid [src]

Returns true if the image is valid.

func isValid(using const self)->bool

func Image.lightness [src]

Change the lightness. factor is [-1, 1].

func lightness(using self, factor: f32 = 0.5)

func Image.load [src]

Load the given image file.

func load(fileName: string, options: DecodeOptions = {})->Image throw

func Image.mirror [src]

Flip image horizontally.

func mirror(using self)

func Image.mix [src]

Mix with another image.

func mix(using self, srcImage: Image, x, y: s32, mode = MixMode.Copy)

func Image.noise [src]

Fill the image with a noise.

func noise(using self, noise: *Noise.FastNoise)

func Image.opDrop [src]

func opDrop(using self)

func Image.opPostCopy [src]

func opPostCopy(using self)

func Image.opVisit [src]

#[Swag.Macro] func(ptr: bool, back: bool) opVisit(using self, stmt: code)

func Image.release [src]

Release the content of the image.

func release(using self)

func Image.resize [src]

Resize image Put newWidth or newHeight to 0 to keep aspect ratio.

func resize(using self, newWidth, newHeight: s32, mode = ResizeMode.Raw)

func Image.save [src]

Save the image to a file.

func save(using self, fileName: string, options: any = null) throw

func Image.setAlpha [src]

Change the alpha channel.

func setAlpha(using self, value: u8 = 0)

func Image.setChannel [src]

Change specified color channels.

func setChannel(using self, mode: ChannelMode, value: ChannelValueMode, color: u8 = 0)

func Image.setPixelFormat [src]

Change image pixel format.

func setPixelFormat(using self, newPf: PixelFormat)

func Image.setPixelRGBA8 [src]

Set pixel values depending on pixel format.

func(PF: PixelFormat) setPixelRGBA8(pixDst: ^u8, r, g, b, _a: u8)

func Image.toApplyKernel [src]

Apply a kernel to the image.

func toApplyKernel(using self, kernel: Kernel)->Image

func Image.toCrop [src]

Crop image.

func toCrop(using const self, x, y, w, h: s32)->Image func toCrop(using const self, cropRect: Math.Rectangle)->Image

func Image.toFlip [src]

Flip image vertically.

func toFlip(using const self)->Image

func Image.toHICON [src]

Transform an image to a windows icon.

func toHICON(using self)->Win32.HICON throw

func Image.toHalfSize [src]

Divide image size by 2 with a bilinear 2x2 filter.

func toHalfSize(using const self)->Image

func Image.toMirror [src]

Flip image horizontally.

func toMirror(using const self)->Image

func Image.toMix [src]

Mix with another image.

func toMix(using const self, srcImage: Image, x, y: s32, mode = MixMode.Copy)->Image

func Image.toResize [src]

Resize image Put newWidth or newHeight to 0 to keep aspect ratio.

func toResize(using const self, newWidth, newHeight: s32, mode = ResizeMode.Raw)->Image

func Image.toSetPixelFormat [src]

Change image pixel format.

func toSetPixelFormat(using const self, newPf: PixelFormat)->Image

func Image.toTurn [src]

Turn image by a given predefined angle.

func toTurn(using const self, angle: TurnAngle)->Image

func Image.turn [src]

Turn image by a given predefined angle.

func turn(using self, angle: TurnAngle)

func Image.visitPixels [src]

Macro to foreach all pixels of the image in parallel chunks.

#[Swag.Macro] func visitPixels(using const self, userData: *void = null, stride: s32 = 1, stmt: code)

Exported variables:

pix address of the pixel
image the processed image
index the pixel index
x the pixel x coordinates
y the pixel y coordinates
userData as passed to the macro

enum Pixel.InterpolationMode [src]

Pixel
Linear

enum Pixel.JoinStyle [src]

None
Bevel
Round
Miter
MiterBevel

namespace Pixel.Jpg

Structs

Decoder
EncodeOptions
Encoder

struct Jpg.Decoder [src]

func IImageDecoder.canDecode [src]

func canDecode(using self, fileName: string)->bool

func IImageDecoder.decode [src]

func decode(using self, buffer: const [..] u8, options: DecodeOptions)->Image throw

struct Jpg.EncodeOptions [src]

quality u8 Encoding quality between 1 and 100.

struct Jpg.Encoder [src]

func IImageEncoder.canEncode [src]

func canEncode(using self, fileName: string)->bool

func IImageEncoder.encode [src]

func encode(using self, result: *ConcatBuffer, image: Image, options: any) throw

enum Pixel.LineCapStyle [src]

None
Triangle
Round
Square
ArrowAnchor
SquareAnchor
RoundAnchor

struct Pixel.LinePath [src]

elements Core.Array'(Pixel.Element)
startPoint Core.Math.Vector2
endPoint Core.Math.Vector2
isClosed bool
isDirty bool
serial s32
flattenQuality PaintQuality
isPolyOnly bool
isFlatten bool
bvMin Core.Math.Vector2
bvMax Core.Math.Vector2
endPosBuffer Core.Math.Vector2
polygon Polygon
triangles Poly2Tri.Result

Functions

arcTo Add an arc from the previous point.
bezierTo(self, f32, f32, f32, f32) Add a curve from the previous point to pt.
bezierTo(self, f32, f32, f32, f32, f32, f32) Add a curve from the previous point to pt.
clearCache Clear internal cache.
close Close the figure Will add a line or a curve to the first point if necessary.
curveTo Add a curve from the previous point to pt.
flatten Convert the path to a list of points.
lineTo Add a line from the previous point to pt.
setArc Initialize the path with an arc.
setCircle Initialize the path with a circle.
setEllipse Initialize the path with an ellipse.
setRect Initialize the path with a rectangle.
setRoundRect Initialize the path with a round rectangle.
start Reset the path.

Special Functions

opDrop
opPostCopy

func LinePath.arcTo [src]

Add an arc from the previous point.

func arcTo(using self, centerX, centerY: f32, radiusX, radiusY: f32, initAngle, maxAngle: Math.Angle)

func LinePath.bezierTo [src]

Add a curve from the previous point to pt.

func bezierTo(using self, x, y: f32, ctx, cty: f32) func bezierTo(using self, x, y: f32, ct1x, ct1y: f32, ct2x, ct2y: f32)

func LinePath.clearCache [src]

Clear internal cache.

func clearCache(using self)

func LinePath.close [src]

Close the figure Will add a line or a curve to the first point if necessary.

func close(using self)

func LinePath.curveTo [src]

Add a curve from the previous point to pt.

func curveTo(using self, x, y: f32)

func LinePath.flatten [src]

Convert the path to a list of points.

func flatten(using self, quality = PaintQuality.Normal)

func LinePath.lineTo [src]

Add a line from the previous point to pt.

func lineTo(using self, x, y: f32)

func LinePath.opDrop [src]

func opDrop(using self)

func LinePath.opPostCopy [src]

func opPostCopy(using self)

func LinePath.setArc [src]

Initialize the path with an arc.

func setArc(using self, centerX, centerY: f32, radius: f32, startAngle, endAngle: Math.Angle)

func LinePath.setCircle [src]

Initialize the path with a circle.

func setCircle(using self, centerX, centerY: f32, radius: f32)

func LinePath.setEllipse [src]

Initialize the path with an ellipse.

func setEllipse(using self, centerX, centerY: f32, radiusX, radiusY: f32)

func LinePath.setRect [src]

Initialize the path with a rectangle.

func setRect(using self, left, top, width, height: f32)

func LinePath.setRoundRect [src]

Initialize the path with a round rectangle.

func setRoundRect(using self, left, top, width, height: f32, radiusX, radiusY: f32)

func LinePath.start [src]

Reset the path.

func start(using self, startX, startY: f32)

struct Pixel.LinePathList [src]

paths Core.Array'(*Pixel.LinePath)
bvMin Core.Math.Vector2
bvMax Core.Math.Vector2

Functions

clean Clean all paths They must before be flattened.
clear Remove all internal line paths.
count
flatten Flatten all paths.
newPath Returns a new path.
offset(self, f32) Call fast offset on all paths They must before be flattened.
offset(self, f32, JoinStyle, f32) Call quality offset on all paths They must before be flattened.

Special Functions

opDrop
opPostCopy

func LinePathList.clean [src]

Clean all paths They must before be flattened.

func clean(using self)

func LinePathList.clear [src]

Remove all internal line paths.

func clear(using self)

func LinePathList.count [src]

func count(using self)->u64

func LinePathList.flatten [src]

Flatten all paths.

func flatten(using self, quality: PaintQuality)

func LinePathList.newPath [src]

Returns a new path.

func newPath(using self)->*LinePath

func LinePathList.offset [src]

Call fast offset on all paths They must before be flattened.

func offset(using self, value: f32)

Call quality offset on all paths They must before be flattened.

func offset(using self, value: f32, joinStyle: JoinStyle, toler: f32 = 0.5)

func LinePathList.opDrop [src]

func opDrop(using self)

func LinePathList.opPostCopy [src]

func opPostCopy(using self)

struct Pixel.NativeRenderOgl [src]

Functions

createContext(self, HDC, s32, s32, HGLRC)
createContext(self, HWND, s32, s32, HGLRC)
dropContext
setCurrentContext
swapBuffers

func NativeRenderOgl.createContext [src]

func createContext(using self, hWnd: HWND, width, height: s32, mainRC: HGLRC = null)->RenderingContext throw func createContext(using self, hdc: HDC, width, height: s32, mainRC: HGLRC = null)->RenderingContext throw

func NativeRenderOgl.dropContext [src]

func dropContext(using self, rc: RenderingContext)

func NativeRenderOgl.setCurrentContext [src]

func setCurrentContext(using self, rc: RenderingContext)

func NativeRenderOgl.swapBuffers [src]

func swapBuffers(using self, rc: RenderingContext)

enum Pixel.PaintParams [src]

Zero
Antialiased
Default

enum Pixel.PaintQuality [src]

Draft
Normal

struct Pixel.PaintState [src]

paintParams PaintParams
paintQuality PaintQuality
transform Core.Math.Transform2
blendingMode BlendingMode
interpolationMode InterpolationMode
clippingRect Core.Math.Rectangle
stackClipRect Core.Array'(Core.Math.Rectangle)
clippingRectOn bool
colorMask ColorMask

struct Pixel.Painter [src]

commandBuffer Core.Array'(Pixel.Command)
vertexBuffer Core.Array'(Pixel.VertexLayout)
triangulateIdx Core.Array'(s32)
fake bool
sharedSolidPen Pen
sharedSolidBrush Brush
sharedLinePath LinePath
sharedLinePathList LinePathList
sharedRoundTmp Core.Array'({factor:f32,pos:Core.Math.Vector2})
curState PaintState
stackState Core.Array'(Pixel.PaintState)
stackTransform Core.Array'(Core.Math.Transform2)
lastTexture0Type BrushType
tess Poly2Tri.Tessellate
stackRT Core.Array'(*Pixel.RenderTarget)
curRT *RenderTarget
lastTexture0Handle TextureHandle
hasTextureFont bool
drawingBegin bool
overlapMode bool
canSetTexture0 bool

Functions

addParams
begin Call this before drawing.
bindRenderTarget Bind a render target.
capStyleExtent Returns the extent in both directions of a given LineCapStyle.
clear Clear the rendering surface.
computeLayout Recompute the layout for a given rectangle.
drawArc(self, f32, f32, f32, const &Angle, const &Angle, const &Color, f32) Draw an arc between two angles.
drawArc(self, f32, f32, f32, const &Angle, const &Angle, const &Pen)
drawCircle(self, f32, f32, f32, const &Color, f32) Draw an empty circle.
drawCircle(self, f32, f32, f32, const &Pen)
drawEllipse(self, const &Rectangle, const &Color, f32)
drawEllipse(self, const &Rectangle, const &Pen)
drawEllipse(self, f32, f32, f32, f32, const &Color, f32) Draw an empty ellipse.
drawEllipse(self, f32, f32, f32, f32, const &Pen)
drawLine(self, const &Vector2, const &Vector2, const &Pen) Draw a line.
drawLine(self, f32, f32, f32, f32, const &Color, f32)
drawLine(self, f32, f32, f32, f32, const &Pen)
drawPath(self, *LinePath, const &Color, f32) Draw a line path.
drawPath(self, *LinePath, const &Pen)
drawPath(self, *LinePathList, const &Color, f32, DrawPathListMode)
drawPath(self, *LinePathList, const &Pen, DrawPathListMode) Draw a list of paths.
drawRect(self, const &Rectangle, const &Color, f32)
drawRect(self, const &Rectangle, const &Pen)
drawRect(self, f32, f32, f32, f32, const &Color, f32) Draw an empty rectangle.
drawRect(self, f32, f32, f32, f32, const &Pen)
drawRichString Draw a rich string.
drawRoundRect(self, const &Rectangle, f32, f32, const &Color, f32)
drawRoundRect(self, const &Rectangle, f32, f32, const &Pen)
drawRoundRect(self, f32, f32, f32, f32, f32, f32, const &Color, f32) Draw an empty round rectangle.
drawRoundRect(self, f32, f32, f32, f32, f32, f32, const &Pen)
drawString(self, f32, f32, string, *Font, const &Brush, UnderlineStyle, f32) Draw a simple string.
drawString(self, f32, f32, string, *Font, const &Color, UnderlineStyle, f32) Draw a simple string.
drawStringCenter Draw a simple string (centered).
drawTexture(self, const &Rectangle, const &Rectangle, const &Texture, const &Color)
drawTexture(self, const &Rectangle, const &Texture, const &Color)
drawTexture(self, f32, f32, const &Rectangle, const &Texture, const &Color)
drawTexture(self, f32, f32, const &Texture, const &Color)
drawTexture(self, f32, f32, f32, f32, const &Rectangle, const &Texture, const &Color) Draw a portion of an image.
drawTexture(self, f32, f32, f32, f32, const &Texture, const &Color) Draw a texture image.
end Call this after drawing.
endClippingRegion Stop painting in the clipping buffer. Back to normal.
fillCircle(self, f32, f32, f32, const &Brush) Draw a solid circle.
fillCircle(self, f32, f32, f32, const &Color)
fillEllipse(self, const &Rectangle, const &Brush)
fillEllipse(self, const &Rectangle, const &Color)
fillEllipse(self, f32, f32, f32, f32, const &Brush) Draw a solid ellipse.
fillEllipse(self, f32, f32, f32, f32, const &Color)
fillPath(self, *LinePath, const &Brush)
fillPath(self, *LinePath, const &Color)
fillPath(self, *LinePathList, const &Brush) Fill a list of paths.
fillPath(self, *LinePathList, const &Color) Fill a list of paths.
fillPolygon(self, *LinePath, const &Brush) Fill the polygon with the given brush.
fillPolygon(self, *LinePath, const &Color) Fill the polygon with the given color.
fillRect(self, const &Rectangle, const &Brush)
fillRect(self, const &Rectangle, const &Color)
fillRect(self, f32, f32, f32, f32, const &Brush) Draw a filled rectangle.
fillRect(self, f32, f32, f32, f32, const &Color)
fillRoundRect(self, const &Rectangle, f32, f32, const &Brush)
fillRoundRect(self, const &Rectangle, f32, f32, const &Color)
fillRoundRect(self, f32, f32, f32, f32, f32, f32, const &Brush) Draw a filled round rectangle.
fillRoundRect(self, f32, f32, f32, f32, f32, f32, const &Color)
getClippingRect Get the current clipping rectangle.
getGlyphs(const &Array'(rune), *Font) Returns all the glyphs for a given string and font.
getGlyphs(string, *Font) Returns all the glyphs for a given string and font.
getParams
getQuality
getTransform Returns the current tranformation.
isEmptyClippingRect Returns true if the current clipping rectangle is empty (no drawing !).
measureRune Get a rune size for a given font.
measureString(const &Array'(const *GlyphDesc)) Returns the bounding rectangle of a given text, at a given position.
measureString(string, *Font) Returns the metrics of a given text.
popClippingRect Restore the original clipping rectangle.
popState Restore the last paint state.
popTransform Restore the pushed transformation.
pushClippingRect Interface the given rectangle with the current clipping rectangle.
pushClippingSurfaceRect Interface the given rectangle with the current clipping rectangle.
pushState Save the current paint state.
pushTransform Push the current transformation.
releaseRenderTarget Release the render target.
removeParams
resetClippingRect Reset the current clipping rectangle.
resetClippingRegion Reset clipping buffer to its default value (no more clipping).
resetState Reset the current painting state.
resetTransform Reset the paint position, rotation, scale.
rotateTransform(self, const &Angle) Set the paint rotation.
rotateTransform(self, const &Angle, f32, f32) Set the paint rotation.
rotateTransformInPlace Set the paint rotation.
scaleTransform Set the paint scale.
setAntialiased Set antialiased mode on/off.
setBlendingMode Set the current blending mode.
setClippingRect(self, const &Rectangle) Set the current clipping rectangle.
setClippingRect(self, f32, f32, f32, f32) Set the current clipping rectangle.
setClippingRegionMode Set the clipping region mode.
setColorMask(self, bool, bool, bool, bool) Set color mask.
setColorMask(self, const &ColorMask) Set color mask.
setColorMaskAlpha
setColorMaskColor
setColorMaskFull
setInterpolationMode Set the texture interpolation mode.
setParams Set the paint parameters.
setQuality Set the paint quality.
setShader Set the current shader.
setShaderParam(self, ShaderParamHandle, f32) Set a shader parameter.
setShaderParam(self, ShaderParamHandle, s32) Set a shader parameter.
setState Set the current painting state.
setTransform Set the paint transformation.
startClippingRegion Start painting in the clipping buffer.
translateTransform Set the paint position.
unbindRenderTarget Bind a render target.

func Painter.addParams [src]

func addParams(using self, add: PaintParams)

func Painter.begin [src]

Call this before drawing.

func begin(using self)

func Painter.bindRenderTarget [src]

Bind a render target.

func bindRenderTarget(using self, tgt: *RenderTarget, paintAlpha = false)

func Painter.capStyleExtent [src]

Returns the extent in both directions of a given LineCapStyle.

func capStyleExtent(capStyle: LineCapStyle, lineSize, capScale: f32)->{w:f32,l:f32}
  • lineSize is the supposed line drawing size
  • capScale is the supposed LineCapStyle scale

Returns the width and the length.

func Painter.clear [src]

Clear the rendering surface.

func clear(using self, color: Color)

func Painter.computeLayout [src]

Recompute the layout for a given rectangle.

func computeLayout(using self, pos: Math.Rectangle, text: *RichString, format: RichStringFormat)

func Painter.drawArc [src]

Draw an arc between two angles.

func drawArc(using self, centerX, centerY: f32, radius: f32, startAngle, endAngle: Math.Angle, color: Color, penSize: f32 = 1) func drawArc(using self, centerX, centerY: f32, radius: f32, startAngle, endAngle: Math.Angle, pen: Pen)

func Painter.drawCircle [src]

Draw an empty circle.

func drawCircle(using self, centerX, centerY: f32, radius: f32, color: Color, penSize: f32 = 1) func drawCircle(using self, centerX, centerY: f32, radius: f32, pen: Pen)

func Painter.drawEllipse [src]

Draw an empty ellipse.

func drawEllipse(using self, centerX, centerY: f32, radiusX, radiusY: f32, color: Color, penSize: f32 = 1) func drawEllipse(using self, centerX, centerY: f32, radiusX, radiusY: f32, pen: Pen) func drawEllipse(using self, rect: Math.Rectangle, color: Color, penSize: f32 = 1) func drawEllipse(using self, rect: Math.Rectangle, pen: Pen)

func Painter.drawLine [src]

Draw a line.

func drawLine(using self, start, end: Math.Vector2, pen: Pen) func drawLine(using self, startX, startY, endX, endY: f32, color: Color, penSize: f32 = 1) func drawLine(using self, startX, startY, endX, endY: f32, pen: Pen)

func Painter.drawPath [src]

Draw a line path.

func drawPath(using self, path: *LinePath, color: Color, penSize: f32) func drawPath(using self, path: *LinePath, pen: Pen)

Draw a list of paths.

func drawPath(using self, pathList: *LinePathList, pen: Pen, mode: DrawPathListMode = .Separate) func drawPath(using self, pathList: *LinePathList, color: Color, penSize: f32, mode: DrawPathListMode = .Separate)

func Painter.drawRect [src]

Draw an empty rectangle.

func drawRect(using self, left, top, width, height: f32, color: Color, penSize: f32 = 1) func drawRect(using self, rect: Math.Rectangle, color: Color, penSize: f32 = 1) func drawRect(using self, left, top, width, height: f32, pen: Pen) func drawRect(using self, rect: Math.Rectangle, pen: Pen)

func Painter.drawRichString [src]

Draw a rich string.

func drawRichString(using self, pos: Math.Rectangle, text: *RichString, format: RichStringFormat, forceCompute = false)

A rich string can be multiline, and accepts internal formats. The layout will be computed at the first call, and each time pos has changed.

func Painter.drawRoundRect [src]

Draw an empty round rectangle.

func drawRoundRect(using self, left, top, width, height: f32, radiusX, radiusY: f32, color: Color, penSize: f32 = 1) func drawRoundRect(using self, left, top, width, height: f32, radiusX, radiusY: f32, pen: Pen) func drawRoundRect(using self, rect: Math.Rectangle, radiusX, radiusY: f32, pen: Pen) func drawRoundRect(using self, rect: Math.Rectangle, radiusX, radiusY: f32, color: Color, penSize: f32 = 1)

func Painter.drawString [src]

Draw a simple string.

func drawString(using self, left, top: f32, text: string, font: *Font, color: Color, under = UnderlineStyle.None, zoom = 1.0) func drawString(using self, left, top: f32, text: string, font: *Font, brush: Brush, under = UnderlineStyle.None, zoom = 1.0)

func Painter.drawStringCenter [src]

Draw a simple string (centered).

func drawStringCenter(using self, x, y: f32, text: string, font: *Font, color: Color, under = UnderlineStyle.None, zoom = 1.0)

func Painter.drawTexture [src]

Draw a texture image.

func drawTexture(using self, x, y, width, height: f32, texture: Texture, color: Color = Argb.White) func drawTexture(using self, rect: Math.Rectangle, texture: Texture, color: Color = Argb.White) func drawTexture(using self, x, y: f32, texture: Texture, color: Color = Argb.White)

Draw a portion of an image.

func drawTexture(using self, x, y, width, height: f32, srcRect: Math.Rectangle, texture: Texture, color: Color = Argb.White) func drawTexture(using self, dstRect, srcRect: Math.Rectangle, texture: Texture, color: Color = Argb.White) func drawTexture(using self, x, y: f32, srcRect: Math.Rectangle, texture: Texture, color: Color = Argb.White)

func Painter.end [src]

Call this after drawing.

func end(using self)

func Painter.endClippingRegion [src]

Stop painting in the clipping buffer. Back to normal.

func endClippingRegion(using self)

func Painter.fillCircle [src]

Draw a solid circle.

func fillCircle(using self, centerX, centerY: f32, radius: f32, brush: Brush) func fillCircle(using self, centerX, centerY: f32, radius: f32, color: Color)

func Painter.fillEllipse [src]

Draw a solid ellipse.

func fillEllipse(using self, centerX, centerY: f32, radiusX, radiusY: f32, brush: Brush) func fillEllipse(using self, centerX, centerY: f32, radiusX, radiusY: f32, color: Color) func fillEllipse(using self, rect: Math.Rectangle, brush: Brush) func fillEllipse(using self, rect: Math.Rectangle, color: Color)

func Painter.fillPath [src]

Fill a list of paths.

func fillPath(using self, pathList: *LinePathList, color: Color) func fillPath(using self, path: *LinePath, brush: Brush) func fillPath(using self, path: *LinePath, color: Color)

Fill a list of paths.

func fillPath(using self, pathList: *LinePathList, brush: Brush)

If the path is clockwise, it will be filled. If the path is anti-clockwise, it will be considered as a hole.

func Painter.fillPolygon [src]

Fill the polygon with the given color.

func fillPolygon(using self, path: *LinePath, color: Color)

Fill the polygon with the given brush.

func fillPolygon(using self, path: *LinePath, brush: Brush)

func Painter.fillRect [src]

Draw a filled rectangle.

func fillRect(using self, left, top, width, height: f32, brush: Brush) func fillRect(using self, rect: Math.Rectangle, brush: Brush) func fillRect(using self, left, top, width, height: f32, color: Color) func fillRect(using self, rect: Math.Rectangle, color: Color)

func Painter.fillRoundRect [src]

Draw a filled round rectangle.

func fillRoundRect(using self, left, top, width, height: f32, radiusX, radiusY: f32, brush: Brush) func fillRoundRect(using self, rect: Math.Rectangle, radiusX, radiusY: f32, brush: Brush) func fillRoundRect(using self, left, top, width, height: f32, radiusX, radiusY: f32, color: Color) func fillRoundRect(using self, rect: Math.Rectangle, radiusX, radiusY: f32, color: Color)

func Painter.getClippingRect [src]

Get the current clipping rectangle.

func getClippingRect(using self)->Core.Math.Rectangle

func Painter.getGlyphs [src]

Returns all the glyphs for a given string and font.

func getGlyphs(text: string, font: *Font)->Core.Array'(const *Pixel.GlyphDesc) func getGlyphs(text: Array'rune, font: *Font)->Core.Array'(const *Pixel.GlyphDesc)

func Painter.getParams [src]

func getParams(using self)->PaintParams

func Painter.getQuality [src]

func getQuality(using self)->PaintQuality

func Painter.getTransform [src]

Returns the current tranformation.

func getTransform(using self)->Core.Math.Transform2

func Painter.isEmptyClippingRect [src]

Returns true if the current clipping rectangle is empty (no drawing !).

func isEmptyClippingRect(using self)->bool

func Painter.measureRune [src]

Get a rune size for a given font.

func measureRune(c: rune, font: *Font)->Core.Math.Point

func Painter.measureString [src]

Returns the metrics of a given text.

func measureString(text: string, font: *Font)->StringMetrics

Returns the bounding rectangle of a given text, at a given position.

func measureString(text: Array'(const *GlyphDesc))->Pixel.StringMetrics

func Painter.popClippingRect [src]

Restore the original clipping rectangle.

func popClippingRect(using self)

func Painter.popState [src]

Restore the last paint state.

func popState(using self)

func Painter.popTransform [src]

Restore the pushed transformation.

func popTransform(using self)

func Painter.pushClippingRect [src]

Interface the given rectangle with the current clipping rectangle.

func pushClippingRect(using self, rect: Rectangle, isSurfacePos = false)

func Painter.pushClippingSurfaceRect [src]

Interface the given rectangle with the current clipping rectangle.

func pushClippingSurfaceRect(using self, rect: Rectangle)

func Painter.pushState [src]

Save the current paint state.

func pushState(using self)

func Painter.pushTransform [src]

Push the current transformation.

func pushTransform(using self)

func Painter.releaseRenderTarget [src]

Release the render target.

func releaseRenderTarget(using self, tgt: *RenderTarget)

func Painter.removeParams [src]

func removeParams(using self, remove: PaintParams)

func Painter.resetClippingRect [src]

Reset the current clipping rectangle.

func resetClippingRect(using self)

func Painter.resetClippingRegion [src]

Reset clipping buffer to its default value (no more clipping).

func resetClippingRegion(using self)

func Painter.resetState [src]

Reset the current painting state.

func resetState(using self)

func Painter.resetTransform [src]

Reset the paint position, rotation, scale.

func resetTransform(using self)

func Painter.rotateTransform [src]

Set the paint rotation.

func rotateTransform(using self, angle: Math.Angle) func rotateTransform(using self, angle: Math.Angle, centerX, centerY: f32)

func Painter.rotateTransformInPlace [src]

Set the paint rotation.

func rotateTransformInPlace(using self, angle: Math.Angle)

Will rotate around the current transformation position.

func Painter.scaleTransform [src]

Set the paint scale.

func scaleTransform(using self, x, y: f32)

func Painter.setAntialiased [src]

Set antialiased mode on/off.

func setAntialiased(using self, aa = true)

func Painter.setBlendingMode [src]

Set the current blending mode.

func setBlendingMode(using self, mode: BlendingMode)

func Painter.setClippingRect [src]

Set the current clipping rectangle.

func setClippingRect(using self, x, y, width, height: f32) func setClippingRect(using self, rect: Rectangle)

func Painter.setClippingRegionMode [src]

Set the clipping region mode.

func setClippingRegionMode(using self, mode: ClippingMode)

func Painter.setColorMask [src]

Set color mask.

func setColorMask(using self, cm: ColorMask) func setColorMask(using self, r, g, b, a: bool)

func Painter.setColorMaskAlpha [src]

func setColorMaskAlpha(using self)

func Painter.setColorMaskColor [src]

func setColorMaskColor(using self)

func Painter.setColorMaskFull [src]

func setColorMaskFull(using self)

func Painter.setInterpolationMode [src]

Set the texture interpolation mode.

func setInterpolationMode(using self, mode: InterpolationMode)

func Painter.setParams [src]

Set the paint parameters.

func setParams(using self, add: PaintParams, remove: PaintParams = .Zero)

func Painter.setQuality [src]

Set the paint quality.

func setQuality(using self, quality: PaintQuality)

func Painter.setShader [src]

Set the current shader.

func setShader(using self, shader: *ShaderBase = null)

func Painter.setShaderParam [src]

Set a shader parameter.

func setShaderParam(using self, param: ShaderParamHandle, val: s32) func setShaderParam(using self, param: ShaderParamHandle, val: f32)

func Painter.setState [src]

Set the current painting state.

func setState(using self, state: PaintState)

func Painter.setTransform [src]

Set the paint transformation.

func setTransform(using self, tr: Transform2)

func Painter.startClippingRegion [src]

Start painting in the clipping buffer.

func startClippingRegion(using self, mode = ClippingMode.Set)

func Painter.translateTransform [src]

Set the paint position.

func translateTransform(using self, x, y: f32)

func Painter.unbindRenderTarget [src]

Bind a render target.

func unbindRenderTarget(using self)

struct Pixel.Pen [src]

size f32
brush Brush
pattern Core.Array'(f32)
dashBeginCapStyle DashCapStyle
dashEndCapStyle DashCapStyle
borderPos BorderPos
capStartScaleX f32
capStartScaleY f32
capEndScaleX f32
capEndScaleY f32
joinMiterLimit f32
plotOffset f32
dashStyle DashStyle
beginCapStyle LineCapStyle
endCapStyle LineCapStyle
joinStyle JoinStyle

Functions

createDash Returns a dash pen.
createHatch Return a predefined hatch pen.
createSolid Returns a solid color pen.

func Pen.createDash [src]

Returns a dash pen.

func createDash(style: DashStyle, color: Color, size: f32 = 1)->Pen

func Pen.createHatch [src]

Return a predefined hatch pen.

func createHatch(type: HatchStyle, color: Color, size: f32 = 1)->Pen

func Pen.createSolid [src]

Returns a solid color pen.

func createSolid(color: Color, size: f32 = 1)->Pen

enum Pixel.PixelFormat [src]

Desribe the layout format of one image pixel.

BGR8
BGRA8
RGB8
RGBA8

func PixelFormat.bitDepth [src]

Returns the bit depth of each channel.

func bitDepth(self)->u8

func PixelFormat.bpp [src]

Returns the bpp (bits per pixel) of the given pixel format.

func bpp(self)->u8

func PixelFormat.channels [src]

Returns the number of image channels.

func channels(self)->u8

func PixelFormat.hasAlpha [src]

Returns true if the given pixel format has an alpha channel.

func hasAlpha(self)->bool

namespace Pixel.Png

Structs

Decoder
EncodeOptions
Encoder

struct Png.Decoder [src]

func IImageDecoder.canDecode [src]

func canDecode(using self, fileName: string)->bool

func IImageDecoder.decode [src]

func decode(using self, buffer: const [..] u8, options: DecodeOptions)->Image throw

struct Png.EncodeOptions [src]

compressionLevel Core.Compress.Deflate.CompressionLevel
filtering bool

struct Png.Encoder [src]

func IImageEncoder.canEncode [src]

func canEncode(using self, fileName: string)->bool

func IImageEncoder.encode [src]

func encode(using self, result: *ConcatBuffer, image: Image, options: any) throw

namespace Pixel.Poly2Tri

Structs

Edge
Point
Result
Tessellate
Triangle

struct Poly2Tri.Edge [src]

p *Poly2Tri.Point
q *Poly2Tri.Point

struct Poly2Tri.Point [src]

using v Core.Math.Vector2
edges Core.Array'(*Pixel.Poly2Tri.Edge)
border [2] *Poly2Tri.Edge

struct Poly2Tri.Result [src]

triangles Core.Array'(*Pixel.Poly2Tri.Triangle)
edges Core.Array'(*Pixel.Poly2Tri.Edge)
points Core.Array'(*Pixel.Poly2Tri.Point)
triIndices Core.Array'(u64)
tess *Poly2Tri.Tessellate

struct Poly2Tri.Tessellate [src]

Functions

addPoint Register a new point.
addPolyLine Register a polygon as a polyline.
clear Clear content.
endPolyLine To call to register the polyline.
getResult Get the triangulation result.
startPolyLine To call before adding a polyline.
triangulate Triangulate.

Special Functions

opDrop

func Tessellate.addPoint [src]

Register a new point.

func addPoint(using self, pt: Math.Vector2)

func Tessellate.addPolyLine [src]

Register a polygon as a polyline.

func addPolyLine(using self, poly: Polygon)

func Tessellate.clear [src]

Clear content.

func clear(using self)

func Tessellate.endPolyLine [src]

To call to register the polyline.

func endPolyLine(using self)

The polyline registration should have been done before with [[startPolyline]]

func Tessellate.getResult [src]

Get the triangulation result.

func getResult(using self)->Poly2Tri.Result

func Tessellate.opDrop [src]

func opDrop(using self)

func Tessellate.startPolyLine [src]

To call before adding a polyline.

func startPolyLine(using self)

A polyline is a polygon border. See [[addPoint]] and [[endPolyLine]]

func Tessellate.triangulate [src]

Triangulate.

func triangulate(using self)

struct Poly2Tri.Triangle [src]

constrainedEdge [3] bool
delaunayEdge [3] bool
points [3] *Poly2Tri.Point
neighbors [3] *Poly2Tri.Triangle
idx u64
interior bool

struct Pixel.Polygon [src]

points Core.Array'(Core.Math.Vector2)
isClockwise bool
isConvex bool
area f32
totalLen f32
bvMin Core.Math.Vector2
bvMax Core.Math.Vector2

Functions

add Add a new point.
clean Clean polygon by removing bad/unecessary points.
clear Clear all points.
compute Compute internal values, like convex/clockwise Call it once the polygon contains all its points.
getClean Clean polygon by removing bad/unecessary points.
getOffset Slow but quality offset with a joinStyle.
getPoint(self, u64) Get the given point.
getPoint(self, u64, f32) Get the given point, with an optional offset.
getPoint(self, u64)
normalizeDist Divide by adding points if two points are too far away.
offset(self, f32) Fast expand polygon by a given amount.
offset(self, f32, JoinStyle, f32) Slow but quality offset with a joinStyle.

func Polygon.add [src]

Add a new point.

func add(using self, v: Vector2)

func Polygon.clean [src]

Clean polygon by removing bad/unecessary points.

func clean(using self)

func Polygon.clear [src]

Clear all points.

func clear(using self)

func Polygon.compute [src]

Compute internal values, like convex/clockwise Call it once the polygon contains all its points.

func compute(using self)

func Polygon.getClean [src]

Clean polygon by removing bad/unecessary points.

func getClean(using self)->LinePathList

func Polygon.getOffset [src]

Slow but quality offset with a joinStyle.

func getOffset(using self, value: f32, joinStyle: JoinStyle, toler: f32 = 0.5)->LinePathList

func Polygon.getPoint [src]

Get the given point.

func getPoint(using self, i: u64)->&Core.Math.Vector2 func getPoint(using const self, i: u64)->const &Core.Math.Vector2

Get the given point, with an optional offset.

func getPoint(using self, i: u64, offset: f32)->Core.Math.Vector2

func Polygon.normalizeDist [src]

Divide by adding points if two points are too far away.

func normalizeDist(using self, dist: f32, closed: bool = true)

func Polygon.offset [src]

Fast expand polygon by a given amount.

func offset(using self, value: f32)

Slow but quality offset with a joinStyle.

func offset(using self, value: f32, joinStyle: JoinStyle, toler: f32 = 0.5)

struct Pixel.RenderOgl [src]

using native NativeRenderOgl
vertexbuffer Ogl.GLuint
shaderSimple ShaderSimple
shaderAA ShaderAA
shaderBlur ShaderBlur
shaderFont ShaderFont
worldTransform Core.Math.Transform2
orthoMatrix Core.Math.Matrix4x4
modelMatrix Core.Math.Matrix4x4
whiteTexture Ogl.GLuint
hatchTextures [36] Ogl.GLuint
blendingMode BlendingMode
curRC RenderingContext
stackReleasedRT Core.Array'(*Pixel.RenderTarget)
stackRT Core.Array'(*Pixel.RenderTarget)
curRT *RenderTarget
curShader *ShaderBase
overlapMode bool

Functions

addImage(self, const &Image) Register an image for rendering.
addImage(self, string) Load and register an image for rendering.
begin To be called before rendering.
bindRenderTarget Set the current render target.
clear Clear current render buffers.
computeMatrices
createRenderTarget Create a render target.
createShader Create the given shader.
deleteRenderTarget Delete a render target.
draw Draw the given painter.
end To be called after rendering.
getRenderTarget Get a render target of the given size releaseRenderTarget must be called to release it.
getTargetSize Get the actual render target size.
getTexturePixels Returns the pixels associated to a texture.
init First init.
pixelFormatToNative
releaseRenderTarget Release the given render target.
removeTexture Unregister a texture created with addImage.
resetScissorRect Reset the scissor.
resetTransform Reset the world transform.
rotateTransform(self, const &Angle) Rotate the world transform.
rotateTransform(self, const &Angle, f32, f32) Rotate the world transform.
scaleTransform Scale the world transform.
setCurrentContext Set the current rendering context.
setScissorRect Force the scissor.
setShader Set the current shader.
translateTransform Translate the world transform.
unbindRenderTarget Go back to the previous render target, or frame buffer.
unbindRenderTargetToImage Get current render target pixels.
updateTexture Update content of texture.

Special Functions

opDrop

func RenderOgl.addImage [src]

Load and register an image for rendering.

func addImage(using self, fullName: string)->Texture throw

Register an image for rendering.

func addImage(using self, image: Image)->Texture

func RenderOgl.begin [src]

To be called before rendering.

func begin(using self, rc: RenderingContext)

func RenderOgl.bindRenderTarget [src]

Set the current render target.

func bindRenderTarget(using self, rt: *RenderTarget, vp: *Math.Rectangle = null)

func RenderOgl.clear [src]

Clear current render buffers.

func clear(using self)

func RenderOgl.computeMatrices [src]

func computeMatrices(using self, mvp, mdl: ShaderParamHandle)

func RenderOgl.createRenderTarget [src]

Create a render target.

func createRenderTarget(using self, w, h: s32)->RenderTarget

func RenderOgl.createShader [src]

Create the given shader.

func createShader(using self, base: *ShaderBase, vertex, pixel: const [..] u8) throw

func RenderOgl.deleteRenderTarget [src]

Delete a render target.

func deleteRenderTarget(using self, rt: *RenderTarget)

func RenderOgl.draw [src]

Draw the given painter.

func draw(using self, dc: *Painter)

func RenderOgl.end [src]

To be called after rendering.

func end(using self)

func RenderOgl.getRenderTarget [src]

Get a render target of the given size releaseRenderTarget must be called to release it.

func getRenderTarget(using self, w, h: s32)->*RenderTarget

func RenderOgl.getTargetSize [src]

Get the actual render target size.

func getTargetSize(using self)->{width:s32,height:s32}

func RenderOgl.getTexturePixels [src]

Returns the pixels associated to a texture.

func getTexturePixels(using self, texture: Texture, pf: PixelFormat)->Core.Array'(u8)

func RenderOgl.init [src]

First init.

func init(using self)

func RenderOgl.opDrop [src]

func opDrop(using self)

func RenderOgl.pixelFormatToNative [src]

func pixelFormatToNative(pf: PixelFormat)->Ogl.GLenum

func RenderOgl.releaseRenderTarget [src]

Release the given render target.

func releaseRenderTarget(using self, tgt: *RenderTarget)

func RenderOgl.removeTexture [src]

Unregister a texture created with addImage.

func removeTexture(using self, texture: *Texture)

func RenderOgl.resetScissorRect [src]

Reset the scissor.

func resetScissorRect(using self)

func RenderOgl.resetTransform [src]

Reset the world transform.

func resetTransform(using self)

func RenderOgl.rotateTransform [src]

Rotate the world transform.

func rotateTransform(using self, angle: Math.Angle) func rotateTransform(using self, angle: Math.Angle, centerX, centerY: f32)

func RenderOgl.scaleTransform [src]

Scale the world transform.

func scaleTransform(using self, x, y: f32)

func RenderOgl.setCurrentContext [src]

Set the current rendering context.

func setCurrentContext(using self, rc: RenderingContext)

func RenderOgl.setScissorRect [src]

Force the scissor.

func setScissorRect(using self, rect: Math.Rectangle)

func RenderOgl.setShader [src]

Set the current shader.

func setShader(using self, shader: *ShaderBase = null)

func RenderOgl.translateTransform [src]

Translate the world transform.

func translateTransform(using self, x, y: f32)

func RenderOgl.unbindRenderTarget [src]

Go back to the previous render target, or frame buffer.

func unbindRenderTarget(using self)

func RenderOgl.unbindRenderTargetToImage [src]

Get current render target pixels.

func unbindRenderTargetToImage(using self, x, y, w, h: s32)->Image

func RenderOgl.updateTexture [src]

Update content of texture.

func updateTexture(using self, texture: Texture, pixels: const *u8)

struct Pixel.RenderTarget [src]

handle RenderTargetHandle
colorBuffer Texture
depthStencil RenderTargetSurfaceHandle
paintAlpha bool
paintAlphaIdx u64

struct Pixel.RenderingContext [src]

hDC Win32.HDC
hRC Ogl.HGLRC
width s32
height s32

struct Pixel.RichChunk [src]

slice string
fontStyle FontFamilyStyle
hasFontStyle bool
isSpace bool
isEol bool
isUrl bool
isHotUrl bool
colorIdx s32
boundRect Core.Math.Rectangle
pos Core.Math.Point
font *Font
under UnderlineStyle

struct Pixel.RichString [src]

Represents a string with embedded formats.

raw Core.String The string as passed by the user.
chunks Core.Array'(Pixel.RichChunk) The corresponding list of chunks.
layoutRect Core.Math.Rectangle
boundRect Core.Math.Rectangle
hasUrl bool
dirty bool If dirty, Compute.

This kind of string is a specific version of [Core.String] but specific for painting. It can contains some special markers to change it's appearence.

<b>this is bold</b> <i>this is italic</i> <p1>this will have special color 1</p> <p2>this will have special color 2</p> <p3>this will have special color 3</p> ...

See RichString.set for a list of available markers.

Functions

compute Compute layout.
getNaked Transform the given string to a naked one.
getUrlChunkAt Get the url chunk at position at.
invalidate Force the string to be repainted.
isEmpty Returns true if the string is empty.
set Associate a string.

Special Functions

opAffect
opCount
opEquals
opPostCopy We need to recompute chunks, as they contains slices.

func RichString.compute [src]

Compute layout.

func compute(using self, force = false)

This will transform the string in a serie of chunks, each chunk having its one style. The string will only be recomputed if it's dirty (the text has changed) or if force is true.

func RichString.getNaked [src]

Transform the given string to a naked one.

func getNaked(str: string)->Core.String

Will return the string without the format markers.

func RichString.getUrlChunkAt [src]

Get the url chunk at position at.

func getUrlChunkAt(using self, at: Math.Point)->*RichChunk

If an url does not exists, returns null.

func RichString.invalidate [src]

Force the string to be repainted.

func invalidate(using self)

func RichString.isEmpty [src]

Returns true if the string is empty.

func isEmpty(using self)->bool

func RichString.opAffect [src]

func opAffect(using self, str: string)

func RichString.opCount [src]

func opCount(using self)->u64

func RichString.opEquals [src]

func opEquals(using self, other: string)->bool

func RichString.opPostCopy [src]

We need to recompute chunks, as they contains slices.

func opPostCopy(using self)

func RichString.set [src]

Associate a string.

func set(using self, text: string)

The string can have multiple lines. Accepted markers are:

  • <u> => underline
  • <b> => bold
  • <i> => italic
  • <p1> => color palette 1
  • <p2> => color palette 2
  • <p3> => color palette 3
  • <url> => clickable
<b>this is bold</b> but this is normal <i>and this is italic</i>

struct Pixel.RichStringFormat [src]

font FontFamily
fontStyle FontFamilyStyle
palette [4] Color Color of text between <p?>...<p?> markers.
colorUrl Color Color of text between <url>...<url> markers.
colorHotUrl Color Color of text between <url>...<url> markers when mouse is inside.
brush Brush
horzAlignment StringHorzAlignment
vertAlignment StringVertAlignment
lineGap s32
flags StringFormatFlags

struct Pixel.ShaderAA [src]

using base ShaderBase

struct Pixel.ShaderBase [src]

handle ShaderHandle
mvp ShaderParamHandle
mdl ShaderParamHandle
boundRect ShaderParamHandle
textureRect ShaderParamHandle
uvMode ShaderParamHandle
copyMode ShaderParamHandle
textureW ShaderParamHandle
textureH ShaderParamHandle

struct Pixel.ShaderBlur [src]

using base ShaderBase
radius ShaderParamHandle
axis ShaderParamHandle

struct Pixel.ShaderFont [src]

using base ShaderBase

struct Pixel.ShaderSimple [src]

using base ShaderBase

enum Pixel.StringFormatFlags [src]

Default
WordWrap
Clip
DontAdaptSingleLineHeight

enum Pixel.StringHorzAlignment [src]

Center
Left
Right
Justify

struct Pixel.StringMetrics [src]

ascent f32 Maximum size above baseline.
descent f32 Maximum size below baseline.
width f32
height f32 ascent + descent.

struct Pixel.StringPainter [src]

str RichString
fmt RichStringFormat

Functions

color Set text color.
draw Draw string.
flags Set drawing flags.
font Set font.
horzAlign Set horizontal alignment.
vertAlign Set vertical alignment.

func StringPainter.color [src]

Set text color.

func color(using self, col: Color)

func StringPainter.draw [src]

Draw string.

func draw(using self, painter: *Painter, rect: Math.Rectangle, what: string)

func StringPainter.flags [src]

Set drawing flags.

func flags(using self, f: StringFormatFlags)

func StringPainter.font [src]

Set font.

func font(using self, font: *Font)

func StringPainter.horzAlign [src]

Set horizontal alignment.

func horzAlign(using self, align: StringHorzAlignment)

func StringPainter.vertAlign [src]

Set vertical alignment.

func vertAlign(using self, align: StringVertAlignment)

enum Pixel.StringVertAlignment [src]

Center
Top
Bottom

struct Pixel.Texture [src]

handle TextureHandle
pf PixelFormat
width s32
height s32
valid bool

Functions

getByteSize
isValid

func Texture.getByteSize [src]

func getByteSize(using const self)->s32

func Texture.isValid [src]

func isValid(using const self)->bool

namespace Pixel.Tga

Structs

Decoder
Encoder

struct Tga.Decoder [src]

func IImageDecoder.canDecode [src]

func canDecode(using self, fileName: string)->bool

func IImageDecoder.decode [src]

func decode(using self, buffer: const [..] u8, options: DecodeOptions)->Image throw

struct Tga.Encoder [src]

func IImageEncoder.canEncode [src]

func canEncode(using self, fileName: string)->bool

func IImageEncoder.encode [src]

func encode(using self, result: *ConcatBuffer, image: Image, options: any) throw

struct Pixel.TypeFace [src]

fullname string
buffer Core.Array'(u8)
face FreeType.FT_Face
forceBoldDiv u32
forceItalic bool
forceBold bool

Functions

create Get or create a new typeface from a memory buffer.
createFromHFONT Create a new typeface from a HFONT.
getFamilyName Returns the underlying font family name.
getRuneOutline Convert a rune to its outline, at a given size.
getStringOutline Convert a string to its outline, at a given size.
isBold Returns true if the typeface is bold.
isItalic Returns true if the typeface is italic.
load Get or load a new typeface.
release Release the given typeface.
renderGlyph Render one glyph.

func TypeFace.create [src]

Get or create a new typeface from a memory buffer.

func create(fullname: string, bytes: const [..] u8)->*TypeFace throw

func TypeFace.createFromHFONT [src]

Create a new typeface from a HFONT.

func createFromHFONT(fullname: string, hf: HFONT)->*TypeFace throw

func TypeFace.getFamilyName [src]

Returns the underlying font family name.

func getFamilyName(using const self)->string

func TypeFace.getRuneOutline [src]

Convert a rune to its outline, at a given size.

func getRuneOutline(using self, pathList: *LinePathList, c: rune, size: u32, embolden: u32 = 0)->f32 throw

func TypeFace.getStringOutline [src]

Convert a string to its outline, at a given size.

func getStringOutline(using self, pathList: *LinePathList, text: string, size: u32, embolden: u32 = 0) throw

func TypeFace.isBold [src]

Returns true if the typeface is bold.

func isBold(using const self)->bool

func TypeFace.isItalic [src]

Returns true if the typeface is italic.

func isItalic(using const self)->bool

func TypeFace.load [src]

Get or load a new typeface.

func load(fullname: string)->*TypeFace throw

func TypeFace.release [src]

Release the given typeface.

func release(typeface: *TypeFace)

func TypeFace.renderGlyph [src]

Render one glyph.

func renderGlyph(using self, c: rune, size: u32, forceBold, forceItalic = false)->const *FreeType.FT_Bitmap throw

enum Pixel.UVMode [src]

Fill
FillSubRect
Tile

enum Pixel.UnderlineStyle [src]

None
Underline
Strikeout

struct Pixel.VertexLayout [src]

pos Core.Math.Vector2
uv Core.Math.Vector2
color u32
aa [12] Core.Math.Vector4
aanum f32
Generated on 08-09-2024 with swag 0.40.0