VisionCpp  0.0.1
mem_prop.hpp
Go to the documentation of this file.
1 // This file is part of VisionCpp, a lightweight C++ template library
2 // for computer vision and image processing.
3 //
4 // Copyright (C) 2016 Codeplay Software Limited. All Rights Reserved.
5 //
6 // Contact: visioncpp@codeplay.com
7 //
8 // Licensed under the Apache License, Version 2.0 (the "License");
9 // you may not use this file except in compliance with the License.
10 // You may obtain a copy of the License at
11 //
12 // http://www.apache.org/licenses/LICENSE-2.0
13 //
14 // Unless required by applicable law or agreed to in writing, software
15 // distributed under the License is distributed on an "AS IS" BASIS,
16 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 // See the License for the specific language governing permissions and
18 // limitations under the License.
19 
20 /// \file mem_prop.hpp
21 /// \brief Series of pixel convert functions.
22 
23 #ifndef VISIONCPP_INCLUDE_FRAMEWORK_MEMORY_MEM_PROP_HPP_
24 #define VISIONCPP_INCLUDE_FRAMEWORK_MEMORY_MEM_PROP_HPP_
25 
26 namespace visioncpp {
27 namespace internal {
28 
29 /// \brief This file is used to detect the ChannelType ElementCategory {basic or
30 /// struct}, and the channel size of a row input data
31 template <typename ElementTp>
33  static constexpr size_t ElementCategory = element_category::Struct;
34  using ChannelType = typename ElementTp::data_type;
35  static constexpr size_t ChannelSize = ElementTp::elements;
36 };
37 
38 /// \brief Specialisation of the MemoryProperties when the output is unsigned
39 /// char
40 template <>
41 struct MemoryProperties<unsigned char> {
42  static constexpr size_t ElementCategory = element_category::Basic;
43  using ChannelType = unsigned char;
44  static constexpr size_t ChannelSize = 1;
45 };
46 
47 /// \brief Specialisation of the MemoryProperties when the output is char
48 template <>
49 struct MemoryProperties<char> {
50  static constexpr size_t ElementCategory = element_category::Basic;
51  using ChannelType = char;
52  static constexpr size_t ChannelSize = 1;
53 };
54 
55 /// \brief Specialisation of the MemoryProperties when the output is unsigned
56 /// short
57 template <>
58 struct MemoryProperties<unsigned short> {
59  static constexpr size_t ElementCategory = element_category::Basic;
60  using ChannelType = unsigned short;
61  static constexpr size_t ChannelSize = 1;
62 };
63 
64 /// \brief Specialisation of the MemoryProperties when the output is short
65 template <>
66 struct MemoryProperties<short> {
67  static constexpr size_t ElementCategory = element_category::Basic;
68  using ChannelType = short;
69  static constexpr size_t ChannelSize = 1;
70 };
71 
72 /// \brief Specialisation of the MemoryProperties when the output is unsigned
73 /// int
74 template <>
75 struct MemoryProperties<unsigned int> {
76  static constexpr size_t ElementCategory = element_category::Basic;
77  using ChannelType = unsigned int;
78  static constexpr size_t ChannelSize = 1;
79 };
80 
81 /// \brief Specialisation of the MemoryProperties when the output is int
82 template <>
83 struct MemoryProperties<int> {
84  static constexpr size_t ElementCategory = element_category::Basic;
85  using ChannelType = int;
86  static constexpr size_t ChannelSize = 1;
87 };
88 
89 /// \brief Specialisation of the MemoryProperties when the output is float
90 template <>
91 struct MemoryProperties<float> {
92  static constexpr size_t ElementCategory = element_category::Basic;
93  using ChannelType = float;
94  static constexpr size_t ChannelSize = 1;
95 };
96 } // internal
97 } // visioncpp
98 #endif // VISIONCPP_INCLUDE_FRAMEWORK_MEMORY_MEM_PROP_HPP_
VisionCpp namespace.
Definition: sycl/device.hpp:24
This file is used to detect the ChannelType ElementCategory {basic or struct}, and the channel size o...
Definition: mem_prop.hpp:32
typename ElementTp::data_type ChannelType
Definition: mem_prop.hpp:34
static constexpr size_t ElementCategory
Definition: mem_prop.hpp:33
static constexpr size_t ChannelSize
Definition: mem_prop.hpp:35