ae.utils.graphics.draw

Drawing functions.

Members

Aliases

clear
deprecated alias clear = fill
Undocumented in source.

Functions

aaFillRect
void aaFillRect(V v, F x1, F y1, F x2, F y2, COLOR color)

Draw a filled rectangle at fractional coordinates. Edges are anti-aliased.

aaLine
void aaLine(V v, float x1, float y1, float x2, float y2, COLOR color)
void aaLine(V v, float x1, float y1, float x2, float y2, COLOR color, frac alpha)

Draw an anti-aliased line.

aaPutPixel
void aaPutPixel(V v, F x, F y, COLOR color)

Draw a 1x1 rectangle at fractional coordinates. Affects up to 4 pixels in the image.

draw
typeof(this) draw(xy_t x, xy_t y, SRCCANVAS v)

Draws an image. Returns this.

fill
void fill(V v, COLOR c)

Fills a writable view with a solid color.

fillCircle
void fillCircle(V v, xy_t x, xy_t y, xy_t r, COLOR c)

Draw a filled circle.

fillPoly
void fillPoly(V v, Coord[] coords, COLOR f)

Draw a filled polygon with a variable number of points.

fillRect
void fillRect(V v, xy_t x1, xy_t y1, xy_t x2, xy_t y2, COLOR b)

Draw a filled rectangle.

fillRect
void fillRect(V v, xy_t x1, xy_t y1, xy_t x2, xy_t y2, COLOR c, COLOR b)

Draw a filled rectangle with an outline.

fillSector
void fillSector(V v, xy_t x, xy_t y, xy_t r0, xy_t r1, real a0, real a1, COLOR c)

Draw a filled sector (circle slice).

hline
void hline(V v, xy_t x1, xy_t x2, xy_t y, COLOR c)

Draw a horizontal line.

hline
void hline(V v, xy_t x1, xy_t x2, xy_t y, COLOR color, frac alpha)

Draw a horizontal line

line
void line(V v, xy_t x1, xy_t y1, xy_t x2, xy_t y2, COLOR c)

Draw a line.

pixelPtr
ViewColor!V* pixelPtr(V v, xy_t x, xy_t y)

Gets a pixel's address from a direct view.

putPixel
void putPixel(V v, xy_t x, xy_t y, COLOR value)

Forwards to safePut or opIndex, depending on the CHECKED parameter. Allows propagation of a CHECKED parameter from other callers.

rect
void rect(V v, xy_t x1, xy_t y1, xy_t x2, xy_t y2, COLOR c)

Draws a rectangle with a solid line. The coordinates represent bounds (open on the right) for the outside of the rectangle.

safeGet
COLOR safeGet(V v, xy_t x, xy_t y, COLOR def)

Get the pixel color at the specified coordinates, or fall back to the specified default value if the coordinates are out of bounds.

safePut
void safePut(V v, xy_t x, xy_t y, COLOR value)

Set the pixel color at the specified coordinates if the coordinates are not out of bounds.

softCircle
void softCircle(V v, T x, T y, T r1, T r2, COLOR color)

Draw a circle using a smooth interpolated line.

softRing
void softRing(V v, T x, T y, T r0, T r1, T r2, COLOR color)

Draw a circle using a smooth interpolated line.

subpixelDownscale
void subpixelDownscale()

Downscale an image minding subpixel positioning on LCD screens.

thickLine
void thickLine(V v, xy_t x1, xy_t y1, xy_t x2, xy_t y2, xy_t r, COLOR c)

Draw a line of a given thickness. Does not draw caps.

thickLinePoly
void thickLinePoly(V v, Coord[] coords, xy_t r, COLOR c)

Draw a polygon of a given thickness. Does not draw caps.

uncheckedFloodFill
void uncheckedFloodFill(V v, xy_t x, xy_t y, COLOR c)

Recursively replace the color of all adjacent pixels of the same color, starting with the given coordinates. Unchecked! Make sure area is bounded.

vline
void vline(V v, xy_t x, xy_t y1, xy_t y2, COLOR c)

Draw a vertical line.

vline
void vline(V v, xy_t x, xy_t y1, xy_t y2, COLOR color, frac alpha)

Draw a vertical line

whiteNoise
void whiteNoise(V v)

Fill v with white noise.

Structs

Coord
struct Coord

Polygon point definition.

Templates

aaPutPixel
template aaPutPixel(bool CHECKED = true, bool USE_ALPHA = true)

Draw a 1x1 rectangle at fractional coordinates. Affects up to 4 pixels in the image.

Meta

License

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

Authors

Vladimir Panteleev <ae@cy.md>