go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkOpenCLSampler.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright UMC Utrecht and contributors
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18#ifndef itkOpenCLSampler_h
19#define itkOpenCLSampler_h
20
21#include "itkOpenCL.h"
22#include <ostream>
23
24namespace itk
25{
68// Forward declaration
69class OpenCLContext;
70
72{
73public:
76
79 : m_Context(0)
80 , m_Id(0)
81 {}
82
86 OpenCLSampler(OpenCLContext * context, cl_sampler id)
87 : m_Context(context)
88 , m_Id(id)
89 {}
90
94
97
102 operator=(const OpenCLSampler & other);
103
113 {
114 None = 0x1130, // CL_ADDRESS_NONE
115 ClampToEdge = 0x1131, // CL_ADDRESS_CLAMP_TO_EDGE
116 Clamp = 0x1132, // CL_ADDRESS_CLAMP
117 Repeat = 0x1133, // CL_ADDRESS_REPEAT
118 MirroredRepeat = 0x1134 // CL_ADDRESS_MIRRORED_REPEAT
119 };
120
128 {
129 Nearest = 0x1140, // CL_FILTER_NEAREST
130 Linear = 0x1141 // CL_FILTER_LINEAR
131 };
132
134 bool
135 IsNull() const
136 {
137 return this->m_Id == 0;
138 }
139
142 bool
144
150
155
158 cl_sampler
160 {
161 return this->m_Id;
162 }
163
168 {
169 return this->m_Context;
170 }
171
172private:
174 cl_sampler m_Id;
175};
176
181 operator==(const OpenCLSampler & lhs, const OpenCLSampler & rhs);
182
187 operator!=(const OpenCLSampler & lhs, const OpenCLSampler & rhs);
188
190template <typename charT, typename traits>
191inline std::basic_ostream<charT, traits> &
192operator<<(std::basic_ostream<charT, traits> & strm, const OpenCLSampler & sampler)
193{
194 if (sampler.IsNull())
195 {
196 strm << "OpenCLSampler(null)";
197 return strm;
198 }
199
200 const char indent = ' ';
201
202 strm << "OpenCLSampler\n" << indent << "Id: " << sampler.GetSamplerId() << std::endl;
203
204 return strm;
205}
206
207
208} // end namespace itk
209
210#endif /* itkOpenCLSampler_h */
The OpenCLContext class represents an OpenCL context.
The OpenCLSampler class represents an OpenCL sampler object.
OpenCLSampler::FilterMode GetFilterMode() const
OpenCLSampler & operator=(const OpenCLSampler &other)
OpenCLSampler(const OpenCLSampler &other)
OpenCLContext * GetContext() const
OpenCLSampler(OpenCLContext *context, cl_sampler id)
cl_sampler GetSamplerId() const
OpenCLContext * m_Context
bool GetNormalizedCoordinates() const
OpenCLSampler::AddressingMode GetAddressingMode() const
#define ITKOpenCL_EXPORT
bool ITKOpenCL_EXPORT operator==(const OpenCLCommandQueue &lhs, const OpenCLCommandQueue &rhs)
bool ITKOpenCL_EXPORT operator!=(const OpenCLCommandQueue &lhs, const OpenCLCommandQueue &rhs)
std::basic_ostream< charT, traits > & operator<<(std::basic_ostream< charT, traits > &strm, const OpenCLCommandQueue &queue)


Generated on 2023-01-13 for elastix by doxygen 1.9.6 elastix logo