本文整理汇总了C++中PixelBuffer::getPixel方法的典型用法代码示例。如果您正苦于以下问题:C++ PixelBuffer::getPixel方法的具体用法?C++ PixelBuffer::getPixel怎么用?C++ PixelBuffer::getPixel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PixelBuffer
的用法示例。
在下文中一共展示了PixelBuffer::getPixel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: generatePixel
/// A filter that reduce the number of possible colors by binning each color value into the the
///number of bins specified.
/// Inherits from Filter
ColorData FQuantize::generatePixel(const PixelBuffer &buffer, int x, int y) const {
ColorData c = buffer.getPixel(x, y);
float red = c.getRed();
float blue = c.getBlue();
float green = c.getGreen();
int steps = m_bins-1;
red = round(red*steps)/steps;
green = round(green*steps)/steps;
blue = round(blue*steps)/steps;
ColorData output(red, green, blue);
return output;
}
示例2: generatePixel
ColorData Filter::generatePixel(const PixelBuffer &buffer, int x, int y) const {
ColorData p = buffer.getPixel(x, y);
return p;
}