本文整理汇总了C++中TRasterCM32P::extract方法的典型用法代码示例。如果您正苦于以下问题:C++ TRasterCM32P::extract方法的具体用法?C++ TRasterCM32P::extract怎么用?C++ TRasterCM32P::extract使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TRasterCM32P
的用法示例。
在下文中一共展示了TRasterCM32P::extract方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fillautoInks
//-----------------------------------------------------------------------------
// questa funzione viene chiamata dopo il fill rect delle aree, e colora gli
// inchiostri di tipo "autoink"
// che confinano con le aree appena fillate con il rect. rbefore e' il rect del
// raster prima del rectfill.
void fillautoInks(TRasterCM32P &rin, TRect &rect, const TRasterCM32P &rbefore,
TPalette *plt) {
assert(plt);
TRasterCM32P r = rin->extract(rect);
assert(r->getSize() == rbefore->getSize());
int i, j;
for (i = 0; i < r->getLy(); i++) {
TPixelCM32 *pix = r->pixels(i);
TPixelCM32 *pixb = rbefore->pixels(i);
for (j = 0; j < r->getLx(); j++, pix++, pixb++) {
int paint = pix->getPaint();
int tone = pix->getTone();
int ink = pix->getInk();
if (paint != pixb->getPaint() && tone > 0 && tone < 255 && ink != paint &&
plt->getStyle(ink)->getFlags() != 0)
inkFill(rin, TPoint(j, i) + rect.getP00(), paint, 0, NULL, &rect);
}
}
}
示例2: if
void Convert2Tlv::buildToonzRaster(TRasterCM32P &rout, const TRasterP &rin1, const TRasterP &rin2)
{
if (rin2)
assert(rin1->getSize() == rin2->getSize());
rout->clear();
std::cout << " computing inks...\n";
TRaster32P r1 = (TRaster32P)rin1;
TRasterGR8P r1gr = (TRasterGR8P)rin1;
TRaster32P r2 = (TRaster32P)rin2;
TRasterGR8P r2gr = (TRasterGR8P)rin2;
TRasterP rU, rP;
if (r1gr) {
rU = r1gr;
rP = r2;
} else if (r2gr) {
rU = r2gr;
rP = r1;
} else if (!r1)
rU = r2;
else if (!r2)
rU = r1;
else if (firstIsUnpainted(r1, r2)) {
rU = r1;
rP = r2;
} else {
rU = r2;
rP = r1;
}
TRasterCM32P r;
if (rout->getSize() != rU->getSize()) {
int dx = rout->getLx() - rU->getLx();
int dy = rout->getLy() - rU->getLy();
assert(dx >= 0 && dy >= 0);
r = rout->extract(dx / 2, dy / 2, dx / 2 + rU->getLx() - 1, dy / 2 + rU->getLy() - 1);
} else
r = rout;
if ((TRasterGR8P)rU)
buildInksFromGrayTones(r, rU);
else if (m_isUnpaintedFromNAA)
buildInksForNAAImage(r, (TRaster32P)rU);
else {
int maxMatte = getMaxMatte((TRaster32P)rU);
if (maxMatte == -1)
buildInksFromGrayTones(r, rU);
else {
if (maxMatte < 255)
normalize(rU, maxMatte);
buildInks(r, (TRaster32P)rU /*rP,*/);
}
}
if (m_autoclose)
TAutocloser(r, AutocloseDistance, AutocloseAngle, 1, AutocloseOpacity).exec();
if (rP) {
std::cout << " computing paints...\n";
doFill(r, rP);
}
if (m_antialiasType == 2) //remove antialias
removeAntialias(r);
else if (m_antialiasType == 1) //add antialias
{
TRasterCM32P raux(r->getSize());
TRop::antialias(r, raux, 10, m_antialiasValue);
rout = raux;
}
}