Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
circular17 committed Apr 4, 2024
1 parent 4171a84 commit 598f649
Show file tree
Hide file tree
Showing 32 changed files with 1,009 additions and 360 deletions.
2 changes: 1 addition & 1 deletion docs/doc/AllClasses.html
Original file line number Diff line number Diff line change
Expand Up @@ -1634,7 +1634,7 @@ <h1 class="allitems">All Structures</h1>
<tr class="list">
<td class="itemname"><a class="bold" href="BGRABitmapTypes.THSLAPixel.html">THSLAPixel</a></td>
<td class="itemunit"><a class="bold" href="BGRABitmapTypes.html">BGRABitmapTypes</a></td>
<td class="itemdesc"><p>Pixel color defined in linear HSL colorspace.</p></td>
<td class="itemdesc"><p>Pixel color defined in linear HSL colorspace with gamma correction.</p></td>
</tr>
<tr class="list2">
<td class="itemname"><a class="bold" href="BGRABitmapTypes.THSLAPixelBasicHelper.html">THSLAPixelBasicHelper</a></td>
Expand Down
2 changes: 1 addition & 1 deletion docs/doc/AllFunctions.html
Original file line number Diff line number Diff line change
Expand Up @@ -3524,7 +3524,7 @@ <h1 class="allitems">All Functions and Procedures</h1>
<tr class="list">
<td class="itemname"><a class="bold" href="BGRAGradients.html#CreateCyclicPerlinNoiseMap-integer-integer-Single-Single-Double-TResampleFilter-">CreateCyclicPerlinNoiseMap</a></td>
<td class="itemunit"><a class="bold" href="BGRAGradients.html">BGRAGradients</a></td>
<td class="itemdesc"><p>Creates a tilable random grayscale image</p></td>
<td class="itemdesc"><p>Creates a tilable random grayscale image.</p></td>
</tr>
<tr class="list2">
<td class="itemname"><a class="bold" href="BGRADithering.html#CreateDitheringTask-TDitheringAlgorithm-IBGRAScanner-TBGRACustomBitmap-TRect-">CreateDitheringTask</a></td>
Expand Down
4 changes: 2 additions & 2 deletions docs/doc/AllIdentifiers.html
Original file line number Diff line number Diff line change
Expand Up @@ -4164,7 +4164,7 @@ <h1 class="allitems">All Identifiers</h1>
<tr class="list">
<td class="itemname"><a class="bold" href="BGRAGradients.html#CreateCyclicPerlinNoiseMap-integer-integer-Single-Single-Double-TResampleFilter-">CreateCyclicPerlinNoiseMap</a></td>
<td class="itemunit"><a class="bold" href="BGRAGradients.html">BGRAGradients</a></td>
<td class="itemdesc"><p>Creates a tilable random grayscale image</p></td>
<td class="itemdesc"><p>Creates a tilable random grayscale image.</p></td>
</tr>
<tr class="list2">
<td class="itemname"><a class="bold" href="BGRADithering.html#CreateDitheringTask-TDitheringAlgorithm-IBGRAScanner-TBGRACustomBitmap-TRect-">CreateDitheringTask</a></td>
Expand Down Expand Up @@ -12328,7 +12328,7 @@ <h1 class="allitems">All Identifiers</h1>
<tr class="list">
<td class="itemname"><a class="bold" href="BGRABitmapTypes.THSLAPixel.html">THSLAPixel</a></td>
<td class="itemunit"><a class="bold" href="BGRABitmapTypes.html">BGRABitmapTypes</a></td>
<td class="itemdesc"><p>Pixel color defined in linear HSL colorspace.</p></td>
<td class="itemdesc"><p>Pixel color defined in linear HSL colorspace with gamma correction.</p></td>
</tr>
<tr class="list2">
<td class="itemname"><a class="bold" href="BGRABitmapTypes.THSLAPixelBasicHelper.html">THSLAPixelBasicHelper</a></td>
Expand Down
108 changes: 105 additions & 3 deletions docs/doc/BGRABitmapTypes.TBGRACustomBitmap.html
Original file line number Diff line number Diff line change
Expand Up @@ -1764,7 +1764,33 @@ <h3 class="detail">Methods</h3>
<td class="itemcode"><span id="Create-TBitmap-boolean-"></span><code>constructor <strong>Create</strong>(ABitmap: <a href="BGRAGraphics.html#TBitmap">TBitmap</a>; AUseTransparent: boolean); overload; virtual; abstract;</code></td>
</tr>
<tr><td colspan="2">
<p class="nodescription">This item has no description.</p></td></tr>
<p>
<a class="normal" href="#Create-TStream-">Create</a> an instance and load an image from a file.</p>
<p>


<p><strong>Example of loading and displaying an image on a form:</strong>

<p></p>

<pre class="longcode">
<span class="pascal_keyword">procedure</span> TForm1.FormCreate(Sender: TObject);
<span class="pascal_keyword">begin</span>
image := TBGRABitmap.Create(<span class="pascal_string">'image.png'</span>);
<span class="pascal_keyword">end</span>;

<span class="pascal_keyword">procedure</span> TForm1.FormDestroy(Sender: TObject);
<span class="pascal_keyword">begin</span>
image.free;
<span class="pascal_keyword">end</span>;

<span class="pascal_keyword">procedure</span> TForm1.FormPaint(Sender: TObject);
<span class="pascal_keyword">begin</span>
image.Draw(Canvas, <span class="pascal_numeric">0</span>, <span class="pascal_numeric">0</span>, True); <span class="pascal_comment">// assume image is opaque</span>
<span class="pascal_keyword">end</span>;</pre>

<p></p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
Expand Down Expand Up @@ -1837,7 +1863,44 @@ <h3 class="detail">Methods</h3>
</tr>
<tr><td colspan="2">
<p>
Spline</p>
Compute an closed spline passing by the given points.</p>
<p>


<p><strong>Example of drawing a spline on a form:</strong>

<p><img src="image_1.png" alt="computeclosedspline" />

<p></p>

<pre class="longcode">
<span class="pascal_keyword">procedure</span> TForm1.FormPaint(Sender: TObject);
<span class="pascal_keyword">var</span>
image: TBGRABitmap;
pts: <span class="pascal_keyword">array</span> <span class="pascal_keyword">of</span> TPointF;
storedSpline: <span class="pascal_keyword">array</span> <span class="pascal_keyword">of</span> TPointF;
c: TBGRAPixel;
<span class="pascal_keyword">begin</span>
image := TBGRABitmap.Create(ClientWidth, ClientHeight, clBtnFace);
c := clWindowText;

<span class="pascal_comment">//rectangular polyline</span>
setlength(pts,<span class="pascal_numeric">4</span>);
pts[<span class="pascal_numeric">0</span>] := PointF(<span class="pascal_numeric">50</span>,50);
pts[<span class="pascal_numeric">1</span>] := PointF(<span class="pascal_numeric">150</span>,50);
pts[<span class="pascal_numeric">2</span>] := PointF(<span class="pascal_numeric">150</span>,150);
pts[<span class="pascal_numeric">3</span>] := PointF(<span class="pascal_numeric">50</span>,150);
image.DrawPolylineAntialias(pts,BGRA(<span class="pascal_numeric">255</span>,0,<span class="pascal_numeric">0</span>,150),<span class="pascal_numeric">1</span>);

<span class="pascal_comment">//compute spline points and draw as a polyline</span>
storedSpline := image.ComputeClosedSpline(pts,ssVertexToSide);
image.DrawPolylineAntialias(storedSpline,c,<span class="pascal_numeric">1</span>);

image.Draw(Canvas,<span class="pascal_numeric">0</span>,0,True);
image.free;
<span class="pascal_keyword">end</span>;</pre>

<p></p>
</td></tr>
</table>
<table class="detail wide_list">
Expand Down Expand Up @@ -1894,7 +1957,46 @@ <h3 class="detail">Methods</h3>
<td class="itemcode"><span id="ComputeOpenedSpline-arrayofTPointF-TSplineStyle-"></span><code>function <strong>ComputeOpenedSpline</strong>(const APoints: array of <a href="BGRABitmapTypes.html#TPointF">TPointF</a>; AStyle: <a href="BGRABitmapTypes.html#TSplineStyle">TSplineStyle</a>): <a href="BGRABitmapTypes.html#ArrayOfTPointF">ArrayOfTPointF</a>; virtual; abstract;</code></td>
</tr>
<tr><td colspan="2">
<p class="nodescription">This item has no description.</p></td></tr>
<p>
Compute an opened spline passing by the given points.</p>
<p>


<p><strong>Example of drawing a spline on a form:</strong>

<p><img src="image_2.png" alt="computeopenedspline" />

<p></p>

<pre class="longcode">
<span class="pascal_keyword">procedure</span> TForm1.FormPaint(Sender: TObject);
<span class="pascal_keyword">var</span>
image: TBGRABitmap;
pts: <span class="pascal_keyword">array</span> <span class="pascal_keyword">of</span> TPointF;
storedSpline: <span class="pascal_keyword">array</span> <span class="pascal_keyword">of</span> TPointF;
c: TBGRAPixel;
<span class="pascal_keyword">begin</span>
image := TBGRABitmap.Create(ClientWidth, ClientHeight, clBtnFace);
c := clWindowText;

<span class="pascal_comment">//rectangular polyline</span>
setlength(pts,<span class="pascal_numeric">4</span>);
pts[<span class="pascal_numeric">0</span>] := PointF(<span class="pascal_numeric">50</span>,50);
pts[<span class="pascal_numeric">1</span>] := PointF(<span class="pascal_numeric">150</span>,50);
pts[<span class="pascal_numeric">2</span>] := PointF(<span class="pascal_numeric">150</span>,150);
pts[<span class="pascal_numeric">3</span>] := PointF(<span class="pascal_numeric">50</span>,150);
image.DrawPolylineAntialias(pts,BGRA(<span class="pascal_numeric">255</span>,0,<span class="pascal_numeric">0</span>,150),<span class="pascal_numeric">1</span>);

<span class="pascal_comment">//compute spline points and draw as a polyline</span>
storedSpline := image.ComputeOpenedSpline(pts,ssVertexToSide);
image.DrawPolylineAntialias(storedSpline,c,<span class="pascal_numeric">1</span>);

image.Draw(Canvas,<span class="pascal_numeric">0</span>,0,True);
image.free;
<span class="pascal_keyword">end</span>;</pre>

<p></p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
Expand Down
2 changes: 1 addition & 1 deletion docs/doc/BGRABitmapTypes.TBGRACustomPenStroker.html
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ <h3 class="detail">Properties</h3>

<p><strong>Example of skew transform:</strong>

<p><img src="image_1.png" alt="pen_skew" />
<p><img src="image_3.png" alt="pen_skew" />

<p></p>

Expand Down
43 changes: 42 additions & 1 deletion docs/doc/BGRABitmapTypes.TGSBAPixel.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,48 @@ <h2 class="declaration">Declaration</h2>
<script type="text/javascript" src="navigation.js"></script>
<h2 class="description">Description</h2>
<p>
Pixel color defined in corrected HSL colorspace. G stands for corrected <a class="normal" href="#hue">hue</a> and B stands for actual brightness. Values range from 0 to 65535.</p>
Pixel color defined in corrected HSL colorspace.</p>
<p>


<p>G stands for corrected <a class="normal" href="#hue">hue</a> and B stands for actual brightness. Values range from 0 to 65535.

<p>See <a class="normal" href="BGRABitmapTypes.THSLAPixel.html">THSLAPixel</a> for this colorspace without <a class="normal" href="#hue">hue</a> and brightness correction.

<p><strong>Example of drawing a gradient in GSB colorspace:</strong>

<p><img src="image_6.png" alt="gsbapixel_gradient" />

<p></p>

<pre class="longcode">
<span class="pascal_keyword">procedure</span> TForm1.FormPaint(Sender: TObject);
<span class="pascal_keyword">var</span> x,y: integer;
p: PBGRAPixel;
image: TBGRABitmap;
gsba: TGSBAPixel;
<span class="pascal_keyword">begin</span>
image := TBGRABitmap.Create(ClientWidth,ClientHeight);
gsba.lightness := <span class="pascal_numeric">32768</span>;
gsba.alpha := <span class="pascal_numeric">65535</span>;
<span class="pascal_keyword">for</span> y := <span class="pascal_numeric">0</span> <span class="pascal_keyword">to</span> image.Height-<span class="pascal_numeric">1</span> <span class="pascal_keyword">do</span>
<span class="pascal_keyword">begin</span>
p := image.Scanline[y];
gsba.saturation := y*<span class="pascal_numeric">65536</span> <span class="pascal_keyword">div</span> image.Height;
<span class="pascal_keyword">for</span> x := <span class="pascal_numeric">0</span> <span class="pascal_keyword">to</span> image.Width-<span class="pascal_numeric">1</span> <span class="pascal_keyword">do</span>
<span class="pascal_keyword">begin</span>
gsba.hue := x*<span class="pascal_numeric">65536</span> <span class="pascal_keyword">div</span> image.Width;
p&circ;:= GSBAToBGRA(gsba);
inc(p);
<span class="pascal_keyword">end</span>;
<span class="pascal_keyword">end</span>;
image.InvalidateBitmap; <span class="pascal_comment">// changed by direct access</span>

image.Draw(Canvas,<span class="pascal_numeric">0</span>,0,True);
image.free;
<span class="pascal_keyword">end</span>;</pre>

<p></p>
<h2 class="overview">Overview</h2>
<span id="PasDoc-Fields"></span><h3 class="summary">Fields</h3>
<table class="summary wide_list">
Expand Down
72 changes: 70 additions & 2 deletions docs/doc/BGRABitmapTypes.TGenericUniversalBitmap.generic.html
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,49 @@ <h3 class="detail">Methods</h3>
</tr>
<tr><td colspan="2">
<p>
Creates a brush texture with a specified style, pattern color, background color, dimensions, and <a class="normal" href="BGRABitmapTypes.TCustomUniversalBitmap.html#Pen">pen</a> <a class="normal" href="BGRABitmapTypes.TCustomUniversalBitmap.html#Width">width</a></p>
Creates a brush texture with a specified style, pattern color, background color, dimensions, and <a class="normal" href="BGRABitmapTypes.TCustomUniversalBitmap.html#Pen">pen</a> <a class="normal" href="BGRABitmapTypes.TCustomUniversalBitmap.html#Width">width</a>.</p>
<p>


<p><strong>Example using a diagonal cross texture to <a class="normal" href="#Fill-TPixel-TDrawMode-Word-">fill</a> shapes on a form:</strong>

<p><img src="image_4.png" alt="createbrushtexture" />

<p></p>

<pre class="longcode">
<span class="pascal_keyword">procedure</span> TForm1.FormPaint(Sender: TObject);
<span class="pascal_keyword">var</span>
image,tex: TBGRABitmap;
c: TBGRAPixel;
x,y,rx,ry: single;

<span class="pascal_keyword">begin</span>
image := TBGRABitmap.Create(ClientWidth,ClientHeight,ColorToBGRA(ColorToRGB(clBtnFace)));
c := ColorToBGRA(ColorToRGB(clWindowText));

<span class="pascal_comment">//ellipse coordinates</span>
x := <span class="pascal_numeric">150</span>;
y := <span class="pascal_numeric">100</span>;
rx := <span class="pascal_numeric">100</span>;
ry := <span class="pascal_numeric">50</span>;

<span class="pascal_comment">//loads a &quot;diagcross&quot; brush with white pattern and orange background</span>
tex := image.CreateBrushTexture(bsDiagCross,BGRAWhite,BGRA(<span class="pascal_numeric">255</span>,192,<span class="pascal_numeric">0</span>)) <span class="pascal_keyword">as</span> TBGRABitmap;

image.FillEllipseAntialias(x,y,rx-<span class="pascal_float">0.5</span>,ry-<span class="pascal_float">0.5</span>,tex);
image.EllipseAntialias(x,y,rx,ry,c,<span class="pascal_numeric">1</span>); <span class="pascal_comment">//draw outline</span>

image.RoundRectAntialias(x-rx-<span class="pascal_numeric">10</span>,y-ry-<span class="pascal_numeric">10</span>,x+rx+<span class="pascal_numeric">10</span>,y+ry+<span class="pascal_numeric">10</span>,20,<span class="pascal_numeric">20</span>,c,<span class="pascal_numeric">11</span>);
image.RoundRectAntialias(x-rx-<span class="pascal_numeric">10</span>,y-ry-<span class="pascal_numeric">10</span>,x+rx+<span class="pascal_numeric">10</span>,y+ry+<span class="pascal_numeric">10</span>,20,<span class="pascal_numeric">20</span>,tex,<span class="pascal_numeric">9</span>);

tex.Free;

image.Draw(Canvas,<span class="pascal_numeric">0</span>,0,True);
image.free;
<span class="pascal_keyword">end</span>;</pre>

<p></p>
</td></tr>
</table>
<table class="detail wide_list">
Expand Down Expand Up @@ -999,7 +1041,33 @@ <h3 class="detail">Methods</h3>
<td class="itemcode"><span id="RectangleAntialias-single-single-single-single-TPixel-single-"></span><code>procedure <strong>RectangleAntialias</strong>(x, y, x2, y2: single; const AColor: TPixel; AWidth: single); overload; virtual;</code></td>
</tr>
<tr><td colspan="2">
<p class="nodescription">This item has no description.</p></td></tr>
<p>
Draw a <a class="normal" href="#Rectangle-TRect-TPixel-TPixel-TDrawMode-Word-">rectangle</a> using current <a class="normal" href="BGRABitmapTypes.TCustomUniversalBitmap.html#Pen">pen</a> with antialiasing.</p>
<p>


<p><strong>Example drawing a <a class="normal" href="#Rectangle-TRect-TPixel-TPixel-TDrawMode-Word-">rectangle</a> on a form:</strong>

<p><img src="image_5.png" alt="rectangleantialias" />

<p></p>

<pre class="longcode">
<span class="pascal_keyword">procedure</span> TForm1.FormPaint(Sender: TObject);
<span class="pascal_keyword">var</span> image: TBGRABitmap;
c: TBGRAPixel;
<span class="pascal_keyword">begin</span>
image := TBGRABitmap.Create(ClientWidth, ClientHeight, clBtnFace);
c := clWindowText;

image.RectangleAntialias(<span class="pascal_numeric">80</span>,80,<span class="pascal_numeric">300</span>,200, c, <span class="pascal_numeric">50</span>);

image.Draw(Canvas,<span class="pascal_numeric">0</span>,0,True);
image.free;
<span class="pascal_keyword">end</span>;</pre>

<p></p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
Expand Down
41 changes: 40 additions & 1 deletion docs/doc/BGRABitmapTypes.THSLAPixel.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,46 @@ <h2 class="declaration">Declaration</h2>
<script type="text/javascript" src="navigation.js"></script>
<h2 class="description">Description</h2>
<p>
Pixel color defined in linear HSL colorspace. Gamma correction is taken into account. Values range from 0 to 65535.</p>
Pixel color defined in linear HSL colorspace with gamma correction.</p>
<p>


<p>Values range from 0 to 65535. See <a class="normal" href="BGRABitmapTypes.TGSBAPixel.html">TGSBAPixel</a> for corrected <a class="normal" href="#hue">hue</a> and brightness.

<p><strong>Example drawing all the colors in HSL colorspace:</strong>

<p><img src="image_7.png" alt="hslapixel_gradient" />

<p></p>

<pre class="longcode">
<span class="pascal_keyword">procedure</span> TForm1.FormPaint(Sender: TObject);
<span class="pascal_keyword">var</span> x,y: integer;
p: PBGRAPixel;
image: TBGRABitmap;
hsla: THSLAPixel;
<span class="pascal_keyword">begin</span>
image := TBGRABitmap.Create(ClientWidth,ClientHeight);
hsla.lightness := <span class="pascal_numeric">32768</span>;
hsla.alpha := <span class="pascal_numeric">65535</span>;
<span class="pascal_keyword">for</span> y := <span class="pascal_numeric">0</span> <span class="pascal_keyword">to</span> image.Height-<span class="pascal_numeric">1</span> <span class="pascal_keyword">do</span>
<span class="pascal_keyword">begin</span>
p := image.Scanline[y];
hsla.saturation := y*<span class="pascal_numeric">65536</span> <span class="pascal_keyword">div</span> image.Height;
<span class="pascal_keyword">for</span> x := <span class="pascal_numeric">0</span> <span class="pascal_keyword">to</span> image.Width-<span class="pascal_numeric">1</span> <span class="pascal_keyword">do</span>
<span class="pascal_keyword">begin</span>
hsla.hue := x*<span class="pascal_numeric">65536</span> <span class="pascal_keyword">div</span> image.Width;
p&circ;:= HSLAToBGRA(hsla);
inc(p);
<span class="pascal_keyword">end</span>;
<span class="pascal_keyword">end</span>;
image.InvalidateBitmap; <span class="pascal_comment">// changed by direct access</span>

image.Draw(Canvas,<span class="pascal_numeric">0</span>,0,True);
image.free;
<span class="pascal_keyword">end</span>;</pre>

<p></p>
<h2 class="overview">Overview</h2>
<span id="PasDoc-Fields"></span><h3 class="summary">Fields</h3>
<table class="summary wide_list">
Expand Down
2 changes: 1 addition & 1 deletion docs/doc/BGRABitmapTypes.html
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ <h2 class="description">Description</h2>
</tr>
<tr class="list">
<td class="itemname">Packed Record&nbsp;<a class="bold" href="BGRABitmapTypes.THSLAPixel.html"><code>THSLAPixel</code></a></td>
<td class="itemdesc">Pixel color defined in linear HSL colorspace.</td>
<td class="itemdesc">Pixel color defined in linear HSL colorspace with gamma correction.</td>
</tr>
<tr class="list2">
<td class="itemname">Record&nbsp;<a class="bold" href="BGRABitmapTypes.THSLAPixelBasicHelper.html"><code>THSLAPixelBasicHelper</code></a></td>
Expand Down
Loading

0 comments on commit 598f649

Please sign in to comment.