当前位置: 首页>>代码示例>>C++>>正文


C++ ImageBase::NbChannels方法代码示例

本文整理汇总了C++中ImageBase::NbChannels方法的典型用法代码示例。如果您正苦于以下问题:C++ ImageBase::NbChannels方法的具体用法?C++ ImageBase::NbChannels怎么用?C++ ImageBase::NbChannels使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ImageBase的用法示例。


在下文中一共展示了ImageBase::NbChannels方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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());
}
开发者ID:AntAgna,项目名称:OpenCLIPP,代码行数:7,代码来源:Program.cpp

示例2: IsImageFlush

bool VectorProgram::IsImageFlush(const ImageBase& Source)
{
   if (Source.Width() * Source.NbChannels() * Source.DepthBytes() != Source.Step())
      return false;  // Image has padding

   if ((Source.Width() * Source.NbChannels()) % GetVectorWidth(Source.DataType()) != 0)
      return false;  // width is not a multiple of VectorWidth

   return true;
}
开发者ID:AntAgna,项目名称:OpenCLIPP,代码行数:10,代码来源:Program.cpp

示例3: Error

static std::string SelectName(const char * Name, const ImageBase& Img)
{
   if (Img.NbChannels() != 1)
      throw cl::Error(CL_IMAGE_FORMAT_NOT_SUPPORTED, "Filters on images with >1 channels not yet supported");

   return std::string(Name) + "_1C";
}
开发者ID:lochotzke,项目名称:OpenCLIPP,代码行数:7,代码来源:FiltersVector.cpp

示例4: PrepareFor

void ImageProximityFFT::PrepareFor(ImageBase& Source, Image& Template)
{
   SSize size;

   size.Width = Source.Width();
   size.Height = Source.Height();

   if (m_image_sqsums == nullptr || m_image_sqsums->Width() < size.Width || m_image_sqsums->Height() < size.Height)
      m_image_sqsums = std::make_shared<TempImage>(*m_CL, size, SImage::F32, Source.NbChannels());


   // Size of the FFT input and output
   size.Width = Source.Width() + Template.Width() / 2;
   size.Height = Source.Height() + Template.Height() / 2;

   // Search for a size supported by clFFT
   while (!m_fft.IsSupportedLength(size.Width))
      size.Width++;

   while (!m_fft.IsSupportedLength(size.Height))
      size.Height++;

   if (m_bigger_source == nullptr || m_bigger_source->Width() != size.Width || m_bigger_source->Height() != size.Height)
      m_bigger_source = std::make_shared<TempImage>(*m_CL, size, SImage::F32, 1);

   if (m_bigger_template == nullptr || m_bigger_template->Width() < size.Width || m_bigger_template->Height() < size.Height)
      m_bigger_template = std::make_shared<TempImage>(*m_CL, size, SImage::F32, 1);



   // Size of the spectral images
   size.Width = size.Width / 2 + 1;

   if (m_templ_spect == nullptr || m_templ_spect->Width() < size.Width || m_templ_spect->Height() < size.Height)
      m_templ_spect = std::make_shared<TempImage>(*m_CL, size, SImage::F32, 2);

   if (m_source_spect == nullptr || m_source_spect->Width() != size.Width || m_source_spect->Height() != size.Height)
      m_source_spect = std::make_shared<TempImage>(*m_CL, size, SImage::F32, 2);

   if (m_result_spect == nullptr || m_result_spect->Width() < size.Width || m_result_spect->Height() < size.Height)
      m_result_spect = std::make_shared<TempImage>(*m_CL, size, SImage::F32, 2);

   m_integral.PrepareFor(Source);
   m_statistics.PrepareFor(Template);
   m_transform.PrepareFor(Source);
   m_fft.PrepareFor(*m_bigger_source, *m_source_spect);
   SelectProgram(Source).Build();
   SelectProgram(*m_source_spect).Build();
}
开发者ID:AntAgna,项目名称:OpenCLIPP,代码行数:49,代码来源:ImageProximityFFT.cpp

示例5: GetRange

cl::NDRange VectorProgram::GetRange(EProgramVersions Version, const ImageBase& Img1)
{
   switch (Version)
   {
   case Fast:
      // The fast version uses a 1D range
      return cl::NDRange(Img1.Width() * Img1.Height() * Img1.NbChannels() / GetVectorWidth(Img1.DataType()), 1, 1);

   case Standard:
   case Unaligned:
      // The other versions use a 2D range
      return Img1.VectorRange(GetVectorWidth(Img1.DataType()));

   case NbVersions:
   default:
      throw cl::Error(CL_INVALID_PROGRAM, "Invalid program version in VectorProgram");
   }

}
开发者ID:AntAgna,项目名称:OpenCLIPP,代码行数:19,代码来源:Program.cpp

示例6: Check1Channel

void Check1Channel(const ImageBase& Img)
{
   if (Img.NbChannels() > 1)
      throw cl::Error(CL_INVALID_VALUE, "only 1 channel images are allowed");
}
开发者ID:AntAgna,项目名称:OpenCLIPP,代码行数:5,代码来源:Program.cpp

示例7: CheckSameNbChannels

void CheckSameNbChannels(const ImageBase& Img1, const ImageBase& Img2)
{
   if (Img1.NbChannels() != Img2.NbChannels())
      throw cl::Error(CL_INVALID_VALUE, "Different number of channels used");
}
开发者ID:AntAgna,项目名称:OpenCLIPP,代码行数:5,代码来源:Program.cpp

示例8: IsImageAligned

bool VectorProgram::IsImageAligned(const ImageBase& Source)
{
   uint BytesPerWorker = Source.DepthBytes() * Source.NbChannels() * GetVectorWidth(Source.DataType());
   return (Source.Step() % BytesPerWorker == 0);
}
开发者ID:AntAgna,项目名称:OpenCLIPP,代码行数:5,代码来源:Program.cpp


注:本文中的ImageBase::NbChannels方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。