Class GrayDrawBuf

class GrayDrawBuf
  : DrawBuf;

Constructors

NameDescription
this (width, height)

Fields

NameTypeDescription
_buf MallocBuf!(ubyte)
_dx int
_dy int
_alpha uint
_clipRect Rect
_id uint
_ninePatch NinePatch*
_onDestroyCallback void function(uint)
_refCount intcount of references to this object from Ref

Properties

NameTypeDescription
bpp[get] intreturns buffer bits per pixel
height[get] intreturns current height
width[get] intreturns current width
alpha[get] uintget current alpha setting (to be applied to all drawing operations)
alpha[set] uintset new alpha setting (to be applied to all drawing operations)
clipRect[get] Rectreturns clipping rectangle, when clipRect.isEmpty == true -- means no clipping.
clipRect[set] const(Rect)returns clipping rectangle, or (0,0,dx,dy) when no clipping.
hasClipping[get] bool
hasNinePatch[get] boolcheck whether there is nine-patch information available for drawing buffer
id[get] uintunique ID of drawbug instance, for using with hardware accelerated rendering for caching
intersectClipRect[set] const(Rect)sets new clipping rectangle, intersect with previous one.
isClippedOut[set] boolreturns true if rectangle is completely clipped out and cannot be drawn.
ninePatch[get] const(NinePatch)*get nine patch information pointer, null if this is not a nine patch image buffer
ninePatch[set] NinePatch*set nine patch information pointer, null if this is not a nine patch image buffer
onDestroyCallback[set] void function(uint)
refCount[get] intreturns current value of reference counter

Methods

NameDescription
detectNinePatch () detect nine patch using image 1-pixel border (see Android documentation)
drawFragment (x, y, src, srcrect) draw source buffer rectangle contents to destination buffer
drawGlyph (x, y, glyph, color) draw 8bit alpha image - usually font glyph using specified color (clipping is applied)
drawPixel (x, y, color) draw pixel at (x, y) with specified color
drawRescaled (dstrect, src, srcrect) draw source buffer rectangle contents to destination buffer rectangle applying rescaling
fill (color) fill the whole buffer with solid color (no clipping applied)
fillGradientRect (rc, color1, color2, color3, color4) fill rectangle with a gradient (clipping is applied)
fillRect (rc, color) fill rectangle with solid color (clipping is applied)
resize (width, height) resize buffer
scanLine (y)
addAlpha (alpha) apply additional transparency to current drawbuf alpha value
addRef () increments reference counter
afterDrawing () reserved for hardware-accelerated drawing - ends drawing batch
applyAlpha (argb) applies current drawbuf alpha to argb color value
applyClipping (rc) apply clipRect and buffer bounds clipping to rectangle
applyClipping (rc, rc2) apply clipRect and buffer bounds clipping to rectangle; if clippinup applied to first rectangle, reduce second rectangle bounds proportionally.
beforeDrawing () reserved for hardware-accelerated drawing - begins drawing batch
calcRectRoundedCornerRadius (corners, w, h, keepSquareXY)
clear ()
drawCustomOpenGLScene (rc, handler) draw custom OpenGL scene
drawEllipseArcF (centerX, centerY, xRadius, yRadius, startAngle, endAngle, lineWidth, lineColor, fillColor) draw ellipse arc or filled ellipse arc
drawEllipseF (centerX, centerY, xRadius, yRadius, lineWidth, lineColor, fillColor) draw ellipse or filled ellipse
drawFocusRect (rc, colors) draw focus rectangle; vertical gradient supported - colors[0] is top color, colors[1] is bottom color
drawFrame (rc, frameColor, frameSideWidths, innerAreaColor) draws rectangle frame of specified color and widths (per side), and optinally fills inner area
drawImage (x, y, src) draw unscaled image at specified coordinates
drawLine (p1, p2, colour) draw line from point p1 to p2 with specified color
drawLineF (p1, p2, width, colour) draw line of arbitrary width in float coordinates
drawLineSegmentF (p0, p1, p2, p3, width, colour) draw line of arbitrary width in float coordinates p1..p2 with angle based on previous (p0..p1) and next (p2..p3) segments
drawRoundedRectF (rect, corners, keepSquareXY, frameWidth, frameColor, fillColor) draws rect with rounded corners
fillPolyF (points, colour) draw filled polyline (vertexes must be in clockwise order)
fillQuadF (p1, p2, p3, p4, colour) draw filled quad in float coordinates
fillRectPattern (rc, color, pattern) fill rectangle with solid color and pattern (clipping is applied) 0=solid fill, 1 = dotted
fillTriangleF (p1, p2, p3, colour) draw filled triangle in float coordinates
invalidate () Call to remove this image from OpenGL cache when image is updated.
makeArcPath (center, radiusX, radiusY, startAngle, endAngle)
makeRoundedRectPath (rect, corners, keepSquareXY, outCornerSegmentsStart) builds outer rounded rect path the last parameter optionally writes out indices of first segment of corners excluding top-left
onDestroyCallback ()
polyLine (points, colour, cycled) draw poly line of width == 1px; when cycled is true, connect first and last point
polyLineF (points, width, colour, cycled, innerAreaColour) draw poly line of arbitrary width in float coordinates; when cycled is true, connect first and last point (optionally fill inner area)
releaseRef () decrement reference counter, destroy object if no more references left
resetClipping () init clip rectangle to full buffer size
transformColors (transform) create drawbuf with copy of current buffer with changed colors (returns this if not supported)
calcLineSegmentQuad (p0, p1, p2, p3, width, quad)
fillTriangleFClipped (p1, p2, p3, colour) draw filled triangle in float coordinates; clipping is already applied
intersectClipF (p1, p2, p1moved, p2moved) find intersection of line p1..p2 with clip rectangle
intersectVectors (p1, dir1, p2, dir2)

Aliases

NameDescription
~this