mirror of
https://github.com/moparisthebest/Simba
synced 2024-11-24 10:12:20 -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
|
Colour Conversions
|
||||||
==================
|
==================
|
||||||
|
|
||||||
|
..
|
||||||
|
TODO:
|
||||||
|
|
||||||
Colour spaces
|
Colour spaces
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
@ -12,6 +15,7 @@ Explain some colour spaces here.
|
|||||||
Colour Conversion Methods
|
Colour Conversion Methods
|
||||||
-------------------------
|
-------------------------
|
||||||
|
|
||||||
|
.. _scriptref-colortorgb:
|
||||||
|
|
||||||
ColorToRGB
|
ColorToRGB
|
||||||
~~~~~~~~~~
|
~~~~~~~~~~
|
||||||
@ -20,6 +24,8 @@ ColorToRGB
|
|||||||
|
|
||||||
procedure ColorToRGB(Color: integer; var r, g, b: Integer);
|
procedure ColorToRGB(Color: integer; var r, g, b: Integer);
|
||||||
|
|
||||||
|
.. _scriptref-rgbtocolor:
|
||||||
|
|
||||||
RGBtoColor
|
RGBtoColor
|
||||||
~~~~~~~~~~
|
~~~~~~~~~~
|
||||||
|
|
||||||
@ -27,6 +33,8 @@ RGBtoColor
|
|||||||
|
|
||||||
function RGBtoColor(r, g, b: Integer): TColor;
|
function RGBtoColor(r, g, b: Integer): TColor;
|
||||||
|
|
||||||
|
.. _scriptref-colortohsl:
|
||||||
|
|
||||||
ColorToHSL
|
ColorToHSL
|
||||||
~~~~~~~~~~
|
~~~~~~~~~~
|
||||||
|
|
||||||
@ -34,6 +42,8 @@ ColorToHSL
|
|||||||
|
|
||||||
procedure ColorToHSL(Color: Integer; var h, s, l: Extended);
|
procedure ColorToHSL(Color: Integer; var h, s, l: Extended);
|
||||||
|
|
||||||
|
.. _scriptref-hsltocolor:
|
||||||
|
|
||||||
HSLToColor
|
HSLToColor
|
||||||
~~~~~~~~~~
|
~~~~~~~~~~
|
||||||
|
|
||||||
@ -41,6 +51,8 @@ HSLToColor
|
|||||||
|
|
||||||
function HSLToColor(H, S, L: Extended): TColor;
|
function HSLToColor(H, S, L: Extended): TColor;
|
||||||
|
|
||||||
|
.. _scriptref-colortoxyz:
|
||||||
|
|
||||||
ColorToXYZ
|
ColorToXYZ
|
||||||
~~~~~~~~~~
|
~~~~~~~~~~
|
||||||
|
|
||||||
@ -48,6 +60,8 @@ ColorToXYZ
|
|||||||
|
|
||||||
procedure ColorToXYZ(Color: Integer; var x, y, z: Extended);
|
procedure ColorToXYZ(Color: Integer; var x, y, z: Extended);
|
||||||
|
|
||||||
|
.. _scriptref-xyztocolor:
|
||||||
|
|
||||||
XYZToColor
|
XYZToColor
|
||||||
~~~~~~~~~~
|
~~~~~~~~~~
|
||||||
|
|
||||||
@ -55,6 +69,8 @@ XYZToColor
|
|||||||
|
|
||||||
function XYZToColor(X, Y, Z: Extended): TColor;
|
function XYZToColor(X, Y, Z: Extended): TColor;
|
||||||
|
|
||||||
|
.. _scriptref-rgbtohsl:
|
||||||
|
|
||||||
RGBToHSL
|
RGBToHSL
|
||||||
~~~~~~~~
|
~~~~~~~~
|
||||||
|
|
||||||
@ -62,6 +78,8 @@ RGBToHSL
|
|||||||
|
|
||||||
procedure RGBToHSL(R, G, B: Integer; var h, s, l: Extended);
|
procedure RGBToHSL(R, G, B: Integer; var h, s, l: Extended);
|
||||||
|
|
||||||
|
.. _scriptref-hsltorgb:
|
||||||
|
|
||||||
HSLtoRGB
|
HSLtoRGB
|
||||||
~~~~~~~~
|
~~~~~~~~
|
||||||
|
|
||||||
@ -69,6 +87,8 @@ HSLtoRGB
|
|||||||
|
|
||||||
procedure HSLtoRGB(H, S, L: extended; var R, G ,B: Integer);
|
procedure HSLtoRGB(H, S, L: extended; var R, G ,B: Integer);
|
||||||
|
|
||||||
|
.. _scriptref-rgbtoxyz:
|
||||||
|
|
||||||
RGBToXYZ
|
RGBToXYZ
|
||||||
~~~~~~~~
|
~~~~~~~~
|
||||||
|
|
||||||
@ -76,6 +96,8 @@ RGBToXYZ
|
|||||||
|
|
||||||
procedure RGBToXYZ(R, G, B: Integer;var x, y ,z: Extended);
|
procedure RGBToXYZ(R, G, B: Integer;var x, y ,z: Extended);
|
||||||
|
|
||||||
|
.. _scriptref-xyztorgb:
|
||||||
|
|
||||||
XYZToRGB
|
XYZToRGB
|
||||||
~~~~~~~~
|
~~~~~~~~
|
||||||
|
|
||||||
@ -83,4 +105,5 @@ XYZToRGB
|
|||||||
|
|
||||||
procedure XYZToRGB(X, Y, Z: Extended; var R, G, B: Integer);
|
procedure XYZToRGB(X, Y, Z: Extended; var R, G, B: Integer);
|
||||||
|
|
||||||
|
..
|
||||||
|
TODO: Add CIE L*a*b.
|
||||||
|
@ -37,6 +37,7 @@ components:
|
|||||||
a *TPointArray*.
|
a *TPointArray*.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
Other techniques exist, which involve relative point distance from one point
|
Other techniques exist, which involve relative point distance from one point
|
||||||
to another; these are found in the :ref:`scriptref-dtm` section.
|
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.
|
A list of all colour finding methods in Simba.
|
||||||
|
|
||||||
|
.. _scriptref-similarcolors:
|
||||||
|
|
||||||
SimilarColors
|
SimilarColors
|
||||||
~~~~~~~~~~~~~
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
@ -61,6 +64,8 @@ SimilarColors
|
|||||||
SimilarColors returns true if the two passed colours are *similar* given the
|
SimilarColors returns true if the two passed colours are *similar* given the
|
||||||
passed *Tolerance*.
|
passed *Tolerance*.
|
||||||
|
|
||||||
|
.. _scriptref-getcolor:
|
||||||
|
|
||||||
GetColor
|
GetColor
|
||||||
~~~~~~~~
|
~~~~~~~~
|
||||||
|
|
||||||
@ -68,13 +73,19 @@ GetColor
|
|||||||
|
|
||||||
function GetColor(x, y: Integer): Integer;
|
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
|
.. code-block:: pascal
|
||||||
|
|
||||||
|
program printcolour;
|
||||||
|
|
||||||
|
begin
|
||||||
Writeln('Colour is ' + IntToStr(GetColor(25, 25)))
|
Writeln('Colour is ' + IntToStr(GetColor(25, 25)))
|
||||||
|
end.
|
||||||
|
|
||||||
|
.. _scriptref-getcolors:
|
||||||
|
|
||||||
GetColors
|
GetColors
|
||||||
~~~~~~~~~
|
~~~~~~~~~
|
||||||
@ -85,6 +96,7 @@ GetColors
|
|||||||
|
|
||||||
GetColors returns an array of the colours at the given *Coords*.
|
GetColors returns an array of the colours at the given *Coords*.
|
||||||
|
|
||||||
|
.. _scriptref-countcolor:
|
||||||
|
|
||||||
CountColor
|
CountColor
|
||||||
~~~~~~~~~~
|
~~~~~~~~~~
|
||||||
@ -96,6 +108,8 @@ CountColor
|
|||||||
Returns how many times *Color* occurs in the area defined by (*xs*, *ys*),
|
Returns how many times *Color* occurs in the area defined by (*xs*, *ys*),
|
||||||
(*xe*, *ye*)
|
(*xe*, *ye*)
|
||||||
|
|
||||||
|
.. _scriptref-countcolortolerance:
|
||||||
|
|
||||||
CountColorTolerance
|
CountColorTolerance
|
||||||
~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
@ -106,6 +120,8 @@ CountColorTolerance
|
|||||||
Returns how many times *Color* occurs (within *Tolerance*)
|
Returns how many times *Color* occurs (within *Tolerance*)
|
||||||
in the area defined by (*xs*, *ys*), (*xe*, *ye*)
|
in the area defined by (*xs*, *ys*), (*xe*, *ye*)
|
||||||
|
|
||||||
|
.. _scriptref-findcolor:
|
||||||
|
|
||||||
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
|
It searches from the top left to the bottom right and will stop
|
||||||
after matching a point.
|
after matching a point.
|
||||||
|
|
||||||
|
.. _scriptref-findcolortolerance:
|
||||||
|
|
||||||
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
|
:ref:`scriptref_CTS` mode. It searches from the top left to the bottom right
|
||||||
and will stop after matching a point.
|
and will stop after matching a point.
|
||||||
|
|
||||||
|
.. _scriptref-findcolors:
|
||||||
|
|
||||||
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
|
defined by *x1*, *y1*, *x2*, *y2*. It returns true if one or more points have
|
||||||
been found.
|
been found.
|
||||||
|
|
||||||
|
.. _scriptref-findcolorstolerance:
|
||||||
|
|
||||||
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
|
It searches from the top left to the bottom right and will find all
|
||||||
matching points in the area.
|
matching points in the area.
|
||||||
|
|
||||||
|
.. _scriptref-findcolorspiral:
|
||||||
|
|
||||||
FindColorSpiral
|
FindColorSpiral
|
||||||
~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
@ -174,6 +198,8 @@ FindColorSpiral
|
|||||||
|
|
||||||
Same as FindColor, but starts searching from *x*, *y*.
|
Same as FindColor, but starts searching from *x*, *y*.
|
||||||
|
|
||||||
|
.. _scriptref-findcolorspiraltolerance:
|
||||||
|
|
||||||
FindColorSpiralTolerance
|
FindColorSpiralTolerance
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
@ -184,6 +210,8 @@ FindColorSpiralTolerance
|
|||||||
|
|
||||||
Same as FindColorTolerance, but starts searching from *x*, *y*.
|
Same as FindColorTolerance, but starts searching from *x*, *y*.
|
||||||
|
|
||||||
|
.. _scriptref-findcolorsspiraltolerance:
|
||||||
|
|
||||||
FindColorsSpiralTolerance
|
FindColorsSpiralTolerance
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
@ -194,6 +222,9 @@ FindColorsSpiralTolerance
|
|||||||
|
|
||||||
Same as FindColorsTolerance, but starts searching from *x*, *y*.
|
Same as FindColorsTolerance, but starts searching from *x*, *y*.
|
||||||
|
|
||||||
|
.. _scriptref-findcoloredarea:
|
||||||
|
.. _scriptref-findcoloredareatolerance:
|
||||||
|
|
||||||
Find areas of colours
|
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*.
|
the given *Tolerance* and has a minimal size of *MinArea*.
|
||||||
If you want minimal area of 5x5 pixels (25), then set MinArea to 25.
|
If you want minimal area of 5x5 pixels (25), then set MinArea to 25.
|
||||||
|
|
||||||
.. _scriptref_CTS:
|
.. _scriptref-CTS:
|
||||||
|
|
||||||
Colour tolerance
|
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
|
very little in hue. Luminance is assigned a somewhat static function, and
|
||||||
has no modifier.
|
has no modifier.
|
||||||
|
|
||||||
|
..
|
||||||
|
TODO: CIE-Lab
|
||||||
|
|
||||||
|
.. _scriptref-gettolerancespeed:
|
||||||
|
.. _scriptref-setcolortolerancespeed:
|
||||||
|
|
||||||
Get and Set Colour Tolerance
|
Get and Set Colour Tolerance
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
@ -258,12 +294,15 @@ function, which returns the current colour tolerance speed:
|
|||||||
|
|
||||||
function GetToleranceSpeed: Integer;
|
function GetToleranceSpeed: Integer;
|
||||||
|
|
||||||
*Example: Printing the Color Tolerance*
|
Example printing the Color Tolerance
|
||||||
|
|
||||||
.. code-block:: pascal
|
.. code-block:: pascal
|
||||||
|
|
||||||
Writeln(Format('Tolerance Speed = %d', [GetToleranceSpeed]))
|
Writeln(Format('Tolerance Speed = %d', [GetToleranceSpeed]))
|
||||||
|
|
||||||
|
.. _scriptref-settolerancespeed2modifiers:
|
||||||
|
.. _scriptref-gettolerancespeed2modifiers:
|
||||||
|
|
||||||
Get And Set Colour Modifiers
|
Get And Set Colour Modifiers
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
@ -287,7 +326,7 @@ The following function
|
|||||||
|
|
||||||
returns colour speed 2 modifiers.
|
returns colour speed 2 modifiers.
|
||||||
|
|
||||||
*Example: Getting the modifiers*
|
Example getting the modifiers:
|
||||||
|
|
||||||
.. code-block:: pascal
|
.. 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
|
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)
|
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,
|
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
|
.. code-block:: pascal
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user