Pixel concepts (details)¶
Table of Contents
Pixel¶
-
template<typename
Pix>
conceptPixel¶ - Refines the
template <typename T> Regularconcept. Pix::value_typemodels thetemplate <typename Val> Valueconcept, is non-const and is not a reference.Pix::point_typemodels thetemplate <typename Pnt> Pointconcept.Pix::image_typemodels thetemplate <typename Ima> Imageconcept.Pixis consistant withpoint_type,value_typeandreferencefromimage_type.Pixprovide methodsvalue,pointandimage.
Notation
Valid Expressions
pix()returns an instance ofPix.cpix()returns an instance ofconst Pix.pix_cpy(pix)returns an instance ofPix.pix_cpy(cpix)returns an instance ofPix.pix_cpy(move(pix))returns an instance ofPix.pix_cpy = pixreturns an instance ofPix&.pix_cpy = cpixreturns an instance ofPix&.pix_cpy = move(pix)returns an instance ofPix&.t == ureturn-type modelstemplate<typename B> Boolean.t != ureturn-type modelstemplate<typename B> Boolean.u == treturn-type modelstemplate<typename B> Boolean.u != treturn-type modelstemplate<typename B> Boolean.pix.value()returnsreference.pix.point()returnspoint_type.pix.image()returnsimage_type.cpix.value()returnsconst reference.cpix.point()returnsconst point_type.cpix.image()returnsconst image_type.
Possible implementation
template<typename P, Pix = remove_cvref<P>> concept Pixel = requires Regular<Pix> && requires { typename Pix::value_type; typename Pix::point_type; typename Pix::image_type; typename Pix::reference; } && Value<Pix::value_type> && Point<Pix::point_type> && Image<Pix::image_type> && Same<Pix::value_type, Pix::image_type::value_type> && Same<Pix::point_type, Pix::image_type::point_type> && Same<Pix::reference, Pix::image_type::reference> && !is_const_v<Pix::value_type> && !is_reference_v<Pix::value_type> && 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; };
- Refines the
TransformedPixel¶
-
template<typename
ToPix, typenameFromPix>
conceptTransformedPixel¶ - Refines the
template <typename Pix> Pixelconcept. ToPix::from_pixel_typemodels thetemplate <typename Pix> Pixelconcept.
Possible implementation
template< typename TP, typename FP, ToPix = remove_cvref<TP>, FromPix = remove_cvref<FP>> concept TransformedPixel = Pixel<ToPix> && Pixel<FromPix> && requires { typename ToPix::from_pixel_type } && Same<ToPix::from_pixel_type, FromPix>;
- Refines the
ProjectedPixel¶
-
template<typename
ToPix, typenameFromPix>
conceptProjectedPixel¶ - Refines the
template <typename ToPix, typename FromPix> TransformedPixelconcept.
Possible implementation
template<typename ToPix, typename FromPix, PPix = remove_cvref<ToPix>> concept ProjectedPixel = TransformedPixel<ToPix, FromPix>;
- Refines the
ZippedPixel¶
-
template<typename
ZPix, typename ...FromPixs>
conceptZippedPixel¶ - Refines the
template <typename Pix> Pixelconcept. FromPixs...models thetemplate <typename Pix> Pixelconcept.- Let
ZPix::zipped_pixel_type_listbe the list of types zipped.
Possible implementation
template <typename...> struct basic_type_list {}; template< typename ZP, typename... FromPixs, ZPix = remove_cvref<ZPix>> concept ZippedPixel = Pixel<ZPix> && Pixel<FromPixs>... && requires { typename ZPix::zipped_pixel_type_list<FromPixs...> } && ConvertibleTo< ZPix::zipped_pixel_type_list<FromPixs...>, basic_type_list<FromPixs...>>;
- Refines the