Commit 71aeb495 authored by Edwin Carlinet's avatar Edwin Carlinet
Browse files

Start documentation.

      *  doc/Doxyfile,
      *  doc/Makefile,
      *  doc/source/_static/code.css,
      *  doc/source/algorithms.rst,
      *  doc/source/concept.rst,
      *  doc/source/conf.py,
      *  doc/source/images.rst,
      *  doc/source/index.rst,
      *  doc/source/intro.rst,
      *  doc/source/morpho.rst,
      *  doc/source/pylene_lexer.py,
      *  doc/source/reference.rst,
      *  doc/source/snipsets/component_tree_1.cpp,
      *  doc/source/snipsets/images/roadsigns-square-2.png,
      *  doc/source/snipsets/images/roadsigns-square.png,
      *  doc/source/snipsets/images/roadsigns.png,
      *  doc/source/concept/extension.rst,
      *  doc/source/concept/image.rst,
      *  doc/source/concept/neighborhood.rst,
      *  doc/source/concept/range.rst,
      *  doc/source/tutorial.rst,
      *  doc/source/tutorial/component_tree.rst: New.
parent 05db8396
/build
/doc
\ No newline at end of file
/doc/build
/doc/html
/doc/doxyxml
......@@ -1559,7 +1559,8 @@ INCLUDE_FILE_PATTERNS =
PREDEFINED = MLN_DOXYGEN \
mln_concrete(I):=concrete<I> \
mln_ch_value(I,V):=ch_value<I,V>
mln_ch_value(I,V):=ch_value<I,V> \
decltype(M):=unspecified
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
......
doc:
sphinx-build -b html source build
doxy:
#doxygen
/lrde/home/stage/carlinet/Downloads/doxygen/bin/doxygen
extract:
#sudo systemctl start mongod.service
python extract-doxygen.py doxyxml pylene
create:
python create-rst.py pylene
clean :
rm -Rf build
\ No newline at end of file
@import url("css/theme.css");
.breatheparameterlist p {
display: inline;
}
.rst-content dl:not(.docutils) dt {
display: block;
margin-top: 0;
margin-bottom: 0;
}
.rst-content dl:not(.docutils) dt:last-child {
margin-bottom: 6px;
}
.rst-content dl:not(.docutils) dl dt {
display: block;
margin-top: 0;
margin-bottom: 0;
}
Algorithms
==========
.. doxygengroup:: Algorithms
Concepts
========
.. toctree::
concept/image.rst
concept/neighborhood.rst
concept/extension.rst
concept/range.rst
Extension (Concept)
===================
.. concept:: Extension
Extension (Overview)
--------------------
An extension is the way to extend and define image values outside its
definition domain. It has two objectives:
* It allows the user to define side-effects (border effects) for some algorithms.
* It allows the algorithms to speed up their processing time thanks to
the padding trick.
Any algorithm is allowed to modify the extenion of an image. This
means that even if the image is constant, e.g. the input of an
algorithm, the algorithm is allowed to write the input's extension.
* `E`: A model of :concept:`Extension`
* `ext`: An instance of `E`
.. rubric:: `Type definition`
:class: concept-typedefs
+--------------------------------+-------+------------------------------------------------+-------------------+
|Type | Abbr | Definition |Requirements |
+================================+=======+================================================+===================+
| `E::support_fill` | | either `std::true_type` or `std::false_type` | |
+--------------------------------+-------+------------------------------------------------+-------------------+
| `E::support_mirror` | | either `std::true_type` or `std::false_type` | |
+--------------------------------+-------+------------------------------------------------+-------------------+
| `E::support_periodize` | | either `std::true_type` or `std::false_type` | |
+--------------------------------+-------+------------------------------------------------+-------------------+
.. rubric:: `Valid expression`
:class: concept-expr
+----------------------+--------------+-----------------------------------------+-----------------------------------------------+
|Expression | Return Type | Precondition | Sementics |
+======================+==============+=========================================+===============================================+
| ``ext.fill(v)`` | | `E::support_fill` is `std::true_type` | Fill the extension with value `v` |
+----------------------+--------------+-----------------------------------------+-----------------------------------------------+
| ``ext.mirror()`` | | `E::support_mirror` is `std::true_type` | Fill the extension by mirrorizing the image. |
+----------------------+--------------+-----------------------------------------+-----------------------------------------------+
| ``ext.periodize()`` | |`E::support_periodize` is | Fill the extension by periodizing the image. |
| | |`std::true_type` | |
+----------------------+--------------+-----------------------------------------+-----------------------------------------------+
This diff is collapsed.
Neighborhood/Window/SE (Concept)
================================
.. contents::
:local:
.. concept:: SE
Structuring Element (Overview)
------------------------------
Neighborhoods, Structuring Elements (SE), Windows are all objects that
enable to iterate locally on the pixels of an image around a given
point. There are all the same concept but differ in semantics:
Neighborhoods
Neighborhoods are usually used to define the connectivity of the
image, e.g. for 2D images, it is usually the 4-connectivity or the
8-connectivity.
Structuring Elements
*Structuring Element* is the common term in Mathematical Morphology to
define a structure
Windows
*Sliding window* is the common term to designate a square *Structuring
Element*. It generally refers to 2D grid.
A structuring element 𝑩 is a range generator: given a point `p`
(resp. a pixel `px`) it provides the set of points or pixels
:math:`\mathcal{B}(p)` centered in `p`. Two kinds of range may be
generated:
* :math:`\mathcal{B}(p)` provides a range of points
* :math:`\mathcal{B}(px)` provides a range of pixels from the same image of `px`
Depending of the nature of `p` or `px`, the range will "follow" the
binded point/pixel:
* if `p` or `px` is an *rvalue*, the point or the pixel is copied and
the generated range is contant.
* if `p` or `px` is a *lvalue*, a reference to the point or the pixel
is taken. The range is bounded to it. Any modification to `p` or `px`,
alters the generated range. It invalidates any iterator currently on
the range::
box2d box = { {0,0}, {3,4} };
point2d p;
mln_iter(q, c4(p));
mln_foreach(p, box)
mln_forall(q)
p = point2d{10,10};
std::cout << *q; // unspecified behavior
Overview of the concept.
+-------------------------------+-------------------------------------------------------------------+
|Categorie |Operations |
+===============================+===================================================================+
|Adapatative SE |Iterate over SE whose elements are dependant on the current point |
| | |
| | |
| | |
+----+--------------------------+-------------------------------------------------------------------+
| | Dynamic SE |Iterate over SE whose elements are constant but known at run time. |
| | | |
| | | |
| | | |
+----+----+---------------------+-------------------------------------------------------------------+
| | | Static SE |Iterate over SE whose elements are constant, size known at compile |
| | | |time |
| | | | |
| | | | |
+----+----+----+----------------+-------------------------------------------------------------------+
| | | | Constant SE |Iterate over SE whose elements are kwown at compile time. |
| | | | | |
| | | | | |
+----+----+----+----------------+-------------------------------------------------------------------+
.. concept:: Adaptative SE
Adaptative Structuring Element
------------------------------
* `SE`: A model of :concept:`Adaptative SE`
* `se`: An *constant* instance of `SE`
.. rubric:: `Type definition`
:class: concept-typedefs
+---------------------+--------------------------------+----------------------------------------------+
|Type | Definition |Requirements |
+=====================+================================+==============================================+
|`SE::category` | |Convertible to `adaptative_neighborhood_tag` |
+---------------------+--------------------------------+----------------------------------------------+
|`SE::is_incremental` |either `std::true_type` or | |
| |`std:false_type` | |
+---------------------+--------------------------------+----------------------------------------------+
| | | |
+---------------------+--------------------------------+----------------------------------------------+
.. rubric:: `Valid expression`
:class: concept-expr
+----------------------+----------------+----------------------------------------------------------+
|Expression | Return Type | Sementics |
+======================+================+==========================================================+
| ``se(p)`` | *undefined* |Return a :concept:`Forward Range` of points centered in |
| | |the point `p` or given by `p` if `p` is a point iterator. |
| | | |
+----------------------+----------------+----------------------------------------------------------+
| ``se(px)`` | *undefined* |Return a :concept:`Forward Range` of pixels centered in |
| | |the pixel `px` or given by `px` if `px` is a pixel |
| | |iterator. |
+----------------------+----------------+----------------------------------------------------------+
| ``se.has(p)`` | `boolean` |True if `p` is in the se. |
+----------------------+----------------+----------------------------------------------------------+
| ``se.is_centered()`` | `boolean` |Equivalent to ``se.has(literal::zero)`` |
+----------------------+----------------+----------------------------------------------------------+
| | | |
+----------------------+----------------+----------------------------------------------------------+
.. concept:: Dynamic SE
Dynamic Structuring Element
---------------------------
The dynamic structuring element refines the :concept:`Adaptative
SE`. The SE is not locally dependant to the current location and stays
the same anywhere in the domain.
.. rubric:: `Type definition`
:class: concept-typedefs
+--------------------------------+-------+-----------------+----------------------------------------------+
|Type | Abbr | Definition |Requirements |
| | | | |
+================================+=======+=================+==============================================+
|`SE::category` | | |Convertible to `dynamic_neighborhood_tag` |
+--------------------------------+-------+-----------------+----------------------------------------------+
.. rubric:: `Valid expression`
:class: concept-expr
+----------------------+-------------------------+----------------+------------------------------------------------------+
|Expression | Return Type | Precondition | Sementics |
+======================+=========================+================+======================================================+
| ``se.size()`` | `unsigned` | | The number of elements in the SE. |
+----------------------+-------------------------+----------------+------------------------------------------------------+
.. concept:: Static SE
Static Structuring Element
--------------------------
The static structuring element refines the :concept:`Dynamic SE`. The
only difference is that the static SE known the size of the SE at
compile time.
.. rubric:: `Type definition`
:class: concept-typedefs
+--------------------------------+-------+-----------------+----------------------------------------------+
|Type | Abbr | Definition |Requirements |
| | | | |
+================================+=======+=================+==============================================+
|`SE::category` | | |Convertible to `static_neighborhood_tag` |
+--------------------------------+-------+-----------------+----------------------------------------------+
.. rubric:: `Valid expression`
:class: concept-expr
+--------------------+-----------------+------------------------------------------------------------------+
|Expression | Return Type | Sementics |
+====================+=================+==================================================================+
| ``se.size()`` | `unsigned` |The number of elements in the SE as a *constant expression* |
| | | |
+--------------------+-----------------+------------------------------------------------------------------+
.. concept:: Constant SE
Constant Structuring Element
----------------------------
The constant structuring element refines the :concept:`Static SE`. The
only difference is that the constant SE known the size and the elemnts
of the SE at compile time.
.. rubric:: `Type definition`
:class: concept-typedefs
+--------------------------------+-------+--------------------+----------------------------------------------+
|Type | Abbr | Definition |Requirements |
| | | | |
+================================+=======+====================+==============================================+
|`SE::category` | | |Convertible to `constant_neighborhood_tag` |
+--------------------------------+-------+--------------------+----------------------------------------------+
.. rubric:: `Valid expression`
:class: concept-expr
+----------------------+----------------+-----------------------------------------------------------------+
|Expression | Return Type | Sementics |
+======================+================+=================================================================+
| ``se.has(p)`` | `boolean` | True if `p` is in the se as a *constant expression*. |
+----------------------+----------------+-----------------------------------------------------------------+
| ``se.is_centered()`` | `boolean` |Equivalent to ``se.has(literal::zero)`` as a *constant |
| | |expression*. |
+----------------------+----------------+-----------------------------------------------------------------+
.. concept:: Incremental SE
Incremental Structuring Element
---------------------------------
A SE is said to be *incremental*, if it enables to give the points
that are added or removed to the range given a *basic deplacement* of
the point, e.g. for `point2d`, the basic deplacement is `(0,1)`. This
is usually used to compute attributes over a sliding SE in linear
time.
.. rubric:: `Type definition`
:class: concept-typedefs
+--------------------------------+-------+--------------------+----------------------------------------------+
|Type | Abbr | Definition |Requirements |
| | | | |
+================================+=======+====================+==============================================+
|`SE::is_incremental` | | `std::true_type` | |
+--------------------------------+-------+--------------------+----------------------------------------------+
|`SE::dec_type` | | | A model of :concept:`SE` |
+--------------------------------+-------+--------------------+----------------------------------------------+
|`SE::inc_type` | | | A model of :concept:`SE` |
+--------------------------------+-------+--------------------+----------------------------------------------+
.. rubric:: `Valid expression`
:class: concept-expr
+----------------------+-------------------------+---------------------------------------------------------+
|Expression | Return Type | Sementics |
+======================+=========================+=========================================================+
| ``se.inc()`` | `SE::inc_type` |A SE equivalent to :math:`\Delta\mathcal{B}^+(p) = |
| | |\mathcal{B}(p) \setminus (\mathcal{B}(p) \cap |
| | |\mathcal{B}(\mathrm{prev}))` |
+----------------------+-------------------------+---------------------------------------------------------+
| ``se.dec()`` | `SE::dec_type` |A SE `s` equivalent to :math:`\Delta\mathcal{B}^-(p) = |
| | |\mathcal{B}(\mathrm{prev}) \setminus (\mathcal{B}(p) \cap|
| | |\mathcal{B}(\mathrm{prev}))` |
+----------------------+-------------------------+---------------------------------------------------------+
Range (Concept)
===============
.. contents::
:local:
.. concept:: Forward Range
Forward Range
-------------
* `R`: A model of :concept:`Forward Range`
* `r`: An instance of `R`
* `cr`: A constant instance of `R`
.. rubric:: `Type definition`
:class: concept-typedefs
+------------------------------+-------+-------------------------------------------+-------------------------------------------+
| Type | Abbr | Definition | Requirements |
+==============================+=======+===========================================+===========================================+
| `range_value<R>::type` | | | |
+------------------------------+-------+-------------------------------------------+-------------------------------------------+
| `range_iterator<R>::type` | | | |
+------------------------------+-------+-------------------------------------------+-------------------------------------------+
.. rubric:: `Valid expression`
:class: concept-expr
+-------------------+--------------------------------+----------------+------------------------------------------------------+
|Expression | Return Type | Precondition | Sementics |
+===================+================================+================+======================================================+
| ``r.iter()`` | ``range_iterator<R>::type`` | | Return an iterator to the beginning of the range |
+-------------------+--------------------------------+----------------+------------------------------------------------------+
.. concept:: Bidirectional Range
Bidirectional Range
-------------------
# -*- coding: utf-8 -*-
#
# Pylene documentation build configuration file, created by
# sphinx-quickstart on Fri May 17 20:02:19 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys, os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('.'))
sys.path.append( os.path.abspath("..") )
import pylene_lexer
# -- General configuration -----------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.coverage', 'sphinx.ext.mathjax', 'sphinx.ext.ifconfig', 'breathe', "ext.conceptdoc"]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix of source filenames.
source_suffix = '.rst'
# The encoding of source files.
#source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = u'Pylene'
copyright = u'2013, EC'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '0.1'
# The full version, including alpha/beta/rc tags.
release = '0.1'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
language = "c++"
highlight_language = "pylenecpp"
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = []
# The reST default role (used for this markup: `text`) to use for all documents.
#default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []
# -- Options for HTML output ---------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'sphinx_rtd_theme'
html_style = "code.css"
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = []
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
#html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#html_logo = None
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#html_favicon = None
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
#html_last_updated_fmt = '%b %d, %Y'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}
# If false, no module index is generated.
#html_domain_indices = True
# If false, no index is generated.
#html_use_index = True
# If true, the index is split into individual pages for each letter.
#html_split_index = False
# If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#html_show_sphinx = True
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#html_show_copyright = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = None
# Output file base name for HTML help builder.
htmlhelp_basename = 'Pylenedoc'
# -- Options for LaTeX output --------------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#'preamble': '',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'Pylene.tex', u'Pylene Documentation',
u'EC', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False
# If true, show page references after internal links.
#latex_show_pagerefs = False