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


C++ TRasterCM32P::extract方法代码示例

本文整理汇总了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);
    }
  }
}
开发者ID:Makoto-Sasahara,项目名称:opentoonz,代码行数:25,代码来源:fillutil.cpp

示例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;
	}
}
开发者ID:CroW-CZ,项目名称:opentoonz,代码行数:73,代码来源:convert2tlv.cpp


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