DrawBuf

drawing buffer - image container which allows to perform some drawing operations

Constructors

this
this()
Undocumented in source.

Destructor

~this
~this()
Undocumented in source.

Members

Functions

afterDrawing
void afterDrawing()

reserved for hardware-accelerated drawing - ends drawing batch

applyClipping
bool applyClipping(Rect rc)

apply clipRect and buffer bounds clipping to rectangle

applyClipping
bool applyClipping(Rect rc, Rect rc2)

apply clipRect and buffer bounds clipping to rectangle; if clippinup applied to first rectangle, reduce second rectangle bounds proportionally.

beforeDrawing
void beforeDrawing()

reserved for hardware-accelerated drawing - begins drawing batch

clear
void clear()
Undocumented in source. Be warned that the author may not have intended to support it.
detectNinePatch
bool detectNinePatch()

override to detect nine patch using image 1-pixel border; returns true if 9-patch markup is found in image.

drawFragment
void drawFragment(int x, int y, DrawBuf src, Rect srcrect)

draw source buffer rectangle contents to destination buffer

drawGlyph
void drawGlyph(int x, int y, Glyph* glyph, uint color)

draw 8bit alpha image - usually font glyph using specified color (clipping is applied)

drawImage
void drawImage(int x, int y, DrawBuf src)

draw unscaled image at specified coordinates

drawRescaled
void drawRescaled(Rect dstrect, DrawBuf src, Rect srcrect)

draw source buffer rectangle contents to destination buffer rectangle applying rescaling

fill
void fill(uint color)

fill the whole buffer with solid color (no clipping applied)

fillRect
void fillRect(Rect rc, uint color)

fill rectangle with solid color (clipping is applied)

resize
void resize(int width, int height)

resize buffer

transformColors
DrawBuf transformColors(ColorTransform transform)

create drawbuf with copy of current buffer with changed colors (returns this if not supported)

Properties

bpp
int bpp [@property getter]

returns buffer bits per pixel

clipOrFullRect
Rect clipOrFullRect [@property getter]

returns clipping rectangle, or (0,0,dx,dy) when no clipping.

clipRect
Rect clipRect [@property getter]

returns clipping rectangle, when clipRect.isEmpty == true -- means no clipping.

clipRect
Rect clipRect [@property setter]

sets new clipping rectangle, when clipRect.isEmpty == true -- means no clipping.

hasNinePatch
bool hasNinePatch [@property getter]

check whether there is nine-patch information available for drawing buffer

height
int height [@property getter]

returns current height

id
uint id [@property getter]

unique ID of drawbug instance, for using with hardware accelerated rendering for caching

intersectClipRect
Rect intersectClipRect [@property setter]

sets new clipping rectangle, when clipRect.isEmpty == true -- means no clipping.

ninePatch
const(NinePatch)* ninePatch [@property getter]

get nine patch information pointer, null if this is not a nine patch image buffer

ninePatch
NinePatch* ninePatch [@property setter]

set nine patch information pointer, null if this is not a nine patch image buffer

onDestroyCallback
void function(uint) onDestroyCallback [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
onDestroyCallback
void function(uint) onDestroyCallback [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
width
int width [@property getter]

returns current width

Variables

_clipRect
Rect _clipRect;
Undocumented in source.
_id
uint _id;
Undocumented in source.
_ninePatch
NinePatch* _ninePatch;
Undocumented in source.
_onDestroyCallback
void function(uint) _onDestroyCallback;
Undocumented in source.

Meta