Pixel concepts ============== .. contents:: Table of Contents :local: .. _concept-Pixel: Pixel ----- Let `Pix` be a type that models :ref:`Pixel (details) `. Then `Pix` also models :ref:`Regular (fundamentals) ` .. _concept-Pixel-types: .. rubric:: Types Then we can define : +-------------------+--------------------------------+---------------------------------------+ | Definition | Description | Requirement | +===================+================================+=======================================+ | `Pix::point_type` | type of a point | models :ref:`concept-Point` concept | +-------------------+--------------------------------+---------------------------------------+ | `Pix::value_type` | type of a value | - models :ref:`concept-Value` concept | | | | - non-const | | | | - not a reference | +-------------------+--------------------------------+---------------------------------------+ | `Pix::image_type` | type of the image | models :ref:`concept-Image` concept | +-------------------+--------------------------------+---------------------------------------+ | `Pix::reference` | type of a reference on a value | | +-------------------+--------------------------------+---------------------------------------+ .. _concept-Pixel-expressions: .. rubric:: Expressions Let : - ``pix`` be an instance of `Pix`. - ``pix_cpy`` be an instance of `Pix`. - ``cpix`` be an instance of `const Pix`. - ``lhs`` be an instance of `const Pix`. - ``rhs`` be an instance of `const Pix`. Then we have the following valid expressions : +-------------------------+--------------------+---------------+----------------+---------------------------------------------------+ | Expression | Return type | Pre-condition | Post-condition | Description | +=========================+====================+===============+================+===================================================+ | ``pix()`` | `Pix` | none | none | Constructs a pixel ``pix`` of type `Pix` | +-------------------------+--------------------+---------------+----------------+---------------------------------------------------+ | ``cpix()`` | `const Pix` | none | none | Constructs a pixel ``cpix`` of type `Pix` | +-------------------------+--------------------+---------------+----------------+---------------------------------------------------+ | ``pix_cpy(pix)`` | `Pix` | none | none | Copy-constructs a pixel ``pix_cpy`` from ``pix`` | +-------------------------+--------------------+---------------+----------------+---------------------------------------------------+ | ``pix_cpy(cpix)`` | `Pix` | none | none | Copy-constructs a pixel ``pix_cpy`` from ``cpix`` | +-------------------------+--------------------+---------------+----------------+---------------------------------------------------+ | ``pix_cpy(move(pix))`` | `Pix` | none | none | Move-constructs a pixel ``pix_cpy`` from ``pix`` | +-------------------------+--------------------+---------------+----------------+---------------------------------------------------+ | ``pix_cpy = pix`` | `Pix&` | none | none | Assign ``pix`` to ``pix_cpy`` | +-------------------------+--------------------+---------------+----------------+---------------------------------------------------+ | ``pix_cpy = cpix`` | `Pix&` | none | none | Assign ``cpix`` to ``pix_cpy`` | +-------------------------+--------------------+---------------+----------------+---------------------------------------------------+ | ``pix_cpy = move(pix)`` | `Pix&` | none | none | Move-assign ``pix`` to ``pix_cpy`` | +-------------------------+--------------------+---------------+----------------+---------------------------------------------------+ | ``lhs == rhs`` | `bool` | none | none | Compare wether two pixels are equal | +-------------------------+--------------------+---------------+----------------+---------------------------------------------------+ | ``lhs != rhs`` | `bool` | none | none | Compare wether two pixels are different | +-------------------------+--------------------+---------------+----------------+---------------------------------------------------+ | ``rhs == lhs`` | `bool` | none | none | Compare wether two pixels are equal | +-------------------------+--------------------+---------------+----------------+---------------------------------------------------+ | ``rhs != lhs`` | `bool` | none | none | Compare wether two pixels are different | +-------------------------+--------------------+---------------+----------------+---------------------------------------------------+ | ``pix.value()`` | `reference` | none | none | Access the value of the pixel ``pix`` | +-------------------------+--------------------+---------------+----------------+---------------------------------------------------+ | ``pix.point()`` | `point_type` | none | none | Access the point of the pixel ``pix`` | +-------------------------+--------------------+---------------+----------------+---------------------------------------------------+ | ``pix.image()`` | `image_type` | none | none | Access the image of the pixel ``pix`` | +-------------------------+--------------------+---------------+----------------+---------------------------------------------------+ | ``cpix.value()`` | `const reference` | none | none | Access the value of the pixel ``pix`` | +-------------------------+--------------------+---------------+----------------+---------------------------------------------------+ | ``cpix.point()`` | `const point_type` | none | none | Access the point of the pixel ``pix`` | +-------------------------+--------------------+---------------+----------------+---------------------------------------------------+ | ``cpix.image()`` | `const image_type` | none | none | Access the image of the pixel ``pix`` | +-------------------------+--------------------+---------------+----------------+---------------------------------------------------+ .. _concept-TransformedPixel: TransformedPixel ---------------- Let `(TPix, FromPix)` be a couple of types that models :ref:`TransformedPixel (details) `. Then `TPix` also models :ref:`Pixel ` Then `FromPix` also models :ref:`Pixel ` .. _concept-TransformedPixel-types: .. rubric:: Types Let `TPix` inherit all types defined for :ref:`Pixel `. Then we can define : +-----------------------------------+------------------------------------+-------------------------------------+ | Definition | Description | Requirement | +===================================+====================================+=====================================+ | `TPix::from_pixel_type = FromPix` | type of the pixel transformed from | models :ref:`concept-Pixel` concept | +-----------------------------------+------------------------------------+-------------------------------------+ .. _concept-TransformedPixel-expressions: .. rubric:: Expressions Let `TPix` inherit all valid expressions defined for :ref:`Pixel `. .. _concept-ProjectedPixel: ProjectedPixel -------------- Let `(PPix, FromPix)` be a couple of types that models :ref:`ProjectedPixel (details) `. Then `(PPix, FromPix)` also models :ref:`TransformedPixel ` .. _concept-ProjectedPixel-types: .. rubric:: Types Let `(PPix, FromPix)` inherit all types defined for :ref:`TransformedPixel `. .. _concept-ProjectedPixel-expressions: .. rubric:: Expressions Let `(PPix, FromPix)` inherit all valid expressions defined for :ref:`TransformedPixel `. .. _concept-ZippedPixel: ZippedPixel ----------- Let `(ZPix, FromPixs...)` be a type-list that models :ref:`ZippedPixel (details) `. Then `ZPix` also models :ref:`Pixel ` Then `FromPixs...` also all model :ref:`Pixel ` .. _concept-ZippedPixel-types: .. rubric:: Types Let `ZPix` inherit all types defined for :ref:`Pixel `. Then we can define : +---------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | Definition | Description | Requirement | +=============================================+=============================================+==============================================================================================================+ | `ZPix::zipped_pixel_type_list` | type-list of the pixel zipped inside `ZPix` | models :ref:`ConvertibleTo (fundamentals) ` concept with : | | | | ``template basic_type_list {};`` | +---------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------------------------+ .. _concept-ZippedPixel-expressions: .. rubric:: Expressions Let `ZPix` inherit all valid expressions defined for :ref:`Pixel `.