Pixel concepts (details) ======================== .. contents:: Table of Contents :local: .. _concept-details-Pixel: Pixel ----- .. cpp:concept:: template Pixel #. Refines the :cpp:concept:`template Regular` concept. #. ``Pix::value_type`` models the :cpp:concept:`template Value` concept, is non-const and is not a reference. #. ``Pix::point_type`` models the :cpp:concept:`template Point` concept. #. ``Pix::image_type`` models the :cpp:concept:`template Image` concept. #. ``Pix`` is consistant with ``point_type``, ``value_type`` and ``reference`` from ``image_type``. #. ``Pix`` provide methods ``value``, ``point`` and ``image``. **Notation** .. cpp:type:: value_type = Pix::value_type .. cpp:type:: point_type = Pix::point_type .. cpp:type:: image_type = Pix::image_type .. cpp:type:: reference = Pix::reference .. cpp:var:: Pix pix .. cpp:var:: Pix pix_cpy .. cpp:var:: const Pix cpix .. cpp:var:: const Pix t .. cpp:var:: const Pix u **Valid Expressions** - :cpp:expr:`pix()` returns an instance of :cpp:expr:`Pix`. - :cpp:expr:`cpix()` returns an instance of :cpp:expr:`const Pix`. - :cpp:expr:`pix_cpy(pix)` returns an instance of :cpp:expr:`Pix`. - :cpp:expr:`pix_cpy(cpix)` returns an instance of :cpp:expr:`Pix`. - :cpp:expr:`pix_cpy(move(pix))` returns an instance of :cpp:expr:`Pix`. - :cpp:expr:`pix_cpy = pix` returns an instance of :cpp:expr:`Pix&`. - :cpp:expr:`pix_cpy = cpix` returns an instance of :cpp:expr:`Pix&`. - :cpp:expr:`pix_cpy = move(pix)` returns an instance of :cpp:expr:`Pix&`. - :cpp:expr:`t == u` return-type models :cpp:concept:`template Boolean`. - :cpp:expr:`t != u` return-type models :cpp:concept:`template Boolean`. - :cpp:expr:`u == t` return-type models :cpp:concept:`template Boolean`. - :cpp:expr:`u != t` return-type models :cpp:concept:`template Boolean`. - :cpp:expr:`pix.value()` returns :cpp:expr:`reference`. - :cpp:expr:`pix.point()` returns :cpp:expr:`point_type`. - :cpp:expr:`pix.image()` returns :cpp:expr:`image_type`. - :cpp:expr:`cpix.value()` returns :cpp:expr:`const reference`. - :cpp:expr:`cpix.point()` returns :cpp:expr:`const point_type`. - :cpp:expr:`cpix.image()` returns :cpp:expr:`const image_type`. **Possible implementation** .. code:: cpp template> concept Pixel = requires Regular && requires { typename Pix::value_type; typename Pix::point_type; typename Pix::image_type; typename Pix::reference; } && Value && Point && Image && Same && Same && Same && !is_const_v && !is_reference_v && requires(const Pix cpix, Pix pix) { { cpix.value() } -> const reference; { cpix.point() } -> const point_type; { cpix.image() } -> const image_type; { pix.value() } -> reference; { pix.point() } -> point_type; { pix.image() } -> image_type; }; .. _concept-details-TransformedPixel: TransformedPixel ---------------- .. cpp:concept:: template TransformedPixel #. Refines the :cpp:concept:`template Pixel` concept. #. ``ToPix::from_pixel_type`` models the :cpp:concept:`template Pixel` concept. **Possible implementation** .. code:: cpp template< typename TP, typename FP, ToPix = remove_cvref, FromPix = remove_cvref> concept TransformedPixel = Pixel && Pixel && requires { typename ToPix::from_pixel_type } && Same; .. _concept-details-ProjectedPixel: ProjectedPixel -------------- .. cpp:concept:: template ProjectedPixel #. Refines the :cpp:concept:`template TransformedPixel` concept. **Possible implementation** .. code:: cpp template> concept ProjectedPixel = TransformedPixel; .. _concept-details-ZippedPixel: ZippedPixel ----------- .. cpp:concept:: template ZippedPixel #. Refines the :cpp:concept:`template Pixel` concept. #. ``FromPixs...`` models the :cpp:concept:`template Pixel` concept. #. Let ``ZPix::zipped_pixel_type_list`` be the list of types zipped. **Possible implementation** .. code:: cpp template struct basic_type_list {}; template< typename ZP, typename... FromPixs, ZPix = remove_cvref> concept ZippedPixel = Pixel && Pixel... && requires { typename ZPix::zipped_pixel_type_list } && ConvertibleTo< ZPix::zipped_pixel_type_list, basic_type_list>;