本文整理汇总了C++中CImage::FlipY方法的典型用法代码示例。如果您正苦于以下问题:C++ CImage::FlipY方法的具体用法?C++ CImage::FlipY怎么用?C++ CImage::FlipY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CImage
的用法示例。
在下文中一共展示了CImage::FlipY方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RasterizeImage
void CBathymetryRasterizer::RasterizeImage()
{
CStopWatch sw;
sw.Start();
int LowPixel = 255;
int HighPixel = 0;
byte * ImageData = new byte[ImageSize * ImageSize * 3];
for (int i = 0; i < ImageSize; ++ i)
{
for (int j = 0; j < ImageSize; ++ j)
{
int const Index = ImageSize * i + j;
if (Buckets[Index].Count > 0)
{
double const Value = Buckets[Index].Sum / Buckets[Index].Count;
double const Intensity = 2.5f;
double const Bottom = 0;
int const Pixel = 255 - Clamp<int>((int) (Value * Intensity - Bottom), 0, 255);
LowPixel = Min(LowPixel, Pixel);
HighPixel = Max(HighPixel, Pixel);
ImageData[Index * 3 + 0] = Pixel;
ImageData[Index * 3 + 1] = 0;
ImageData[Index * 3 + 2] = 0;
}
else
{
ImageData[Index * 3 + 0] = 0;
ImageData[Index * 3 + 1] = 0;
ImageData[Index * 3 + 2] = 255;
}
if (Buckets[Index].Tag == -1)
{
ImageData[Index * 3 + 1] = 255;
}
//else if (Buckets[Index].Tag > 0)
//{
// if (TagGroups[Buckets[Index].Tag].IsBridge)
// {
// ImageData[Index * 3 + 1] = ImageData[Index * 3 + 0];
// ImageData[Index * 3 + 0] = 0;
// ImageData[Index * 3 + 2] = 128;
// }
//}
}
}
Log::Info("Low value: %d High Value: %d", LowPixel, HighPixel);
CImage * Image = new CImage(ImageData, vec2u(ImageSize), 3);
Image->FlipY();
Image->Write(OutputName);
Log::Info("Rasterize to image took %.3f", sw.Stop());
}