mirror of https://github.com/buggins/dlangui.git
224 lines
8.2 KiB
HTML
224 lines
8.2 KiB
HTML
<html><head>
|
|
<META http-equiv="content-type" content="text/html; charset=utf-8">
|
|
<title>dlangui.graphics.drawbuf</title>
|
|
</head><body>
|
|
<h1>dlangui.graphics.drawbuf</h1>
|
|
<!-- Generated by Ddoc from src/dlangui/graphics/drawbuf.d -->
|
|
DLANGUI library.
|
|
<br><br>
|
|
This module contains drawing buffer implementation.
|
|
<br><br>
|
|
|
|
|
|
<br><br>
|
|
<b>Synopsis:</b><br>
|
|
<pre class="d_code"><font color=blue>import</font> dlangui.graphics.<u>drawbuf</u>;
|
|
|
|
</pre>
|
|
|
|
<br><br>
|
|
<b>License:</b><br>
|
|
Boost License 1.0
|
|
<br><br>
|
|
<b>Authors:</b><br>
|
|
Vadim Lopatin, coolreader.org@gmail.com<br><br>
|
|
|
|
<dl><dt><big><a name="blendARGB"></a>uint <u>blendARGB</u>(uint <i>dst</i>, uint <i>src</i>, uint <i>alpha</i>);
|
|
</big></dt>
|
|
<dd>blend two RGB pixels using <i>alpha</i><br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="blendAlpha"></a>uint <u>blendAlpha</u>(uint <i>a1</i>, uint <i>a2</i>);
|
|
</big></dt>
|
|
<dd>blend two alpha values 0..255 (255 is fully transparent, 0 is opaque)<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="blendGray"></a>ubyte <u>blendGray</u>(ubyte <i>dst</i>, ubyte <i>src</i>, uint <i>alpha</i>);
|
|
</big></dt>
|
|
<dd>blend two RGB pixels using <i>alpha</i><br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="isFullyTransparentColor"></a>pure nothrow bool <u>isFullyTransparentColor</u>(uint <i>color</i>);
|
|
</big></dt>
|
|
<dd>returns <b>true</b> if <i>color</i> is #FFxxxxxx (<i>color</i> alpha is 255)<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="NinePatch"></a>struct <u>NinePatch</u>;
|
|
</big></dt>
|
|
<dd>9-patch image scaling information (see Android documentation).
|
|
<br><br>
|
|
|
|
<dl><dt><big><a name="NinePatch.frame"></a>Rect <u>frame</u>;
|
|
</big></dt>
|
|
<dd><u>frame</u> (non-scalable) part size for left, top, right, bottom edges.<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="NinePatch.padding"></a>Rect <u>padding</u>;
|
|
</big></dt>
|
|
<dd><u>padding</u> (distance to content area) for left, top, right, bottom edges.<br><br>
|
|
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
<dt><big><a name="DrawBuf"></a>abstract class <u>DrawBuf</u>: dlangui.core.types.RefCountedObject;
|
|
</big></dt>
|
|
<dd>drawing buffer - image container which allows to perform some drawing operations<br><br>
|
|
|
|
<dl><dt><big><a name="DrawBuf.alpha"></a>@property uint <u>alpha</u>();
|
|
</big></dt>
|
|
<dd>get current <u>alpha</u> setting (to be applied to all drawing operations)<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="DrawBuf.alpha"></a>@property void <u>alpha</u>(uint <u>alpha</u>);
|
|
</big></dt>
|
|
<dd>set new <u>alpha</u> setting (to be applied to all drawing operations)<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="DrawBuf.addAlpha"></a>void <u>addAlpha</u>(uint <i>alpha</i>);
|
|
</big></dt>
|
|
<dd>apply additional transparency to current drawbuf <i>alpha</i> value<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="DrawBuf.applyAlpha"></a>uint <u>applyAlpha</u>(uint <i>argb</i>);
|
|
</big></dt>
|
|
<dd>applies current drawbuf alpha to <i>argb</i> color value<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="DrawBuf.id"></a>@property uint <u>id</u>();
|
|
</big></dt>
|
|
<dd>unique ID of drawbug instance, for using with hardware accelerated rendering for caching<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="DrawBuf.ninePatch"></a>const @property const(NinePatch)* <u>ninePatch</u>();
|
|
</big></dt>
|
|
<dd>get nine patch information pointer, <b>null</b> if this is not a nine patch image buffer<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="DrawBuf.ninePatch"></a>@property void <u>ninePatch</u>(NinePatch* <u>ninePatch</u>);
|
|
</big></dt>
|
|
<dd>set nine patch information pointer, <b>null</b> if this is not a nine patch image buffer<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="DrawBuf.hasNinePatch"></a>@property bool <u>hasNinePatch</u>();
|
|
</big></dt>
|
|
<dd>check whether there is nine-patch information available for drawing buffer<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="DrawBuf.detectNinePatch"></a>bool <u>detectNinePatch</u>();
|
|
</big></dt>
|
|
<dd>override to detect nine patch using image 1-pixel border; returns <b>true</b> if 9-patch markup is found in image.<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="DrawBuf.width"></a>@property int <u>width</u>();
|
|
</big></dt>
|
|
<dd>returns current <u>width</u><br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="DrawBuf.height"></a>@property int <u>height</u>();
|
|
</big></dt>
|
|
<dd>returns current <u>height</u><br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="DrawBuf.clipRect"></a>@property ref Rect <u>clipRect</u>();
|
|
</big></dt>
|
|
<dd>returns clipping rectangle, when <u>clipRect</u>.isEmpty == <b>true</b> -- means no clipping.<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="DrawBuf.clipOrFullRect"></a>@property Rect <u>clipOrFullRect</u>();
|
|
</big></dt>
|
|
<dd>returns clipping rectangle, or (0,0,dx,dy) when no clipping.<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="DrawBuf.clipRect"></a>@property void <u>clipRect</u>(ref const Rect <i>rect</i>);
|
|
</big></dt>
|
|
<dd>sets new clipping rectangle, when <u>clipRect</u>.isEmpty == <b>true</b> -- means no clipping.<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="DrawBuf.intersectClipRect"></a>@property void <u>intersectClipRect</u>(ref const Rect <i>rect</i>);
|
|
</big></dt>
|
|
<dd>sets new clipping rectangle, when clipRect.isEmpty == <b>true</b> -- means no clipping.<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="DrawBuf.applyClipping"></a>bool <u>applyClipping</u>(ref Rect <i>rc</i>);
|
|
</big></dt>
|
|
<dd>apply clipRect and buffer bounds clipping to rectangle<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="DrawBuf.applyClipping"></a>bool <u>applyClipping</u>(ref Rect <i>rc</i>, ref Rect <i>rc2</i>);
|
|
</big></dt>
|
|
<dd>apply clipRect and buffer bounds clipping to rectangle; if clippinup applied to first rectangle, reduce second rectangle bounds proportionally.<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="DrawBuf.beforeDrawing"></a>void <u>beforeDrawing</u>();
|
|
</big></dt>
|
|
<dd>reserved for hardware-accelerated drawing - begins drawing batch<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="DrawBuf.afterDrawing"></a>void <u>afterDrawing</u>();
|
|
</big></dt>
|
|
<dd>reserved for hardware-accelerated drawing - ends drawing batch<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="DrawBuf.bpp"></a>@property int <u>bpp</u>();
|
|
</big></dt>
|
|
<dd>returns buffer bits per pixel<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="DrawBuf.resize"></a>abstract void <u>resize</u>(int <i>width</i>, int <i>height</i>);
|
|
</big></dt>
|
|
<dd><u>resize</u> buffer<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="DrawBuf.fill"></a>abstract void <u>fill</u>(uint <i>color</i>);
|
|
</big></dt>
|
|
<dd><u>fill</u> the whole buffer with solid <i>color</i> (no clipping applied)<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="DrawBuf.fillRect"></a>abstract void <u>fillRect</u>(Rect <i>rc</i>, uint <i>color</i>);
|
|
</big></dt>
|
|
<dd>fill rectangle with solid <i>color</i> (clipping is applied)<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="DrawBuf.drawGlyph"></a>abstract void <u>drawGlyph</u>(int <i>x</i>, int <i>y</i>, Glyph* <i>glyph</i>, uint <i>color</i>);
|
|
</big></dt>
|
|
<dd>draw 8bit alpha image - usually font <i>glyph</i> using specified <i>color</i> (clipping is applied)<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="DrawBuf.drawFragment"></a>abstract void <u>drawFragment</u>(int <i>x</i>, int <i>y</i>, DrawBuf <i>src</i>, Rect <i>srcrect</i>);
|
|
</big></dt>
|
|
<dd>draw source buffer rectangle contents to destination buffer<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="DrawBuf.drawRescaled"></a>abstract void <u>drawRescaled</u>(Rect <i>dstrect</i>, DrawBuf <i>src</i>, Rect <i>srcrect</i>);
|
|
</big></dt>
|
|
<dd>draw source buffer rectangle contents to destination buffer rectangle applying rescaling<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="DrawBuf.drawImage"></a>void <u>drawImage</u>(int <i>x</i>, int <i>y</i>, DrawBuf <i>src</i>);
|
|
</big></dt>
|
|
<dd>draw unscaled image at specified coordinates<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="DrawBuf.drawFrame"></a>void <u>drawFrame</u>(Rect <i>rc</i>, uint <i>frameColor</i>, Rect <i>frameSideWidths</i>, uint <i>innerAreaColor</i> = 4294967295u);
|
|
</big></dt>
|
|
<dd>draws rectangle frame of specified color and widths (per side), and optinally fills inner area<br><br>
|
|
|
|
</dd>
|
|
<dt><big><a name="DrawBuf.transformColors"></a>DrawBuf <u>transformColors</u>(ref ColorTransform <i>transform</i>);
|
|
</big></dt>
|
|
<dd>create drawbuf with copy of current buffer with changed colors (returns this if not supported)<br><br>
|
|
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
<dt><big><a name="ClipRectSaver"></a>struct <u>ClipRectSaver</u>;
|
|
</big></dt>
|
|
<dd>RAII setting/restoring of clip rectangle<br><br>
|
|
|
|
</dd>
|
|
</dl>
|
|
|
|
<hr><small>Page generated by <a href="http://dlang.org/ddoc.html">Ddoc</a>. Vadim Lopatin, 2014
|
|
</small>
|
|
</body></html>
|