View concepts (details)

View

template<typename Vw>
concept View
  1. Refines the template <typename Ima> Image concept.
  2. Is basicaly an alias.

Possible implementation

template <typename V, Vw = remove_cvref<V>>
concept View =  Image<Vw>;

WritableView

template<typename WView>
concept WritableView
  1. Refines the template <typename V> View concept.
  2. Refines the template <typename Ima> WritableImage concept.

Possible implementation

template <typename WV, WView = remove_cvref<WV>>
concept WritableView =  View<WView> &&
                        WritableImage<WView>;

FilterView

template<typename FView, typename Pred>
concept FilterView
  1. Refines the template <typename V> View concept.
  2. Pred models the template <typename F, typename... Args> Predicate concept.

Notation

using const_pixel_type = FView::const_pixel_type
Pred pred
const_pixel_type cpix

Valid Expressions

  • pred(cpix) return-type models template <typename B> Boolean.

Possible implementation

template <typename FV, typename Pred, FView = remove_cvref<FV>>
concept FilterView =    View<FView> &&
                        Predicate<Pred, FView::const_pixel_type>;

WritableFilterView

template<typename WFView, typename Pred>
concept WritableFilterView
  1. Refines the template <typename WV> WritableView concept.
  2. Refines the template <typename FView, typename Pred> FilterView concept.
  3. Pred models the template <typename F, typename... Args> Predicate concept.

Notation

using pixel_type = WFView::pixel_type
Pred pred
pixel_type pix

Valid Expressions

  • pred(pix) return-type models template <typename B> Boolean.

Possible implementation

template <typename WFV, typename Pred, WFView = remove_cvref<WFV>>
concept WritableFilterView =    WritableView<WFView> &&
                                FilterView<WFView, Pred> &&
                                Predicate<Pred, WFView::pixel_type>;

TransformView

template<typename TView, typename Func>
concept TransformView
  1. Refines the template <typename V> View concept.
  2. Func models the template <typename R, typename F, typename... Args> InvocableR concept.

Notation

using const_pixel_type = PView::const_pixel_type
Func func
const_pixel_type cpix

Valid Expressions

Possible implementation

template <typename TV, typename Func, TView = remove_cvref<TV>>
concept TransformView = View<TView> &&
                        Invocable<Func, TView::const_pixel_type> &&
                        TransformedPixel<
                            invoke_result_t<Func, TView::const_pixel_type>,
                            TView::const_pixel_type>;

WritableTransformView

template<typename WTView, typename Func, typename FuncInverse>
concept WritableTransformView
  1. Refines the template <typename TView, typename Func> TransformView concept.
  2. Func models the template <typename R, typename F, typename... Args> InvocableR concept.
  3. FuncInverse models the template <typename R, typename F, typename... Args> InvocableR concept where R models the template <typename Pix> Pixel concept.

Notation

using pixel_type = WTView::pixel_type
Func func
FuncInverse func_inverse
pixel_type pix

Valid Expressions

Possible implementation

template <typename WTV, typename Func, typename FuncInverse, WTView = remove_cvref<WTV>>
concept WritableTransformView =
    View<WTView> &&
    TransformView<WTView> &&

    Invocable<Func, WTView::pixel_type> &&
    TransformedPixel<
        invoke_result_t<Func, WTView::pixel_type>,
        WTView::pixel_type> &&

    Invocable<FuncInverse, invoke_result_t<Func, WTView::pixel_type> &&
    Pixel<
        invoke_result_t<FuncInverse, invoke_result_t<Func, WTView::pixel_type>> &&
    Same<
        WTView::pixel_type
        invoke_result_t<FuncInverse, invoke_result_t<Func, WTView::pixel_type>>;

ProjectorView

template<typename PView, typename Proj>
concept ProjectorView
  1. Refines the template <typename V> View concept.
  2. Proj models the template <typename R, typename F, typename... Args> InvocableR concept.

Notation

using const_pixel_type = PView::const_pixel_type
Proj proj
const_pixel_type cpix

Valid Expressions

Possible implementation

template <typename PV, typename Proj, PView = remove_cvref<PV>>
concept ProjectorView = View<PView> &&
                        Invocable<Proj, PView::const_pixel_type> &&
                        ProjectedPixel<
                            invoke_result_t<Proj, PView::const_pixel_type>,
                            PView::const_pixel_type>;

WritableProjectorView

template<typename WPView, typename Proj>
concept WritableProjectorView
  1. Refines the template <typename WV> WritableView concept.
  2. Refines the template <typename PView, typename Proj> ProjectorView concept.
  3. Proj models the template <typename R, typename F, typename... Args> InvocableR concept.

Notation

using pixel_type = WPView::pixel_type
Proj proj
pixel_type pix

Valid Expressions

Possible implementation

template <typename WPV, typename Proj, WPView = remove_cvref<WPV>>
concept WritableProjectorView = WritableView<WPView> &&
                                ProjectorView<WPView, Proj> &&
                                Invocable<Proj, WPView::pixel_type> &&
                                ProjectedPixel<
                                    invoke_result_t<Proj, WPView::pixel_type>,
                                    WPView::pixel_type>;

ZipView

template<typename ZView, typename ...FromViews>
concept ZipView
  1. Refines the template <typename V> View concept.

Notation

using const_pixel_type = ZView::const_pixel_type
const_pixel_type cpix

Valid Expressions

Possible implementation

template <  typename Z, typename... FromViews,
            ZView = remove_cvref<ZV>>
concept ZipView =   View<ZView> &&
                    View<FromViews>... &&
                    ZippedPixel<ZView::const_pixel_type, FromViews::const_pixel_type...>;

WritableZipView

template<typename WZView, typename ...FromViews>
concept WritableZipView
  1. Refines the template <typename WV> WritableView concept.
  2. Refines the template <typename ZView, typename... FromViews> ZipView concept.

Notation

using pixel_type = WZView::pixel_type
pixel_type pix

Valid Expressions

Possible implementation

template <  typename WZ, typename... FromViews,
            WZView = remove_cvref<WZV>>
concept WritableZipView =   WritableView<WZView> &&
                            ZipView<WZView> &&
                            View<FromViews>... &&
                            ZippedPixel<WZView::pixel_type, FromViews::pixel_type...>;