Home
|
Main Page
|
Modules
|
Namespace List
|
Class Hierarchy
|
Alphabetical List
|
Data Structures
|
File List
|
Namespace Members
|
Data Fields
|
Globals
|
Related Pages
src
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
:
74
76
typedef
OpenCLSampler
Self
;
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
92
~
OpenCLSampler
();
93
97
OpenCLSampler
& operator=(
const
OpenCLSampler
& other );
98
107
enum
AddressingMode
{
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
121
enum
FilterMode
{
122
Nearest = 0x1140,
// CL_FILTER_NEAREST
123
Linear = 0x1141
// CL_FILTER_LINEAR
124
};
125
127
bool
IsNull
()
const
{
return
this->m_Id == 0; }
128
131
bool
GetNormalizedCoordinates()
const
;
132
136
OpenCLSampler::AddressingMode
GetAddressingMode()
const
;
137
140
OpenCLSampler::FilterMode
GetFilterMode()
const
;
141
144
cl_sampler
GetSamplerId
()
const
{
return
this->m_Id; }
145
148
OpenCLContext
*
GetContext
()
const
{
return
this->m_Context; }
149
150
private
:
151
152
OpenCLContext
*
m_Context
;
153
cl_sampler
m_Id
;
154
};
155
159
bool
ITKOpenCL_EXPORT
operator==
(
const
OpenCLSampler
& lhs,
const
OpenCLSampler
& rhs );
160
164
bool
ITKOpenCL_EXPORT
operator!=
(
const
OpenCLSampler
& lhs,
const
OpenCLSampler
& rhs );
165
167
template
<
typename
char
T,
typename
traits >
168
inline
169
std::basic_ostream< charT, traits > &
170
operator<<( 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 */
itk::OpenCLSampler::GetSamplerId
cl_sampler GetSamplerId() const
Definition:
itkOpenCLSampler.h:144
itkOpenCL.h
itk
Definition:
itkAdvancedImageToImageMetric.h:39
itk::OpenCLSampler::m_Id
cl_sampler m_Id
Definition:
itkOpenCLSampler.h:153
itk::OpenCLSampler::IsNull
bool IsNull() const
Definition:
itkOpenCLSampler.h:127
itk::OpenCLSampler::OpenCLSampler
OpenCLSampler()
Definition:
itkOpenCLSampler.h:79
itk::OpenCLSampler::m_Context
OpenCLContext * m_Context
Definition:
itkOpenCLSampler.h:152
itk::OpenCLSampler::Self
OpenCLSampler Self
Definition:
itkOpenCLSampler.h:76
itk::OpenCLContext
The OpenCLContext class represents an OpenCL context.
Definition:
itkOpenCLContext.h:76
itk::OpenCLSampler::AddressingMode
AddressingMode
Definition:
itkOpenCLSampler.h:107
itk::OpenCLSampler::OpenCLSampler
OpenCLSampler(OpenCLContext *context, cl_sampler id)
Definition:
itkOpenCLSampler.h:84
itk::OpenCLSampler::GetContext
OpenCLContext * GetContext() const
Definition:
itkOpenCLSampler.h:148
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::OpenCLSampler::FilterMode
FilterMode
Definition:
itkOpenCLSampler.h:121
itk::OpenCLSampler
The OpenCLSampler class represents an OpenCL sampler object.
Definition:
itkOpenCLSampler.h:71
ITKOpenCL_EXPORT
#define ITKOpenCL_EXPORT
Definition:
itkOpenCLExport.h:31
Generated on 07-03-2016 for elastix by
1.8.11