aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.in9
-rw-r--r--doc/info/chap/functions.texinfo75
-rw-r--r--doc/info/content.texinfo3
3 files changed, 84 insertions, 3 deletions
diff --git a/Makefile.in b/Makefile.in
index b735d36..842c3cf 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -56,8 +56,10 @@ _TEXINFO_DIRLEVELS = 2
_INFOPARTS = 0
_HAVE_TEXINFO_MANUAL = yes
_HTML_FILES = Free-Software-Needs-Free-Documentation.html GNU-Free-Documentation-License.html \
- GNU-General-Public-License.html index.html Overview.html CLUT-Manipulation.html \
- Colour-Spaces.html
+ GNU-General-Public-License.html index.html Overview.html Colour-Spaces.html \
+ Illuminants.html Functions.html CIE-1960-UCS.html CIELAB.html CIELCh.html \
+ CIELUV.html CIEUVW.html CIExyY.html CIEXYZ.html RGB.html sRGB.html YCgCo.html \
+ YDbDr.html YIQ.html YPbPr.html YUV.html
# Used by mk/man.mk
#_MAN_PAGE_SECTIONS = 0 3 7
@@ -72,7 +74,8 @@ _COPYING = COPYING
___EVERYTHING_INFO = autohaltd titlepage-data content hardcopy-copying \
appx/fdl appx/free-software-needs-free-documentation appx/gpl \
reusable/macros reusable/paper reusable/titlepage \
- chap/overview chap/clut-manipulation.texinfo chap/colour-spaces.texinfo
+ chap/overview chap/colour-spaces.texinfo chap/illuminants.texinfo \
+ chap/functions.texinfo
_EVERYTHING = $(__EVERYTHING_ALL_COMMON) DEPENDENCIES INSTALL NEWS \
$(foreach F,$(___EVERYTHING_INFO),doc/info/$(F).texinfo) libcolour.h
diff --git a/doc/info/chap/functions.texinfo b/doc/info/chap/functions.texinfo
new file mode 100644
index 0000000..9f98353
--- /dev/null
+++ b/doc/info/chap/functions.texinfo
@@ -0,0 +1,75 @@
+@node Functions
+@chapter Functions
+
+The following functions are available in @command{libcolour}:
+
+@table @code
+@item int libcolour_convert(const libcolour_colour_t* restrict, libcolour_colour_t* restrict)
+Colour space and colour model conversion.
+Described in @ref{Colour Spaces}.
+
+@item double libcolour_srgb_encode(double)
+Apply the sRGB transfer function.
+Described in @ref{sRGB}.
+
+@item double libcolour_srgb_decode(double)
+Unapply the sRGB transfer function.
+Described in @ref{sRGB}.
+
+@item int libcolour_delta_e(const libcolour_colour_t*, const libcolour_colour_t*, double*)
+Calculates the @math{\Delta e^*_{ab}} distance
+(the distance in CIE L*a*b*) of two colours.
+
+@item int libcolour_proper(libcolour_colour_t*)
+Sets any member or submember that may be
+incorrectly set. Returns 0 on success, and
+@math{-1} on error. On error @code{errno}
+set appropriately. Error is only possible
+is there is something wrong with the described
+colour space that cannot be fixed.
+
+@item int libcolour_get_rgb_colour_space(libcolour_rgb_t*, libcolour_rgb_colour_space_t)
+Selects RGB colour space.
+Described in @ref{RGB}.
+
+@item size_t libcolour_marshal(const libcolour_colour_t*, void*)
+Store a colour into a buffer, and returns the number
+of bytes written. If @code{NULL} is given instead of
+a buffer, the number of bytes that would have been
+written is returned.
+
+This function will always write an @code{int} that
+is used to identify the version of @command{libcolour}
+so it can be decoded by future versions.
+
+In addition to this @code{int}, all the content of
+the structure is copied, so uninitialised values
+can be copied. However, it will never copy more than
+the size of the structure used to represent colours
+with used colour model. For example, is the @code{.model}
+member if the colour is set to @code{LIBCOLOUR_SRGB},
+no more than @code{sizeof(libcolour_srgb_t)} is written
+in addition to the initial @code{int}. If the value
+of @code{.model} is invalid, 0 is returned and
+@code{errno} is set to @code{EINVAL}.
+
+The written data is machine architecture specific.
+
+@item size_t libcolour_unmarshal(libcolour_colour_t*, const void*)
+Restores a colour from a buffer, and returns the number
+of bytes read. If @code{NULL} is given instead of
+an output pointer for the colour, the number of bytes
+that would have been read is returned.
+
+If the stored @code{int} at the beginning does
+not match a recognised version of @command{libcolour},
+0 is returned and errno is set to @code{EINVAL}, this
+also happens if the stored colour does not used
+a recognised colour model.
+
+If the stored colour uses a custom (not pre-defined)
+RGB colour space with custom a transfer function, the
+user must set them after calling @code{libcolour_unmarshal}.
+
+@end table
+
diff --git a/doc/info/content.texinfo b/doc/info/content.texinfo
index eee47a3..4ad71d5 100644
--- a/doc/info/content.texinfo
+++ b/doc/info/content.texinfo
@@ -11,6 +11,7 @@
* Overview:: Brief overview of @command{libcolour}.
* Colour Spaces:: Colour-space conversion.
* Illuminants:: Illuminant initialisers.
+* Functions:: Functions available in @command{libcolour}.
* Free Software Needs Free Documentation:: Why free documentation is important.
* GNU General Public License:: Copying and sharing @command{libcolour}.
@@ -39,6 +40,7 @@ Colour Spaces
Illuminants
+Functions
Free Software Needs Free Documentation
@@ -53,6 +55,7 @@ GNU Free Documentation License
@include chap/overview.texinfo
@include chap/colour-spaces.texinfo
@include chap/illuminants.texinfo
+@include chap/functions.texinfo
@include appx/free-software-needs-free-documentation.texinfo