本文整理汇总了C++中DImg::flip方法的典型用法代码示例。如果您正苦于以下问题:C++ DImg::flip方法的具体用法?C++ DImg::flip怎么用?C++ DImg::flip使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DImg
的用法示例。
在下文中一共展示了DImg::flip方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: apply
void DImgBuiltinFilter::apply(DImg& image) const
{
switch (m_type)
{
case NoOperation:
break;
case Rotate90:
image.rotate(DImg::ROT90);
break;
case Rotate180:
image.rotate(DImg::ROT180);
break;
case Rotate270:
image.rotate(DImg::ROT270);
break;
case FlipHorizontally:
image.flip(DImg::HORIZONTAL);
break;
case FlipVertically:
image.flip(DImg::VERTICAL);
break;
case Crop:
image.crop(m_arg.toRect());
break;
case Resize:
{
QSize s = m_arg.toSize();
image.resize(s.width(), s.height());
break;
}
case ConvertTo8Bit:
image.convertToEightBit();
break;
case ConvertTo16Bit:
image.convertToSixteenBit();
break;
}
}
示例2: filterImage
void RefocusFilter::filterImage()
{
bool sb = m_orgImage.sixteenBit();
bool a = m_orgImage.hasAlpha();
int w = m_orgImage.width();
int h = m_orgImage.height();
DImg img(w + 4 * MAX_MATRIX_SIZE, h + 4 * MAX_MATRIX_SIZE, sb, a);
DImg tmp;
// copy the original
img.bitBltImage(&m_orgImage, 2 * MAX_MATRIX_SIZE, 2 * MAX_MATRIX_SIZE);
// Create dummy top border
tmp = m_orgImage.copy(0, 0, w, 2 * MAX_MATRIX_SIZE);
tmp.flip(DImg::VERTICAL);
img.bitBltImage(&tmp, 2 * MAX_MATRIX_SIZE, 0);
// Create dummy bottom border
tmp = m_orgImage.copy(0, h - 2 * MAX_MATRIX_SIZE, w, 2 * MAX_MATRIX_SIZE);
tmp.flip(DImg::VERTICAL);
img.bitBltImage(&tmp, 2 * MAX_MATRIX_SIZE, 2 * MAX_MATRIX_SIZE + h);
// Create dummy left border
tmp = m_orgImage.copy(0, 0, 2 * MAX_MATRIX_SIZE, h);
tmp.flip(DImg::HORIZONTAL);
img.bitBltImage(&tmp, 0, 2 * MAX_MATRIX_SIZE);
// Create dummy right border
tmp = m_orgImage.copy(w - 2 * MAX_MATRIX_SIZE, 0, 2 * MAX_MATRIX_SIZE, h);
tmp.flip(DImg::HORIZONTAL);
img.bitBltImage(&tmp, w + 2 * MAX_MATRIX_SIZE, 2 * MAX_MATRIX_SIZE);
// Create dummy top/left corner
tmp = m_orgImage.copy(0, 0, 2 * MAX_MATRIX_SIZE, 2 * MAX_MATRIX_SIZE);
tmp.flip(DImg::HORIZONTAL);
tmp.flip(DImg::VERTICAL);
img.bitBltImage(&tmp, 0, 0);
// Create dummy top/right corner
tmp = m_orgImage.copy(w - 2 * MAX_MATRIX_SIZE, 0, 2 * MAX_MATRIX_SIZE, 2 * MAX_MATRIX_SIZE);
tmp.flip(DImg::HORIZONTAL);
tmp.flip(DImg::VERTICAL);
img.bitBltImage(&tmp, w + 2 * MAX_MATRIX_SIZE, 0);
// Create dummy bottom/left corner
tmp = m_orgImage.copy(0, h - 2 * MAX_MATRIX_SIZE, 2 * MAX_MATRIX_SIZE, 2 * MAX_MATRIX_SIZE);
tmp.flip(DImg::HORIZONTAL);
tmp.flip(DImg::VERTICAL);
img.bitBltImage(&tmp, 0, h + 2 * MAX_MATRIX_SIZE);
// Create dummy bottom/right corner
tmp = m_orgImage.copy(w - 2 * MAX_MATRIX_SIZE, h - 2 * MAX_MATRIX_SIZE, 2 * MAX_MATRIX_SIZE, 2 * MAX_MATRIX_SIZE);
tmp.flip(DImg::HORIZONTAL);
tmp.flip(DImg::VERTICAL);
img.bitBltImage(&tmp, w + 2 * MAX_MATRIX_SIZE, h + 2 * MAX_MATRIX_SIZE);
// run filter algorithm on the prepared copy
refocusImage(img.bits(), img.width(), img.height(),
img.sixteenBit(), d->matrixSize, d->radius, d->gauss,
d->correlation, d->noise);
// copy the result from intermediate image to final image
m_destImage.bitBltImage(&d->preImage, 2 * MAX_MATRIX_SIZE, 2 * MAX_MATRIX_SIZE, w, h, 0, 0);
}