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:
74
77
79 OpenCLSampler() : m_Context( 0 ), m_Id( 0 ) {}
80
84 OpenCLSampler( OpenCLContext * context, cl_sampler id ) :
85 m_Context( context ), m_Id( id ) {}
86
89 OpenCLSampler( const OpenCLSampler & other );
90
93
98
108 None = 0x1130, // CL_ADDRESS_NONE
109 ClampToEdge = 0x1131, // CL_ADDRESS_CLAMP_TO_EDGE
110 Clamp = 0x1132, // CL_ADDRESS_CLAMP
111 Repeat = 0x1133, // CL_ADDRESS_REPEAT
112 MirroredRepeat = 0x1134 // CL_ADDRESS_MIRRORED_REPEAT
113 };
114
122 Nearest = 0x1140, // CL_FILTER_NEAREST
123 Linear = 0x1141 // CL_FILTER_LINEAR
124 };
125
127 bool IsNull() const { return this->m_Id == 0; }
128
132
137
141
144 cl_sampler GetSamplerId() const { return this->m_Id; }
145
148 OpenCLContext * GetContext() const { return this->m_Context; }
149
150private:
151
153 cl_sampler m_Id;
154};
155
160
165
167template< typename charT, typename traits >
168inline
169std::basic_ostream< charT, traits > &
170operator<<( std::basic_ostream< charT, traits > & strm,
171 const OpenCLSampler & sampler )
172{
173 if( sampler.IsNull() )
174 {
175 strm << "OpenCLSampler(null)";
176 return strm;
177 }
178
179 const char indent = ' ';
180
181 strm << "OpenCLSampler" << std::endl
182 << indent << "Id: " << sampler.GetSamplerId() << std::endl;
183
184 return strm;
185}
186
187
188} // end namespace itk
189
190#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
OpenCLSampler Self
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 1667476801 for elastix by doxygen 1.9.4 elastix logo