Loading...
Searching...
No Matches
itkOpenCLSampler.h
Go to the documentation of this file.
/*=========================================================================
*
* Copyright UMC Utrecht and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
#ifndef itkOpenCLSampler_h
#define itkOpenCLSampler_h
#include "itkOpenCL.h"
#include <ostream>
namespace itk
{
// Forward declaration
class OpenCLContext;
class ITKOpenCL_EXPORT OpenCLSampler
{
public:
using Self = OpenCLSampler;
OpenCLSampler()
: m_Context(0)
, m_Id(0)
{}
OpenCLSampler(OpenCLContext * context, cl_sampler id)
: m_Context(context)
, m_Id(id)
{}
OpenCLSampler(const OpenCLSampler & other);
~OpenCLSampler();
OpenCLSampler &
operator=(const OpenCLSampler & other);
enum AddressingMode
{
None = 0x1130, // CL_ADDRESS_NONE
ClampToEdge = 0x1131, // CL_ADDRESS_CLAMP_TO_EDGE
Clamp = 0x1132, // CL_ADDRESS_CLAMP
Repeat = 0x1133, // CL_ADDRESS_REPEAT
MirroredRepeat = 0x1134 // CL_ADDRESS_MIRRORED_REPEAT
};
enum FilterMode
{
Nearest = 0x1140, // CL_FILTER_NEAREST
Linear = 0x1141 // CL_FILTER_LINEAR
};
bool
IsNull() const
{
return this->m_Id == 0;
}
bool
GetNormalizedCoordinates() const;
OpenCLSampler::AddressingMode
GetAddressingMode() const;
OpenCLSampler::FilterMode
GetFilterMode() const;
cl_sampler
GetSamplerId() const
{
return this->m_Id;
}
OpenCLContext *
GetContext() const
{
return this->m_Context;
}
private:
OpenCLContext * m_Context;
cl_sampler m_Id;
};
bool ITKOpenCL_EXPORT
operator==(const OpenCLSampler & lhs, const OpenCLSampler & rhs);
bool ITKOpenCL_EXPORT
operator!=(const OpenCLSampler & lhs, const OpenCLSampler & rhs);
template <typename charT, typename traits>
inline std::basic_ostream<charT, traits> &
operator<<(std::basic_ostream<charT, traits> & strm, const OpenCLSampler & sampler)
{
if (sampler.IsNull())
{
strm << "OpenCLSampler(null)";
return strm;
}
const char indent = ' ';
strm << "OpenCLSampler\n" << indent << "Id: " << sampler.GetSamplerId() << std::endl;
return strm;
}
} // end namespace itk
#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::Nearest
@ Nearest
Definition itkOpenCLSampler.h:129
itk::OpenCLSampler::Linear
@ Linear
Definition itkOpenCLSampler.h:130
itk::OpenCLSampler::m_Id
cl_sampler m_Id
Definition itkOpenCLSampler.h:174
itk::OpenCLSampler::Self
OpenCLSampler Self
Definition itkOpenCLSampler.h:75
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
itk::OpenCLSampler::Repeat
@ Repeat
Definition itkOpenCLSampler.h:117
itk::OpenCLSampler::MirroredRepeat
@ MirroredRepeat
Definition itkOpenCLSampler.h:118
itk::OpenCLSampler::ClampToEdge
@ ClampToEdge
Definition itkOpenCLSampler.h:115
itk::OpenCLSampler::Clamp
@ Clamp
Definition itkOpenCLSampler.h:116
itk::OpenCLSampler::None
@ None
Definition itkOpenCLSampler.h:114
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 1768596610 for elastix by 1.15.0 |