SWAG

Table of Contents

Namespaces

Structs

image

image/decode

image/encode

image/stats

image/transform

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/stats

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(me, fileName: string)->bool

func IImageDecoder.decode [src]

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

struct Bmp.Encoder [src]

func IImageEncoder.canEncode [src]

func canEncode(me, fileName: string)->bool

func IImageEncoder.encode [src]

func encode(me, 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(me)

enum Pixel.ClippingMode [src]

Set
Clear

struct Pixel.Color [src]

Represents a color with 8-bit ARGB components.

a u8
r u8
g u8
b u8 Blue, green, red, alpha components (0-255).
argb u32 32-bit ARGB representation.

Provides utilities for color creation, conversion, and manipulation.

Functions

add Add colors with clamping.
adjustBrightness Adjust brightness (-1.0 = black, 0.0 = no change, 1.0 = white).
adjustSaturation Adjust saturation (-1.0 = grayscale, 0.0 = no change, 1.0 = full saturation).
ensureContrast Returns a new color adjusted so that its contrast ratio against target meets or exceeds the given requiredContrast (WCAG-compatible).
fromAbgr Create a new Color from u32 ABGR value (reversed byte order).
fromArgb(Argb) Create a new Color from Argb enum value.
fromArgb(u32) Create a new Color from u32 ARGB value.
fromArgb(u8, Argb) Create a new Color from Argb enum value with custom alpha.
fromArgb(u8, u8, u8, u8) Create a new Color with specified ARGB values.
fromArgbf Create a new Color with specified ARGB float values.
fromHsl Create a new Color from HSL values (hue, saturation, lightness).
fromLinear Create a new Color from a linear-light Math.Vector4.
fromRgb Create a new Color with specified RGB values and opaque alpha.
fromRgbf Create a new Color with specified RGB float values and opaque alpha.
fromVector4 Create a new Color from Math.Vector4 (w=alpha, x=red, y=green, z=blue).
generateDistinctColors Generates N visually distinct colors.
getBlend Blend two colors using linear interpolation (including alpha).
getBlendKeepAlpha Blend two colors using linear interpolation, keeping col0s alpha channel.
getComplementary Get complementary color (opposite on color wheel).
getContrastRatio Calculates contrast ratio between this color and another.
getContrasting Get a contrasting color (black or white) for text readability.
getDarker Returns a darker version of the color by blending with black.
getDistanceRgb Calculate the RGB distance between this color and another (normalized to [0, 1]).
getGrayScalef Calculate the perceived brightness using luminance formula.
getGrayscale Convert to grayscale color preserving alpha.
getLighter Returns a lighter version of the color by blending with white.
getRelativeLuminance Calculate the relative luminance (Y) of the color in linear light.
isDark Check if the color is considered "dark" based on luminance.
isLight Check if the color is considered "light" based on luminance.
isOpaque Check if the color is fully opaque.
multiply Multiply color by another color (component-wise).
rotateHue Adjust hue by rotating around the color wheel.
setArgb Set all ARGB components with u8 values (0-255).
setArgbf Set all ARGB components with floats in the range [0, 1].
setHsl Set color from HSL values (hue, saturation, lightness in range [0, 1]).
setRgb(me, const &Color) Copy RGB components from another color.
setRgb(me, u8, u8, u8) Set RGB components with u8 values (0-255).
setRgbf Set RGB components with floats in the range [0, 1].
toArgbf Retrieve all ARGB components as floating point values between 0 and 1.
toHsl Convert color to HSL values (hue, saturation, lightness in range [0, 1]).
toLinear Convert the color to a linear-light Math.Vector4.
toRgbf Retrieve RGB components as floating point values between 0 and 1.
toVector4 Convert color to a Math.Vector4 (w=alpha, x=red, y=green, z=blue).
withAlpha Create a color with modified alpha.
withAlphaf Create a color with modified alpha (float version).

Special Functions

opAffect(me, Argb) Assignment operator for Argb enum value.
opAffect(me, string) Assignment operator for color name string.
opAffect(me, u32) Assignment operator for u32 ARGB value.
opEquals(me, Argb) Equality comparison with Argb enum value.
opEquals(me, const &Color) Equality comparison with another Color.
opEquals(me, u32) Equality comparison with u32 ARGB value.

func IPokeValue.poke [src]

Parse a Color from a string representation.

func poke(me, buf: string)->string throw

Supports hex format (0x...), individual ARGB components, or named colors.

func Color.add [src]

Add colors with clamping.

func add(col0, col1: Color)->Color

func Color.adjustBrightness [src]

Adjust brightness (-1.0 = black, 0.0 = no change, 1.0 = white).

func adjustBrightness(const me, factor: f32)->Color

func Color.adjustSaturation [src]

Adjust saturation (-1.0 = grayscale, 0.0 = no change, 1.0 = full saturation).

func adjustSaturation(const me, factor: f32)->Color

func Color.ensureContrast [src]

Returns a new color adjusted so that its contrast ratio against target meets or exceeds the given requiredContrast (WCAG-compatible).

func ensureContrast(me, target: Color, requiredContrast: f32 = 4.5, step: f32 = 0.02, maxSteps: s32 = 64)

The function iteratively darkens or lightens the color depending on which direction increases contrast most effectively.

  • Parameters:
  • target: The color to contrast against (e.g., foreground or background).
  • requiredContrast: The minimum contrast ratio (default = 4.5 for normal text).
  • step: Brightness adjustment per iteration. Positive values move toward lighter,

negative toward darker; the function automatically picks direction. - maxSteps: Maximum number of iterations (safety cap). - Returns: A new color meeting or exceeding the required contrast ratio.

func Color.fromAbgr [src]

Create a new Color from u32 ABGR value (reversed byte order).

func fromAbgr(abgr: u32)->Color

func Color.fromArgb [src]

Create a new Color with specified ARGB values.

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

Create a new Color from Argb enum value.

func fromArgb(argb: Argb)->Color

Create a new Color from Argb enum value with custom alpha.

func fromArgb(alpha: u8, argb: Argb)->Color

Create a new Color from u32 ARGB value.

func fromArgb(argb: u32)->Color

func Color.fromArgbf [src]

Create a new Color with specified ARGB float values.

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

func Color.fromHsl [src]

Create a new Color from HSL values (hue, saturation, lightness).

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

func Color.fromLinear [src]

Create a new Color from a linear-light Math.Vector4.

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

Components are expected to be normalized in [0, 1]. Performs gamma correction (linear → sRGB) on the RGB channels. Useful for reconstructing an 8-bit Color after doing math in linear space.

func Color.fromRgb [src]

Create a new Color with specified RGB values and opaque alpha.

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

func Color.fromRgbf [src]

Create a new Color with specified RGB float values and opaque alpha.

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

func Color.fromVector4 [src]

Create a new Color from Math.Vector4 (w=alpha, x=red, y=green, z=blue).

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

func Color.generateDistinctColors [src]

Generates N visually distinct colors.

func generateDistinctColors(n: u32, startHue: f32 = 0.113, lum: f32 = 0.44, sat: f32 = 0.68)->Core.Array'(Color)

Uses golden-angle hue spacing to ensure that each color is clearly separated from the others, with slight lightness variation for good contrast against white text.

func Color.getBlend [src]

Blend two colors using linear interpolation (including alpha).

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

func Color.getBlendKeepAlpha [src]

Blend two colors using linear interpolation, keeping col0s alpha channel.

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

func Color.getComplementary [src]

Get complementary color (opposite on color wheel).

func getComplementary(const me)->Color

func Color.getContrastRatio [src]

Calculates contrast ratio between this color and another.

func getContrastRatio(const me, against: Color)->f32

Uses the standard WCAG contrast formula: (l1 + 0.05) / (l2 + 0.05)

func Color.getContrasting [src]

Get a contrasting color (black or white) for text readability.

func getContrasting(const me)->Color

func Color.getDarker [src]

Returns a darker version of the color by blending with black.

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

func Color.getDistanceRgb [src]

Calculate the RGB distance between this color and another (normalized to [0, 1]).

func getDistanceRgb(const me, col: Color)->f32

func Color.getGrayScalef [src]

Calculate the perceived brightness using luminance formula.

func getGrayScalef(const me)->f32

func Color.getGrayscale [src]

Convert to grayscale color preserving alpha.

func getGrayscale(const me)->Color

func Color.getLighter [src]

Returns a lighter version of the color by blending with white.

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

func Color.getRelativeLuminance [src]

Calculate the relative luminance (Y) of the color in linear light.

func getRelativeLuminance(const me)->f32

Uses the linearized RGB values from toLinear() and BT.709 coefficients (WCAG 2.x). Returns a scalar in [0, 1] representing perceived brightness. Formula: Y = 0.2126 * R_lin + 0.7152 * G_lin + 0.0722 * B_lin where R_lin, G_lin, B_lin are the linearized channels. #[Inline, ConstExpr]

func Color.isDark [src]

Check if the color is considered "dark" based on luminance.

func isDark(const me)->bool

func Color.isLight [src]

Check if the color is considered "light" based on luminance.

func isLight(const me)->bool

func Color.isOpaque [src]

Check if the color is fully opaque.

func isOpaque(const me)->bool

func Color.multiply [src]

Multiply color by another color (component-wise).

func multiply(col0, col1: Color)->Color

func Color.opAffect [src]

Assignment operator for u32 ARGB value.

func opAffect(me, argb: u32)

Assignment operator for Argb enum value.

func opAffect(me, argb: Argb)

Assignment operator for color name string.

func opAffect(me, name: string)

func Color.opEquals [src]

Equality comparison with u32 ARGB value.

func opEquals(me, argb: u32)->bool

Equality comparison with Argb enum value.

func opEquals(me, argb: Argb)->bool

Equality comparison with another Color.

func opEquals(me, other: Color)->bool

func Color.rotateHue [src]

Adjust hue by rotating around the color wheel.

func rotateHue(const me, degrees: f32)->Color

func Color.setArgb [src]

Set all ARGB components with u8 values (0-255).

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

func Color.setArgbf [src]

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

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

func Color.setHsl [src]

Set color from HSL values (hue, saturation, lightness in range [0, 1]).

func setHsl(me, h, s, l: f32)

func Color.setRgb [src]

Set RGB components with u8 values (0-255).

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

Alpha will be set to opaque (255).

Copy RGB components from another color.

func setRgb(me, rgb: Color)

Alpha remains unchanged.

func Color.setRgbf [src]

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

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

Alpha will be set to opaque (255).

func Color.toArgbf [src]

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

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

func Color.toHsl [src]

Convert color to HSL values (hue, saturation, lightness in range [0, 1]).

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

func Color.toLinear [src]

Convert the color to a linear-light Math.Vector4.

func toLinear(const me)->Core.Math.Vector4

Components are normalized to [0, 1], with gamma-correct sRGB → linear conversion applied. Useful for rendering, lighting, and blending operations where linear color space is required instead of gamma-encoded sRGB.

func Color.toRgbf [src]

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

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

func Color.toVector4 [src]

Convert color to a Math.Vector4 (w=alpha, x=red, y=green, z=blue).

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

func Color.withAlpha [src]

Create a color with modified alpha.

func withAlpha(const me, alpha: u8)->Color

func Color.withAlphaf [src]

Create a color with modified alpha (float version).

func withAlphaf(const me, alpha: f32)->Color

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
decodeMetaDatas 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'(GlyphAtlas)
asciiRef [128] GlyphDesc
unicodeRef Core.HashTable'(rune, *GlyphDesc)
dirty bool

Functions

clearCaches Clear internal caches.
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.clearCaches [src]

Clear internal caches.

func clearCaches()

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(me, c: rune)->const *GlyphDesc

func Font.opDrop [src]

func opDrop(me)

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'(FontFamilyEnumerate)

func FontFamily.getFont [src]

Get the font corresponding to the style.

func getFont(const me, 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(me, 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(me, fileName: string)->bool

func IImageDecoder.decode [src]

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

func Decoder.getFrame [src]

Create an image for the current frame.

func getFrame(me, 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(me)->s32 throw

func Decoder.init [src]

Initialize the decoder.

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

func Decoder.nextFrame [src]

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

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

func Decoder.rewind [src]

Restart at frame 0.

func rewind(me)

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.
metaDatas Core.Array'(ImageMetaData)
workingBuffer *Image Temporary buffer for filters and transformations.

Functions

addDecoder Register an image decoder.
addEncoder Register an image encoder.
allocPixels Allocate pixels.
allocWorkingBuffer(me) Allocate a computing buffer with current image size.
allocWorkingBuffer(me, 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].
convertToRGBA8 Set pixel values at pixDst depending on pixel format Destination is supped to be in RGBA8 format.
copyPixelDirect Copy one pixel, depending on bpp.
create Creates a new image.
crop(me, const &Rectangle)
crop(me, s32, s32, s32, s32) Crop image.
decode Decode the given image buffer.
evaluateCropScore
expand Crop image.
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
fitToRect Fits the image to fill the target rectangle while maintaining aspect ratio.
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.
getAspectRatio Returns the image aspect ratio.
getPixelColor Returns the color at the given coordinate.
getPixelColorDirect Set pixel values depending on pixel format.
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.
isSquare Returns true if the image is square.
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.
smartCrop
toApplyKernel Apply a kernel to the image.
toCrop(me, const &Rectangle)
toCrop(me, s32, s32, s32, s32) Crop image.
toExpand 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

struct Image.SmartCropSearchOpts [src]

Smart crop search parameters.

minCoverage f32
blurRadius s32
strideFrac f32
thirdsWeight f32
centerWeight f32
shrinkPrior f32
edgePenalty f32
faceWeight f32
maxSearchSteps s32
maxSize s32

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(me)

Pixels will not be initialized.

func Image.allocWorkingBuffer [src]

Allocate a computing buffer with current image size.

func allocWorkingBuffer(me)

Allocate a computing buffer with new sizes.

func allocWorkingBuffer(me, newWidth, newHeight: s32, newPf: PixelFormat)

func Image.applyKernel [src]

Apply a kernel to the image.

func applyKernel(me, kernel: Kernel)

func Image.applyWorkingBuffer [src]

Replace the current image content with the working buffer.

func applyWorkingBuffer(me)

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(me)

func Image.colorize [src]

Colorize the image by setting the hue and saturation.

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

func Image.contrast [src]

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

func contrast(me, factor: f32 = 0.5)

func Image.convertToRGBA8 [src]

Set pixel values at pixDst depending on pixel format Destination is supped to be in RGBA8 format.

func(PF: PixelFormat) convertToRGBA8(pixDst: [*] u8, r, g, b, a: u8)

func Image.copyPixelDirect [src]

Copy one pixel, depending on bpp.

func(BPP: u8) copyPixelDirect(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(me, x, y, w, h: s32) func crop(me, 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.evaluateCropScore [src]

func evaluateCropScore(me, rect: Math.Rectangle, opts: SmartCropSearchOpts = {})->f32

func Image.expand [src]

Crop image.

func expand(me, l, t, r, b: s32, color: Color = Argb.White)

func Image.fade [src]

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

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

func Image.fill [src]

Fill image with color.

func fill(me, color: Color)

func Image.fillGradient2 [src]

Fill with an horizontal gradient from color0 to color1.

func fillGradient2(me, color0, color1: Color)

func Image.fillGradient4 [src]

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

func fillGradient4(me, topLeft, topRight, bottomLeft, bottomRight: Color)

func Image.fillHsl [src]

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

func Image.fitToRect [src]

Fits the image to fill the target rectangle while maintaining aspect ratio.

func fitToRect(me, targetRect: Math.Rectangle)

The image is scaled to cover the entire target area, then cropped to exact dimensions. Uses center cropping to preserve the most important part of the image.

func Image.flip [src]

Flip image vertically.

func flip(me)

func Image.freeWorkingBuffer [src]

Free the working buffer if allocated.

func freeWorkingBuffer(me)

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(me, level: f32 = 2.2)

func Image.getAspectRatio [src]

Returns the image aspect ratio.

func getAspectRatio(const me)->f32

func Image.getPixelColor [src]

Returns the color at the given coordinate.

func getPixelColor(const me, pixX, pixY: s32)->Color

func Image.getPixelColorDirect [src]

Set pixel values depending on pixel format.

func(PF: PixelFormat) getPixelColorDirect(const me, pixX, pixY: s32)->Color

func Image.grayScale [src]

Transform image to grayscale, with a given factor.

func grayScale(me, factor: f32 = 1)

func Image.halfSize [src]

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

func halfSize(me)

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(me, width, height: s32, pf: PixelFormat)

func Image.invert [src]

Invert colors.

func invert(me)

func Image.isSquare [src]

Returns true if the image is square.

func isSquare(const me)->bool

func Image.isValid [src]

Returns true if the image is valid.

func isValid(const me)->bool

func Image.lightness [src]

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

func lightness(me, 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(me)

func Image.mix [src]

Mix with another image.

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

func Image.noise [src]

Fill the image with a noise.

func noise(me, noise: *Noise.FastNoise)

func Image.opDrop [src]

func opDrop(me)

func Image.opPostCopy [src]

func opPostCopy(me)

func Image.opVisit [src]

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

func Image.release [src]

Release the content of the image.

func release(me)

func Image.resize [src]

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

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

func Image.save [src]

Save the image to a file.

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

func Image.setAlpha [src]

Change the alpha channel.

func setAlpha(me, value: u8 = 0)

func Image.setChannel [src]

Change specified color channels.

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

func Image.setPixelFormat [src]

Change image pixel format.

func setPixelFormat(me, newPf: PixelFormat)

func Image.smartCrop [src]

func smartCrop(me, rect: Math.Rectangle, opts: SmartCropSearchOpts = {})

func Image.toApplyKernel [src]

Apply a kernel to the image.

func toApplyKernel(me, kernel: Kernel)->Image

func Image.toCrop [src]

Crop image.

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

func Image.toExpand [src]

Crop image.

func toExpand(const me, l, t, r, b: s32, color: Color = Argb.White)->Image

func Image.toFlip [src]

Flip image vertically.

func toFlip(const me)->Image

func Image.toHICON [src]

Transform an image to a windows icon.

func toHICON(me)->Win32.HICON throw

func Image.toHalfSize [src]

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

func toHalfSize(const me)->Image

func Image.toMirror [src]

Flip image horizontally.

func toMirror(const me)->Image

func Image.toMix [src]

Mix with another image.

func toMix(const me, 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(const me, newWidth, newHeight: s32, mode = ResizeMode.Raw)->Image

func Image.toSetPixelFormat [src]

Change image pixel format.

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

func Image.toTurn [src]

Turn image by a given predefined angle.

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

func Image.turn [src]

Turn image by a given predefined angle.

func turn(me, angle: TurnAngle)

func Image.visitPixels [src]

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

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

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

struct Pixel.ImageMetaData [src]

sig u32
tag Core.Array'(u8)
value Core.Array'(u8)

Functions

isTag Returns true if the metadata has the tag val.
toSlice Convert the value to a slice.

func ImageMetaData.isTag [src]

Returns true if the metadata has the tag val.

func isTag(me, val: const [..] u8)->bool

func ImageMetaData.toSlice [src]

Convert the value to a slice.

func toSlice(me)->const [..] u8

namespace Pixel.ImageStatistics

Structs

HaarFeatures Structure to store Haar coefficients.

Functions

compareHaarCoefficients Compare Haar coefficients with multiscale weights.
extractHaarFeatures Extract Haar coefficients from the image.
haarCompareTo Compare to another image with Haar coefficients.
quickCompareHaarCoefficients Compare Haar coefficients (simplified version).
quickExtractHaarFeatures Extract Haar coefficients from the image (fast version).
quickHaarCompareTo Compare to another image with Haar coefficients, fast simplified version.

struct ImageStatistics.HaarFeatures [src]

Structure to store Haar coefficients.

coefficients Core.Array'(f32) Multi-scale Haar coefficients.
size s32 Representation size (power of 2).
levels s32 Number of decomposition levels.

func ImageStatistics.compareHaarCoefficients [src]

Compare Haar coefficients with multiscale weights.

func compareHaarCoefficients(haar1, haar2: HaarFeatures)->f32

func ImageStatistics.extractHaarFeatures [src]

Extract Haar coefficients from the image.

func extractHaarFeatures(image: Image, windowSize: u32 = 128)->ImageStatistics.HaarFeatures

func ImageStatistics.haarCompareTo [src]

Compare to another image with Haar coefficients.

func haarCompareTo(one, two: Image, windowSize: u32 = 128)->f32

func ImageStatistics.quickCompareHaarCoefficients [src]

Compare Haar coefficients (simplified version).

func quickCompareHaarCoefficients(haar1, haar2: HaarFeatures)->f32

func ImageStatistics.quickExtractHaarFeatures [src]

Extract Haar coefficients from the image (fast version).

func quickExtractHaarFeatures(image: Image, windowSize: u32 = 32)->ImageStatistics.HaarFeatures

func ImageStatistics.quickHaarCompareTo [src]

Compare to another image with Haar coefficients, fast simplified version.

func quickHaarCompareTo(one, two: Image, windowSize: u32 = 32)->f32

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(me, fileName: string)->bool

func IImageDecoder.decode [src]

func decode(me, 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(me, fileName: string)->bool

func IImageEncoder.encode [src]

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

enum Pixel.LineCapStyle [src]

None
Triangle
Round
Square
ArrowAnchor
ArrowAnchor2
SquareAnchor
RoundAnchor

struct Pixel.LinePath [src]

elements Core.Array'(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(me, f32, f32, f32, f32) Add a curve from the previous point to pt.
bezierTo(me, 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(me, 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(me, x, y: f32, ctx, cty: f32) func bezierTo(me, x, y: f32, ct1x, ct1y: f32, ct2x, ct2y: f32)

func LinePath.clearCache [src]

Clear internal cache.

func clearCache(me)

func LinePath.close [src]

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

func close(me)

func LinePath.curveTo [src]

Add a curve from the previous point to pt.

func curveTo(me, x, y: f32)

func LinePath.flatten [src]

Convert the path to a list of points.

func flatten(me, quality = PaintQuality.Normal)

func LinePath.lineTo [src]

Add a line from the previous point to pt.

func lineTo(me, x, y: f32)

func LinePath.opDrop [src]

func opDrop(me)

func LinePath.opPostCopy [src]

func opPostCopy(me)

func LinePath.setArc [src]

Initialize the path with an arc.

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

func LinePath.setCircle [src]

Initialize the path with a circle.

func setCircle(me, centerX, centerY: f32, radius: f32)

func LinePath.setEllipse [src]

Initialize the path with an ellipse.

func setEllipse(me, centerX, centerY: f32, radiusX, radiusY: f32)

func LinePath.setRect [src]

Initialize the path with a rectangle.

func setRect(me, left, top, width, height: f32)

func LinePath.setRoundRect [src]

Initialize the path with a round rectangle.

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

func LinePath.start [src]

Reset the path.

func start(me, startX, startY: f32)

struct Pixel.LinePathList [src]

paths Core.Array'(*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(me, f32) Call fast offset on all paths They must before be flattened.
offset(me, 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(me)

func LinePathList.clear [src]

Remove all internal line paths.

func clear(me)

func LinePathList.count [src]

func count(me)->u64

func LinePathList.flatten [src]

Flatten all paths.

func flatten(me, quality: PaintQuality)

func LinePathList.newPath [src]

Returns a new path.

func newPath(me)->*LinePath

func LinePathList.offset [src]

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

func offset(me, value: f32)

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

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

func LinePathList.opDrop [src]

func opDrop(me)

func LinePathList.opPostCopy [src]

func opPostCopy(me)

struct Pixel.NativeRenderOgl [src]

Functions

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

func NativeRenderOgl.createContext [src]

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

func NativeRenderOgl.dropContext [src]

func dropContext(me, rc: RenderingContext)

func NativeRenderOgl.setCurrentContext [src]

func setCurrentContext(me, rc: RenderingContext)

func NativeRenderOgl.swapBuffers [src]

func swapBuffers(me, 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'(Command)
vertexBuffer Core.Array'(VertexLayout)
triangulateIdx Core.Array'(s32)
fake bool
sharedLinePath LinePath
sharedLinePathList LinePathList
sharedRoundTmp Core.Array'({factor:f32,pos:Core.Math.Vector2})
curState PaintState
stackState Core.Array'(PaintState)
stackTransform Core.Array'(Core.Math.Transform2)
lastTexture0Type BrushType
tess Poly2Tri.Tessellate
stackRT Core.Array'(*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(me, f32, f32, f32, const &Angle, const &Angle, const &Color, f32) Draw an arc between two angles.
drawArc(me, f32, f32, f32, const &Angle, const &Angle, const &Pen)
drawBezier
drawCircle(me, f32, f32, f32, const &Color, f32) Draw an empty circle.
drawCircle(me, f32, f32, f32, const &Pen)
drawEllipse(me, const &Rectangle, const &Color, f32)
drawEllipse(me, const &Rectangle, const &Pen)
drawEllipse(me, f32, f32, f32, f32, const &Color, f32) Draw an empty ellipse.
drawEllipse(me, f32, f32, f32, f32, const &Pen)
drawLine(me, const &Vector2, const &Vector2, const &Pen) Draw a line.
drawLine(me, f32, f32, f32, f32, const &Color, f32)
drawLine(me, f32, f32, f32, f32, const &Pen)
drawPath(me, *LinePath, const &Color, f32) Draw a line path.
drawPath(me, *LinePath, const &Pen)
drawPath(me, *LinePathList, const &Color, f32, DrawPathListMode)
drawPath(me, *LinePathList, const &Pen, DrawPathListMode) Draw a list of paths.
drawRect(me, const &Rectangle, const &Color, f32)
drawRect(me, const &Rectangle, const &Pen)
drawRect(me, f32, f32, f32, f32, const &Color, f32) Draw an empty rectangle.
drawRect(me, f32, f32, f32, f32, const &Pen)
drawRichString Draw a rich string.
drawRoundRect(me, const &Rectangle, f32, f32, const &Color, f32)
drawRoundRect(me, const &Rectangle, f32, f32, const &Pen)
drawRoundRect(me, f32, f32, f32, f32, f32, f32, const &Color, f32) Draw an empty round rectangle.
drawRoundRect(me, f32, f32, f32, f32, f32, f32, const &Pen)
drawString(me, f32, f32, string, *Font, const &Brush, UnderlineStyle, f32) Draw a simple string.
drawString(me, f32, f32, string, *Font, const &Color, UnderlineStyle, f32) Draw a simple string.
drawStringCenter Draw a simple string (centered).
drawTexture(me, const &Rectangle, const &Rectangle, const &Texture, const &Color)
drawTexture(me, const &Rectangle, const &Texture, const &Color)
drawTexture(me, f32, f32, const &Rectangle, const &Texture, const &Color)
drawTexture(me, f32, f32, const &Texture, const &Color)
drawTexture(me, f32, f32, f32, f32, const &Rectangle, const &Texture, const &Color) Draw a portion of an image.
drawTexture(me, 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(me, f32, f32, f32, const &Brush) Draw a solid circle.
fillCircle(me, f32, f32, f32, const &Color)
fillEllipse(me, const &Rectangle, const &Brush)
fillEllipse(me, const &Rectangle, const &Color)
fillEllipse(me, f32, f32, f32, f32, const &Brush) Draw a solid ellipse.
fillEllipse(me, f32, f32, f32, f32, const &Color)
fillPath(me, *LinePath, const &Brush)
fillPath(me, *LinePath, const &Color)
fillPath(me, *LinePathList, const &Brush) Fill a list of paths.
fillPath(me, *LinePathList, const &Color) Fill a list of paths.
fillPolygon(me, *LinePath, const &Brush) Fill the polygon with the given brush.
fillPolygon(me, *LinePath, const &Color) Fill the polygon with the given color.
fillPolygon(me, [..] Vector2, const &Brush) Fill the polygon with the given brush.
fillRect(me, const &Rectangle, const &Brush)
fillRect(me, const &Rectangle, const &Color)
fillRect(me, f32, f32, f32, f32, const &Brush) Draw a filled rectangle.
fillRect(me, f32, f32, f32, f32, const &Color)
fillRoundRect(me, const &Rectangle, f32, f32, const &Brush)
fillRoundRect(me, const &Rectangle, f32, f32, const &Color)
fillRoundRect(me, f32, f32, f32, f32, f32, f32, const &Brush) Draw a filled round rectangle.
fillRoundRect(me, 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(me, const &Angle) Set the paint rotation.
rotateTransform(me, const &Angle, f32, f32) Set the paint rotation.
rotateTransformInPlace Set the paint rotation.
scaleTransform(me, f32) Set the paint scale.
scaleTransform(me, f32, f32) Set the paint scale.
setAntialiased Set antialiased mode on/off.
setBlendingMode Set the current blending mode.
setClippingRect(me, const &Rectangle) Set the current clipping rectangle.
setClippingRect(me, f32, f32, f32, f32) Set the current clipping rectangle.
setClippingRegionMode Set the clipping region mode.
setColorMask(me, bool, bool, bool, bool) Set color mask.
setColorMask(me, 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(me, ShaderParamHandle, f32) Set a shader parameter.
setShaderParam(me, 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(me, add: PaintParams)

func Painter.begin [src]

Call this before drawing.

func begin(me)

func Painter.bindRenderTarget [src]

Bind a render target.

func bindRenderTarget(me, 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(me, color: Color)

func Painter.computeLayout [src]

Recompute the layout for a given rectangle.

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

func Painter.drawArc [src]

Draw an arc between two angles.

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

func Painter.drawBezier [src]

func drawBezier(me, startX, startY, endX, endY: f32, ptX, ptY: f32, pen: Pen)

func Painter.drawCircle [src]

Draw an empty circle.

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

func Painter.drawEllipse [src]

Draw an empty ellipse.

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

func Painter.drawLine [src]

Draw a line.

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

func Painter.drawPath [src]

Draw a line path.

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

Draw a list of paths.

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

func Painter.drawRect [src]

Draw an empty rectangle.

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

func Painter.drawRichString [src]

Draw a rich string.

func drawRichString(me, 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(me, left, top, width, height: f32, radiusX, radiusY: f32, color: Color, penSize: f32 = 1) func drawRoundRect(me, left, top, width, height: f32, radiusX, radiusY: f32, pen: Pen) func drawRoundRect(me, rect: Math.Rectangle, radiusX, radiusY: f32, pen: Pen) func drawRoundRect(me, rect: Math.Rectangle, radiusX, radiusY: f32, color: Color, penSize: f32 = 1)

func Painter.drawString [src]

Draw a simple string.

func drawString(me, left, top: f32, text: string, font: *Font, color: Color, under = UnderlineStyle.None, zoom = 1.0) func drawString(me, 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(me, 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(me, x, y, width, height: f32, texture: Texture, color: Color = Argb.White) func drawTexture(me, rect: Math.Rectangle, texture: Texture, color: Color = Argb.White) func drawTexture(me, x, y: f32, texture: Texture, color: Color = Argb.White)

Draw a portion of an image.

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

func Painter.end [src]

Call this after drawing.

func end(me)

func Painter.endClippingRegion [src]

Stop painting in the clipping buffer. Back to normal.

func endClippingRegion(me)

func Painter.fillCircle [src]

Draw a solid circle.

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

func Painter.fillEllipse [src]

Draw a solid ellipse.

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

func Painter.fillPath [src]

Fill a list of paths.

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

Fill a list of paths.

func fillPath(me, 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(me, path: *LinePath, color: Color)

Fill the polygon with the given brush.

func fillPolygon(me, path: *LinePath, brush: Brush) func fillPolygon(me, points: [..] Math.Vector2, brush: Brush)

func Painter.fillRect [src]

Draw a filled rectangle.

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

func Painter.fillRoundRect [src]

Draw a filled round rectangle.

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

func Painter.getClippingRect [src]

Get the current clipping rectangle.

func getClippingRect(me)->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 *GlyphDesc) func getGlyphs(text: Array'rune, font: *Font)->Core.Array'(const *GlyphDesc)

func Painter.getParams [src]

func getParams(me)->PaintParams

func Painter.getQuality [src]

func getQuality(me)->PaintQuality

func Painter.getTransform [src]

Returns the current tranformation.

func getTransform(me)->Core.Math.Transform2

func Painter.isEmptyClippingRect [src]

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

func isEmptyClippingRect(me)->bool

func Painter.measureRune [src]

Get a rune size for a given font.

func measureRune(c: rune, font: #null *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))->StringMetrics

func Painter.popClippingRect [src]

Restore the original clipping rectangle.

func popClippingRect(me)

func Painter.popState [src]

Restore the last paint state.

func popState(me)

func Painter.popTransform [src]

Restore the pushed transformation.

func popTransform(me)

func Painter.pushClippingRect [src]

Interface the given rectangle with the current clipping rectangle.

func pushClippingRect(me, rect: Rectangle, isSurfacePos = false)

func Painter.pushClippingSurfaceRect [src]

Interface the given rectangle with the current clipping rectangle.

func pushClippingSurfaceRect(me, rect: Rectangle)

func Painter.pushState [src]

Save the current paint state.

func pushState(me)

func Painter.pushTransform [src]

Push the current transformation.

func pushTransform(me)

func Painter.releaseRenderTarget [src]

Release the render target.

func releaseRenderTarget(me, tgt: *RenderTarget)

func Painter.removeParams [src]

func removeParams(me, remove: PaintParams)

func Painter.resetClippingRect [src]

Reset the current clipping rectangle.

func resetClippingRect(me)

func Painter.resetClippingRegion [src]

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

func resetClippingRegion(me)

func Painter.resetState [src]

Reset the current painting state.

func resetState(me)

func Painter.resetTransform [src]

Reset the paint position, rotation, scale.

func resetTransform(me)

func Painter.rotateTransform [src]

Set the paint rotation.

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

func Painter.rotateTransformInPlace [src]

Set the paint rotation.

func rotateTransformInPlace(me, angle: Math.Angle)

Will rotate around the current transformation position.

func Painter.scaleTransform [src]

Set the paint scale.

func scaleTransform(me, x, y: f32) func scaleTransform(me, x: f32)

func Painter.setAntialiased [src]

Set antialiased mode on/off.

func setAntialiased(me, aa = true)

func Painter.setBlendingMode [src]

Set the current blending mode.

func setBlendingMode(me, mode: BlendingMode)

func Painter.setClippingRect [src]

Set the current clipping rectangle.

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

func Painter.setClippingRegionMode [src]

Set the clipping region mode.

func setClippingRegionMode(me, mode: ClippingMode)

func Painter.setColorMask [src]

Set color mask.

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

func Painter.setColorMaskAlpha [src]

func setColorMaskAlpha(me)

func Painter.setColorMaskColor [src]

func setColorMaskColor(me)

func Painter.setColorMaskFull [src]

func setColorMaskFull(me)

func Painter.setInterpolationMode [src]

Set the texture interpolation mode.

func setInterpolationMode(me, mode: InterpolationMode)

func Painter.setParams [src]

Set the paint parameters.

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

func Painter.setQuality [src]

Set the paint quality.

func setQuality(me, quality: PaintQuality)

func Painter.setShader [src]

Set the current shader.

func setShader(me, shader: *ShaderBase = null)

func Painter.setShaderParam [src]

Set a shader parameter.

func setShaderParam(me, param: ShaderParamHandle, val: s32) func setShaderParam(me, param: ShaderParamHandle, val: f32)

func Painter.setState [src]

Set the current painting state.

func setState(me, state: PaintState)

func Painter.setTransform [src]

Set the paint transformation.

func setTransform(me, tr: Transform2)

func Painter.startClippingRegion [src]

Start painting in the clipping buffer.

func startClippingRegion(me, mode = ClippingMode.Set)

func Painter.translateTransform [src]

Set the paint position.

func translateTransform(me, x, y: f32)

func Painter.unbindRenderTarget [src]

Bind a render target.

func unbindRenderTarget(me)

struct Pixel.Pen [src]

size f32
brush Brush
pattern Core.Array'(f32)
dashBegCapStyle DashCapStyle
dashEndCapStyle DashCapStyle
borderPos BorderPos
capBegScaleX f32
capBegScaleY f32
capEndScaleX f32
capEndScaleY f32
joinMiterLimit f32
plotOffset f32
dashStyle DashStyle
dashBlankScale f32
begCapStyle 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(me)->u8

func PixelFormat.bpp [src]

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

func bpp(me)->u8

func PixelFormat.channels [src]

Returns the number of image channels.

func channels(me)->u8

func PixelFormat.hasAlpha [src]

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

func hasAlpha(me)->bool

namespace Pixel.Png

Structs

Decoder
EncodeOptions
Encoder

struct Png.Decoder [src]

func IImageDecoder.canDecode [src]

func canDecode(me, fileName: string)->bool

func IImageDecoder.decode [src]

func decode(me, 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(me, fileName: string)->bool

func IImageEncoder.encode [src]

func encode(me, 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'(*Poly2Tri.Edge)
border [2] *Poly2Tri.Edge

struct Poly2Tri.Result [src]

triangles Core.Array'(*Poly2Tri.Triangle)
edges Core.Array'(*Poly2Tri.Edge)
points Core.Array'(*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(me, pt: Math.Vector2)

func Tessellate.addPolyLine [src]

Register a polygon as a polyline.

func addPolyLine(me, poly: Polygon)

func Tessellate.clear [src]

Clear content.

func clear(me)

func Tessellate.endPolyLine [src]

To call to register the polyline.

func endPolyLine(me)

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

func Tessellate.getResult [src]

Get the triangulation result.

func getResult(me)->Poly2Tri.Result

func Tessellate.opDrop [src]

func opDrop(me)

func Tessellate.startPolyLine [src]

To call before adding a polyline.

func startPolyLine(me)

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

func Tessellate.triangulate [src]

Triangulate.

func triangulate(me)

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(me, u64) Get the given point.
getPoint(me, u64)
getPoint(me, u64, f32) Get the given point, with an optional offset.
normalizeDist Divide by adding points if two points are too far away.
offset(me, f32) Fast expand polygon by a given amount.
offset(me, f32, JoinStyle, f32) Slow but quality offset with a joinStyle.

func Polygon.add [src]

Add a new point.

func add(me, v: Vector2)

func Polygon.clean [src]

Clean polygon by removing bad/unecessary points.

func clean(me)

func Polygon.clear [src]

Clear all points.

func clear(me)

func Polygon.compute [src]

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

func compute(me)

func Polygon.getClean [src]

Clean polygon by removing bad/unecessary points.

func getClean(me)->LinePathList

func Polygon.getOffset [src]

Slow but quality offset with a joinStyle.

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

func Polygon.getPoint [src]

Get the given point.

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

Get the given point, with an optional offset.

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

func Polygon.normalizeDist [src]

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

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

func Polygon.offset [src]

Fast expand polygon by a given amount.

func offset(me, value: f32)

Slow but quality offset with a joinStyle.

func offset(me, 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'(*RenderTarget)
stackRT Core.Array'(*RenderTarget)
curRT *RenderTarget
curShader *ShaderBase
overlapMode bool

Functions

addImage(me, const &Image) Register an image for rendering.
addImage(me, 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(me, const &Angle) Rotate the world transform.
rotateTransform(me, const &Angle, f32, f32) Rotate the world transform.
scaleTransform(me, f32) Scale the world transform.
scaleTransform(me, f32, f32) 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(me, fullName: string)->Texture throw

Register an image for rendering.

func addImage(me, image: Image)->Texture

func RenderOgl.begin [src]

To be called before rendering.

func begin(me, rc: RenderingContext)

func RenderOgl.bindRenderTarget [src]

Set the current render target.

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

func RenderOgl.clear [src]

Clear current render buffers.

func clear(me)

func RenderOgl.computeMatrices [src]

func computeMatrices(me, mvp, mdl: ShaderParamHandle)

func RenderOgl.createRenderTarget [src]

Create a render target.

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

func RenderOgl.createShader [src]

Create the given shader.

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

func RenderOgl.deleteRenderTarget [src]

Delete a render target.

func deleteRenderTarget(me, rt: *RenderTarget)

func RenderOgl.draw [src]

Draw the given painter.

func draw(me, dc: *Painter)

func RenderOgl.end [src]

To be called after rendering.

func end(me)

func RenderOgl.getRenderTarget [src]

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

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

func RenderOgl.getTargetSize [src]

Get the actual render target size.

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

func RenderOgl.getTexturePixels [src]

Returns the pixels associated to a texture.

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

func RenderOgl.init [src]

First init.

func init(me)

func RenderOgl.opDrop [src]

func opDrop(me)

func RenderOgl.pixelFormatToNative [src]

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

func RenderOgl.releaseRenderTarget [src]

Release the given render target.

func releaseRenderTarget(me, tgt: *RenderTarget)

func RenderOgl.removeTexture [src]

Unregister a texture created with addImage.

func removeTexture(me, texture: *Texture)

func RenderOgl.resetScissorRect [src]

Reset the scissor.

func resetScissorRect(me)

func RenderOgl.resetTransform [src]

Reset the world transform.

func resetTransform(me)

func RenderOgl.rotateTransform [src]

Rotate the world transform.

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

func RenderOgl.scaleTransform [src]

Scale the world transform.

func scaleTransform(me, x, y: f32) func scaleTransform(me, x: f32)

func RenderOgl.setCurrentContext [src]

Set the current rendering context.

func setCurrentContext(me, rc: RenderingContext)

func RenderOgl.setScissorRect [src]

Force the scissor.

func setScissorRect(me, rect: Math.Rectangle)

func RenderOgl.setShader [src]

Set the current shader.

func setShader(me, shader: *ShaderBase = null)

func RenderOgl.translateTransform [src]

Translate the world transform.

func translateTransform(me, x, y: f32)

func RenderOgl.unbindRenderTarget [src]

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

func unbindRenderTarget(me)

func RenderOgl.unbindRenderTargetToImage [src]

Get current render target pixels.

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

func RenderOgl.updateTexture [src]

Update content of texture.

func updateTexture(me, 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'(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(me, 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(me, at: Math.Point)->*RichChunk

If an url does not exists, returns null.

func RichString.invalidate [src]

Force the string to be repainted.

func invalidate(me)

func RichString.isEmpty [src]

Returns true if the string is empty.

func isEmpty(me)->bool

func RichString.opAffect [src]

func opAffect(me, str: string)

func RichString.opCount [src]

func opCount(me)->u64

func RichString.opEquals [src]

func opEquals(me, other: string)->bool

func RichString.opPostCopy [src]

We need to recompute chunks, as they contains slices.

func opPostCopy(me)

func RichString.set [src]

Associate a string.

func set(me, text: #null 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
justifyLimit f32

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(me, col: Color)

func StringPainter.draw [src]

Draw string.

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

func StringPainter.flags [src]

Set drawing flags.

func flags(me, f: StringFormatFlags)

func StringPainter.font [src]

Set font.

func font(me, font: *Font)

func StringPainter.horzAlign [src]

Set horizontal alignment.

func horzAlign(me, align: StringHorzAlignment)

func StringPainter.vertAlign [src]

Set vertical alignment.

func vertAlign(me, align: StringVertAlignment)

enum Pixel.StringVertAlignment [src]

Center
Top
Bottom

struct Pixel.Texture [src]

handle TextureHandle
pf PixelFormat
width s32
height s32
valid bool

Functions

clear
getByteSize
isValid

func Texture.clear [src]

func clear(me)

func Texture.getByteSize [src]

func getByteSize(const me)->s32

func Texture.isValid [src]

func isValid(const me)->bool

namespace Pixel.Tga

Structs

Decoder
Encoder

struct Tga.Decoder [src]

func IImageDecoder.canDecode [src]

func canDecode(me, fileName: string)->bool

func IImageDecoder.decode [src]

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

struct Tga.Encoder [src]

func IImageEncoder.canEncode [src]

func canEncode(me, fileName: string)->bool

func IImageEncoder.encode [src]

func encode(me, 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(const me)->string

func TypeFace.getRuneOutline [src]

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

func getRuneOutline(me, 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(me, pathList: *LinePathList, text: string, size: u32, embolden: u32 = 0) throw

func TypeFace.isBold [src]

Returns true if the typeface is bold.

func isBold(const me)->bool

func TypeFace.isItalic [src]

Returns true if the typeface is italic.

func isItalic(const me)->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(me, 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 12-10-2025 with swag 0.45.0