mirror of
https://github.com/moparisthebest/Simba
synced 2024-11-24 02:02:17 -05:00
Documentation: Add labels and clean up.
This commit is contained in:
parent
2ff6724a7f
commit
732d96b37f
@ -1,8 +1,11 @@
|
||||
.. _scriptref_colourconv:
|
||||
.. _scriptref-colourconv:
|
||||
|
||||
Colour Conversions
|
||||
==================
|
||||
|
||||
..
|
||||
TODO:
|
||||
|
||||
Colour spaces
|
||||
-------------
|
||||
|
||||
@ -12,6 +15,7 @@ Explain some colour spaces here.
|
||||
Colour Conversion Methods
|
||||
-------------------------
|
||||
|
||||
.. _scriptref-colortorgb:
|
||||
|
||||
ColorToRGB
|
||||
~~~~~~~~~~
|
||||
@ -20,6 +24,8 @@ ColorToRGB
|
||||
|
||||
procedure ColorToRGB(Color: integer; var r, g, b: Integer);
|
||||
|
||||
.. _scriptref-rgbtocolor:
|
||||
|
||||
RGBtoColor
|
||||
~~~~~~~~~~
|
||||
|
||||
@ -27,6 +33,8 @@ RGBtoColor
|
||||
|
||||
function RGBtoColor(r, g, b: Integer): TColor;
|
||||
|
||||
.. _scriptref-colortohsl:
|
||||
|
||||
ColorToHSL
|
||||
~~~~~~~~~~
|
||||
|
||||
@ -34,6 +42,8 @@ ColorToHSL
|
||||
|
||||
procedure ColorToHSL(Color: Integer; var h, s, l: Extended);
|
||||
|
||||
.. _scriptref-hsltocolor:
|
||||
|
||||
HSLToColor
|
||||
~~~~~~~~~~
|
||||
|
||||
@ -41,6 +51,8 @@ HSLToColor
|
||||
|
||||
function HSLToColor(H, S, L: Extended): TColor;
|
||||
|
||||
.. _scriptref-colortoxyz:
|
||||
|
||||
ColorToXYZ
|
||||
~~~~~~~~~~
|
||||
|
||||
@ -48,6 +60,8 @@ ColorToXYZ
|
||||
|
||||
procedure ColorToXYZ(Color: Integer; var x, y, z: Extended);
|
||||
|
||||
.. _scriptref-xyztocolor:
|
||||
|
||||
XYZToColor
|
||||
~~~~~~~~~~
|
||||
|
||||
@ -55,6 +69,8 @@ XYZToColor
|
||||
|
||||
function XYZToColor(X, Y, Z: Extended): TColor;
|
||||
|
||||
.. _scriptref-rgbtohsl:
|
||||
|
||||
RGBToHSL
|
||||
~~~~~~~~
|
||||
|
||||
@ -62,6 +78,8 @@ RGBToHSL
|
||||
|
||||
procedure RGBToHSL(R, G, B: Integer; var h, s, l: Extended);
|
||||
|
||||
.. _scriptref-hsltorgb:
|
||||
|
||||
HSLtoRGB
|
||||
~~~~~~~~
|
||||
|
||||
@ -69,6 +87,8 @@ HSLtoRGB
|
||||
|
||||
procedure HSLtoRGB(H, S, L: extended; var R, G ,B: Integer);
|
||||
|
||||
.. _scriptref-rgbtoxyz:
|
||||
|
||||
RGBToXYZ
|
||||
~~~~~~~~
|
||||
|
||||
@ -76,6 +96,8 @@ RGBToXYZ
|
||||
|
||||
procedure RGBToXYZ(R, G, B: Integer;var x, y ,z: Extended);
|
||||
|
||||
.. _scriptref-xyztorgb:
|
||||
|
||||
XYZToRGB
|
||||
~~~~~~~~
|
||||
|
||||
@ -83,4 +105,5 @@ XYZToRGB
|
||||
|
||||
procedure XYZToRGB(X, Y, Z: Extended; var R, G, B: Integer);
|
||||
|
||||
|
||||
..
|
||||
TODO: Add CIE L*a*b.
|
||||
|
@ -37,6 +37,7 @@ components:
|
||||
a *TPointArray*.
|
||||
|
||||
.. note::
|
||||
|
||||
Other techniques exist, which involve relative point distance from one point
|
||||
to another; these are found in the :ref:`scriptref-dtm` section.
|
||||
|
||||
@ -51,6 +52,8 @@ Colour Finding Methods
|
||||
|
||||
A list of all colour finding methods in Simba.
|
||||
|
||||
.. _scriptref-similarcolors:
|
||||
|
||||
SimilarColors
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
@ -61,6 +64,8 @@ SimilarColors
|
||||
SimilarColors returns true if the two passed colours are *similar* given the
|
||||
passed *Tolerance*.
|
||||
|
||||
.. _scriptref-getcolor:
|
||||
|
||||
GetColor
|
||||
~~~~~~~~
|
||||
|
||||
@ -68,13 +73,19 @@ GetColor
|
||||
|
||||
function GetColor(x, y: Integer): Integer;
|
||||
|
||||
GetColor returns the color on the coordinate (*x*, *y*).
|
||||
GetColor returns the color on the coordinate *(x, y)*.
|
||||
|
||||
*Example: Printing the colour on coordinate (25, 25)*
|
||||
Example printing the colour on coordinate (25, 25).
|
||||
|
||||
.. code-block:: pascal
|
||||
|
||||
Writeln('Colour is ' + IntToStr(GetColor(25, 25)))
|
||||
program printcolour;
|
||||
|
||||
begin
|
||||
Writeln('Colour is ' + IntToStr(GetColor(25, 25)))
|
||||
end.
|
||||
|
||||
.. _scriptref-getcolors:
|
||||
|
||||
GetColors
|
||||
~~~~~~~~~
|
||||
@ -85,6 +96,7 @@ GetColors
|
||||
|
||||
GetColors returns an array of the colours at the given *Coords*.
|
||||
|
||||
.. _scriptref-countcolor:
|
||||
|
||||
CountColor
|
||||
~~~~~~~~~~
|
||||
@ -96,6 +108,8 @@ CountColor
|
||||
Returns how many times *Color* occurs in the area defined by (*xs*, *ys*),
|
||||
(*xe*, *ye*)
|
||||
|
||||
.. _scriptref-countcolortolerance:
|
||||
|
||||
CountColorTolerance
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@ -106,6 +120,8 @@ CountColorTolerance
|
||||
Returns how many times *Color* occurs (within *Tolerance*)
|
||||
in the area defined by (*xs*, *ys*), (*xe*, *ye*)
|
||||
|
||||
.. _scriptref-findcolor:
|
||||
|
||||
FindColor
|
||||
~~~~~~~~~
|
||||
|
||||
@ -121,6 +137,8 @@ The point is returned in *x* and *y*.
|
||||
It searches from the top left to the bottom right and will stop
|
||||
after matching a point.
|
||||
|
||||
.. _scriptref-findcolortolerance:
|
||||
|
||||
FindColorTolerance
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@ -137,6 +155,8 @@ Whether or not a colour is within the tolerance range is determined by the
|
||||
:ref:`scriptref_CTS` mode. It searches from the top left to the bottom right
|
||||
and will stop after matching a point.
|
||||
|
||||
.. _scriptref-findcolors:
|
||||
|
||||
FindColors
|
||||
~~~~~~~~~~
|
||||
|
||||
@ -148,6 +168,8 @@ FindColors returns a list of all points that match the colour *col* in an area
|
||||
defined by *x1*, *y1*, *x2*, *y2*. It returns true if one or more points have
|
||||
been found.
|
||||
|
||||
.. _scriptref-findcolorstolerance:
|
||||
|
||||
FindColorsTolerance
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@ -164,6 +186,8 @@ Whether or not a color is within the tolerance range is determined by the
|
||||
It searches from the top left to the bottom right and will find all
|
||||
matching points in the area.
|
||||
|
||||
.. _scriptref-findcolorspiral:
|
||||
|
||||
FindColorSpiral
|
||||
~~~~~~~~~~~~~~~
|
||||
|
||||
@ -174,6 +198,8 @@ FindColorSpiral
|
||||
|
||||
Same as FindColor, but starts searching from *x*, *y*.
|
||||
|
||||
.. _scriptref-findcolorspiraltolerance:
|
||||
|
||||
FindColorSpiralTolerance
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@ -184,6 +210,8 @@ FindColorSpiralTolerance
|
||||
|
||||
Same as FindColorTolerance, but starts searching from *x*, *y*.
|
||||
|
||||
.. _scriptref-findcolorsspiraltolerance:
|
||||
|
||||
FindColorsSpiralTolerance
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@ -194,6 +222,9 @@ FindColorsSpiralTolerance
|
||||
|
||||
Same as FindColorsTolerance, but starts searching from *x*, *y*.
|
||||
|
||||
.. _scriptref-findcoloredarea:
|
||||
.. _scriptref-findcoloredareatolerance:
|
||||
|
||||
Find areas of colours
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@ -215,7 +246,7 @@ FindColoredArea finds an area that consists out of Colours that match *Color* wi
|
||||
the given *Tolerance* and has a minimal size of *MinArea*.
|
||||
If you want minimal area of 5x5 pixels (25), then set MinArea to 25.
|
||||
|
||||
.. _scriptref_CTS:
|
||||
.. _scriptref-CTS:
|
||||
|
||||
Colour tolerance
|
||||
----------------
|
||||
@ -236,6 +267,11 @@ given a tolerance. There are three algorithms, from fastest to slowest:
|
||||
very little in hue. Luminance is assigned a somewhat static function, and
|
||||
has no modifier.
|
||||
|
||||
..
|
||||
TODO: CIE-Lab
|
||||
|
||||
.. _scriptref-gettolerancespeed:
|
||||
.. _scriptref-setcolortolerancespeed:
|
||||
|
||||
Get and Set Colour Tolerance
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
@ -258,12 +294,15 @@ function, which returns the current colour tolerance speed:
|
||||
|
||||
function GetToleranceSpeed: Integer;
|
||||
|
||||
*Example: Printing the Color Tolerance*
|
||||
Example printing the Color Tolerance
|
||||
|
||||
.. code-block:: pascal
|
||||
|
||||
Writeln(Format('Tolerance Speed = %d', [GetToleranceSpeed]))
|
||||
|
||||
.. _scriptref-settolerancespeed2modifiers:
|
||||
.. _scriptref-gettolerancespeed2modifiers:
|
||||
|
||||
Get And Set Colour Modifiers
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@ -280,14 +319,14 @@ Set colour speed 2 modifiers.
|
||||
SetToleranceSpeed2Modifiers(42.0, 0.4)
|
||||
|
||||
The following function
|
||||
|
||||
|
||||
.. code-block:: pascal
|
||||
|
||||
procedure GetToleranceSpeed2Modifiers(var hMod, sMod: Extended);
|
||||
|
||||
returns colour speed 2 modifiers.
|
||||
|
||||
*Example: Getting the modifiers*
|
||||
Example getting the modifiers:
|
||||
|
||||
.. code-block:: pascal
|
||||
|
||||
|
@ -54,7 +54,7 @@ MoveMouse moves the mouse pointer to the specified x and y coordinates.
|
||||
The following example will move the mouse to position *(10, 10)*; relative
|
||||
to the selected client. (To get to point (10, 10) visually, recall that (0, 0)
|
||||
is the *top left* part and to get to (10, 10) we move 10 pixels to the right,
|
||||
and ten pixels down.
|
||||
and ten pixels down.)
|
||||
|
||||
.. code-block:: pascal
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user