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


C++ Noise::complex方法代码示例

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


在下文中一共展示了Noise::complex方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

OIIO_NAMESPACE_USING

int main()
{
  constexpr int xres = 1024, yres = 720;
  constexpr int channels = 1; // RGB
  int frame=0;

  std::unique_ptr<float []>pixels(new float[xres*yres*channels]);
  std::unique_ptr <ImageOutput> out( ImageOutput::create ("test.png"));
  ImageSpec spec (xres, yres, channels, TypeDesc::FLOAT);

  Noise<uint_fast8_t> n;

 // for(float no=0.001; no<1.0; no+=0.005)
  for(int f=0; f<200; ++f)
  {
    std::cout<<"frame "<<frame<<" "<<f<<"\n";
  int i=-1;
  n.setSeed(f);
  for(int y=0; y<yres; ++y)
  {
    for(int x=0; x<xres; ++x)
    {
//      pixels[++i]=n.complex(12,5.02,0.1,Point(x,y,0.0f));
      pixels[++i]=n.complex(13,3.02,0.1,Point(x,y,0.0f));
     // pixels[++i]=n.complex(8,8.02,no,Point(x,y,0.0f));
     //pixels[++i]=n.noise(0.55,Point(x,y,0.0f));
//     pixels[++i]=n.noise(0.2,Point(x,y,0.0f));
//     pixels[++i]=n.noise(0.3,Point(x,y,0.0f));
//    pixels[++i]=n.turbulance(0.9,Point(x,y,0.0f));
//    pixels[++i]=n.turbulance(1.09,Point(x,y,0.0f));
   // pixels[++i]=n.turbulance(no,Point(x,y,0.0f));
    }
  }
  char str[40];
  sprintf(str,"noiseSeed%03d.png",frame++);
  out->open (str, spec);
  out->write_image (TypeDesc::FLOAT, pixels.get());
  out->close();
  }
  return EXIT_SUCCESS;
}
开发者ID:NCCA,项目名称:RandomTests,代码行数:43,代码来源:main.cpp


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