本文整理汇总了C++中ImageBase::IsFloat方法的典型用法代码示例。如果您正苦于以下问题:C++ ImageBase::IsFloat方法的具体用法?C++ ImageBase::IsFloat怎么用?C++ ImageBase::IsFloat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImageBase
的用法示例。
在下文中一共展示了ImageBase::IsFloat方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SameType
bool SameType(const ImageBase& Img1, const ImageBase& Img2)
{
return (Img1.IsFloat() == Img2.IsFloat() &&
Img1.IsUnsigned() == Img2.IsUnsigned() &&
Img1.Depth() == Img2.Depth() &&
Img1.NbChannels() == Img2.NbChannels());
}
示例2: CheckCompatibility
void CheckCompatibility(const ImageBase& Img1, const ImageBase& Img2)
{
CheckSameSize(Img1, Img2);
if (Img1.IsFloat() != Img2.IsFloat())
throw cl::Error(CL_INVALID_VALUE, "Different image types used");
if (Img1.IsUnsigned() != Img2.IsUnsigned())
throw cl::Error(CL_INVALID_VALUE, "Different image types used");
}
示例3: PrepareFor
void Integral::PrepareFor(ImageBase& Source)
{
ImageProgram::PrepareFor(Source);
// Also build float program as we will need it
GetProgram(Float).Build();
SSize VerticalImgSize = {GetNbGroupsW(Source) - 1, Source.Height()};
SSize HorizontalImgSize = {Source.Width(), GetNbGroupsH(Source) - 1};
if (VerticalImgSize.Width == 0)
VerticalImgSize.Width = 1;
if (HorizontalImgSize.Height == 0)
HorizontalImgSize.Height = 1;
// Check validity of current temp buffers
if (m_VerticalJunctions != nullptr &&
uint(VerticalImgSize.Width) <= m_VerticalJunctions->Width() &&
uint(VerticalImgSize.Height) <= m_VerticalJunctions->Height() &&
uint(HorizontalImgSize.Width) <= m_HorizontalJunctions->Width() &&
uint(HorizontalImgSize.Height) <= m_HorizontalJunctions->Height() &&
Source.IsFloat() == m_VerticalJunctions->IsFloat())
{
// Buffers are good
return;
}
// Create buffers for temporary results
m_VerticalJunctions = std::make_shared<TempImage>(*m_CL, VerticalImgSize, SImage::F32);
m_HorizontalJunctions = std::make_shared<TempImage>(*m_CL, HorizontalImgSize, SImage::F32);
}
示例4: CheckNotFloat
void CheckNotFloat(const ImageBase& Img)
{
if (Img.IsFloat())
throw cl::Error(CL_INVALID_VALUE, "float image used when not allowed");
}