Home
|
Main Page
|
Modules
|
Namespace List
|
Class Hierarchy
|
Alphabetical List
|
Data Structures
|
File List
|
Namespace Members
|
Data Fields
|
Globals
|
Related Pages
Src
E
elastix
Common
OpenCL
ITKimprovements
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
24
namespace
itk
25
{
68
// Forward declaration
69
class
OpenCLContext;
70
71
class
ITKOpenCL_EXPORT
OpenCLSampler
72
{
73
public
:
75
using
Self
=
OpenCLSampler
;
76
78
OpenCLSampler
()
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
93
OpenCLSampler
(
const
OpenCLSampler
& other);
94
96
~OpenCLSampler
();
97
101
OpenCLSampler
&
102
operator=
(
const
OpenCLSampler
& other);
103
112
enum
AddressingMode
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
127
enum
FilterMode
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
143
GetNormalizedCoordinates
()
const
;
144
148
OpenCLSampler::AddressingMode
149
GetAddressingMode
()
const
;
150
153
OpenCLSampler::FilterMode
154
GetFilterMode
()
const
;
155
158
cl_sampler
159
GetSamplerId
()
const
160
{
161
return
this->m_Id;
162
}
163
166
OpenCLContext
*
167
GetContext
()
const
168
{
169
return
this->m_Context;
170
}
171
172
private
:
173
OpenCLContext
*
m_Context
;
174
cl_sampler
m_Id
;
175
};
176
180
bool
ITKOpenCL_EXPORT
181
operator==
(
const
OpenCLSampler
& lhs,
const
OpenCLSampler
& rhs);
182
186
bool
ITKOpenCL_EXPORT
187
operator!=
(
const
OpenCLSampler
& lhs,
const
OpenCLSampler
& rhs);
188
190
template
<
typename
char
T,
typename
traits>
191
inline
std::basic_ostream<charT, traits> &
192
operator<<
(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 */
itk::OpenCLContext
The OpenCLContext class represents an OpenCL context.
Definition
itkOpenCLContext.h:77
itk::OpenCLSampler
The OpenCLSampler class represents an OpenCL sampler object.
Definition
itkOpenCLSampler.h:72
itk::OpenCLSampler::OpenCLSampler
OpenCLSampler()
Definition
itkOpenCLSampler.h:78
itk::OpenCLSampler::GetFilterMode
OpenCLSampler::FilterMode GetFilterMode() const
itk::OpenCLSampler::operator=
OpenCLSampler & operator=(const OpenCLSampler &other)
itk::OpenCLSampler::OpenCLSampler
OpenCLSampler(const OpenCLSampler &other)
itk::OpenCLSampler::GetContext
OpenCLContext * GetContext() const
Definition
itkOpenCLSampler.h:167
itk::OpenCLSampler::OpenCLSampler
OpenCLSampler(OpenCLContext *context, cl_sampler id)
Definition
itkOpenCLSampler.h:86
itk::OpenCLSampler::FilterMode
FilterMode
Definition
itkOpenCLSampler.h:128
itk::OpenCLSampler::m_Id
cl_sampler m_Id
Definition
itkOpenCLSampler.h:174
itk::OpenCLSampler::IsNull
bool IsNull() const
Definition
itkOpenCLSampler.h:135
itk::OpenCLSampler::GetSamplerId
cl_sampler GetSamplerId() const
Definition
itkOpenCLSampler.h:159
itk::OpenCLSampler::m_Context
OpenCLContext * m_Context
Definition
itkOpenCLSampler.h:173
itk::OpenCLSampler::GetNormalizedCoordinates
bool GetNormalizedCoordinates() const
itk::OpenCLSampler::GetAddressingMode
OpenCLSampler::AddressingMode GetAddressingMode() const
itk::OpenCLSampler::~OpenCLSampler
~OpenCLSampler()
itk::OpenCLSampler::AddressingMode
AddressingMode
Definition
itkOpenCLSampler.h:113
ITKOpenCL_EXPORT
#define ITKOpenCL_EXPORT
Definition
itkOpenCLExport.h:33
itkOpenCL.h
itk
Definition
itkAdvancedImageToImageMetric.h:43
itk::operator==
bool ITKOpenCL_EXPORT operator==(const OpenCLCommandQueue &lhs, const OpenCLCommandQueue &rhs)
itk::operator!=
bool ITKOpenCL_EXPORT operator!=(const OpenCLCommandQueue &lhs, const OpenCLCommandQueue &rhs)
itk::operator<<
std::basic_ostream< charT, traits > & operator<<(std::basic_ostream< charT, traits > &strm, const OpenCLCommandQueue &queue)
Definition
itkOpenCLCommandQueue.h:135
Generated on 2024-07-17 for elastix by
1.11.0 (9b424b03c9833626cd435af22a444888fbbb192d)