Class ColorDrawBufBase
Inherits from
-
DrawBuf
(base class)
Constructors
Name | Description |
---|---|
this
|
Fields
Name | Type | Description |
---|---|---|
_dx
|
int |
|
_dy
|
int |
|
_alpha
|
uint |
|
_clipRect
|
Rect |
|
_id
|
uint |
|
_ninePatch
|
NinePatch* |
|
_onDestroyCallback
|
void function(uint) |
|
_refCount
|
int |
count of references to this object from Ref
|
Properties
Name | Type | Description |
---|---|---|
bpp
[get]
|
int |
returns buffer bits per pixel |
height
[get]
|
int |
returns current height
|
width
[get]
|
int |
returns current width
|
alpha
[get]
|
uint |
get current alpha setting (to be applied to all drawing operations)
|
alpha
[set]
|
uint |
set new alpha setting (to be applied to all drawing operations)
|
clipRect
[get]
|
Rect |
returns 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]
|
bool |
check whether there is nine-patch information available for drawing buffer |
id
[get]
|
uint |
unique 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]
|
bool |
returns 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 |
|
onDestroyCallback
[set]
|
void function(uint) |
|
refCount
[get]
|
int |
returns current value of reference counter |
Methods
Name | Description |
---|---|
detectNinePatch
|
detect nine patch using image 1-pixel border (see Android documentation) |
drawFragment
|
draw source buffer rectangle contents to destination buffer |
drawGlyph
|
draw 8bit alpha image - usually font glyph using specified color (clipping is applied)
|
drawGlyphToTexture
|
|
drawPixel
|
draw pixel at (x , y ) with specified color
|
drawRescaled
|
draw source buffer rectangle contents to destination buffer rectangle applying rescaling |
fillRect
|
fill rectangle with solid color (clipping is applied)
|
isBlackPixel
|
|
scanLine
|
returns pointer to ARGB scanline, null if y is out of range or buffer doesn't provide access to its memory
|
addAlpha
|
apply additional transparency to current drawbuf alpha value
|
addRef
|
increments reference counter |
afterDrawing
|
reserved for hardware-accelerated drawing - ends drawing batch |
applyAlpha
|
applies current drawbuf alpha to argb color value
|
applyClipping
|
apply clipRect and buffer bounds clipping to rectangle
|
applyClipping
|
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 |
clear
|
|
drawCustomOpenGLScene
|
draw custom OpenGL scene |
drawFocusRect
|
draw focus rectangle; vertical gradient supported - colors [0] is top color, colors [1] is bottom color
|
drawFrame
|
draws rectangle frame of specified color and widths (per side), and optinally fills inner area |
drawImage
|
draw unscaled image at specified coordinates |
drawLine
|
draw line from point p1 to p2 with specified color
|
fill
|
fill the whole buffer with solid color (no clipping applied)
|
releaseRef
|
decrement reference counter, destroy object if no more references left |
resetClipping
|
init clip rectangle to full buffer size |
resize
|
resize buffer
|
transformColors
|
create drawbuf with copy of current buffer with changed colors (returns this if not supported) |
Authors
Vadim Lopatin, coolreader.org@gmail.com
Copyright
Vadim Lopatin, 2014
License
Boost License 1.0