1 /*****************************************************************************
2 
3         Frame.h
4         Author: Laurent de Soras, 2021
5 
6 --- Legal stuff ---
7 
8 This program is free software. It comes without any warranty, to
9 the extent permitted by applicable law. You can redistribute it
10 and/or modify it under the terms of the Do What The Fuck You Want
11 To Public License, Version 2, as published by Sam Hocevar. See
12 http://www.wtfpl.net/ for more details.
13 
14 *Tab=3***********************************************************************/
15 
16 
17 
18 #pragma once
19 #if ! defined (fmtcl_Frame_HEADER_INCLUDED)
20 #define fmtcl_Frame_HEADER_INCLUDED
21 
22 
23 
24 /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
25 
26 #include "fmtcl/Cst.h"
27 #include "fmtcl/Plane.h"
28 
29 #include <array>
30 #include <initializer_list>
31 
32 
33 
34 namespace fmtcl
35 {
36 
37 
38 
39 template <typename T = uint8_t>
40 class Frame
41 :	public std::array <Plane <T>, Cst::_max_nbr_planes>
42 {
43 
44 /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
45 
46 public:
47 
48 	typedef std::array <Plane <T>, Cst::_max_nbr_planes> Inherited;
49 
50 	using typename Inherited::value_type;
51 	using typename Inherited::size_type;
52 	using typename Inherited::difference_type;
53 	using typename Inherited::reference;
54 	using typename Inherited::const_reference;
55 	using typename Inherited::pointer;
56 	using typename Inherited::const_pointer;
57 	using typename Inherited::iterator;
58 	using typename Inherited::const_iterator;
59 	using typename Inherited::reverse_iterator;
60 	using typename Inherited::const_reverse_iterator;
61 
62 	using std::array <Plane <T>, Cst::_max_nbr_planes>::array;
63 	template <typename... AT>
64 	constexpr inline Frame (value_type &&p0, AT &&... args) noexcept;
65 	constexpr inline
66 	               Frame (std::initializer_list <value_type> il);
67 	template <typename U>
68 	constexpr inline
69 	               Frame (const Frame <U> &other) noexcept;
70 	template <typename U>
71 	constexpr inline
72 	               Frame (Frame <U> &&other) noexcept;
73 
74 	constexpr inline bool
75 	               is_valid (int nbr_planes = Cst::_max_nbr_planes, int h = 1) const noexcept;
76 
77 	inline void    step_pix () noexcept;
78 	inline void    step_pix (int n) noexcept;
79 	inline void    step_line () noexcept;
80 	inline void    step_line (int n) noexcept;
81 
82 
83 
84 /*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
85 
86 protected:
87 
88 
89 
90 /*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
91 
92 private:
93 
94 
95 
96 /*\\\ FORBIDDEN MEMBER FUNCTIONS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
97 
98 private:
99 
100 }; // class Frame
101 
102 
103 
104 }  // namespace fmtcl
105 
106 
107 
108 #include "fmtcl/Frame.hpp"
109 
110 
111 
112 #endif   // fmtcl_Frame_HEADER_INCLUDED
113 
114 
115 
116 /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
117