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


C++ Geometry::xOff方法代码示例

本文整理汇总了C++中magick::Geometry::xOff方法的典型用法代码示例。如果您正苦于以下问题:C++ Geometry::xOff方法的具体用法?C++ Geometry::xOff怎么用?C++ Geometry::xOff使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在magick::Geometry的用法示例。


在下文中一共展示了Geometry::xOff方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: return

MagickPPExport int Magick::operator == (const Magick::Geometry& left_,
  const Magick::Geometry& right_)
{
  return((left_.aspect() == right_.aspect()) &&
    (left_.fillArea() == right_.fillArea()) &&
    (left_.greater() == right_.greater()) &&
    (left_.height() == right_.height()) &&
    (left_.isValid() == right_.isValid()) &&
    (left_.less() == right_.less()) &&
    (left_.limitPixels() == right_.limitPixels()) &&
    (left_.percent() == right_.percent()) &&
    (left_.width() == right_.width()) &&
    (left_.xOff() == right_.xOff()) &&
    (left_.yOff() == right_.yOff()));
}
开发者ID:edalquist,项目名称:ImageMagick,代码行数:15,代码来源:Geometry.cpp

示例2: scale

 Magick::Geometry scale (const Magick::Geometry& geometry) const
 {
   return Magick::Geometry (x_scale_ * geometry.width (),
                            y_scale_ * geometry.height (),
                            x_scale_ * geometry.xOff (),
                            y_scale_ * geometry.yOff ());
 }
开发者ID:utsushi,项目名称:utsushi,代码行数:7,代码来源:doc-locate.cpp

示例3:

// Frame image
Magick::frameImage::frameImage( const Magick::Geometry &geometry_ )
  : _width( geometry_.width() ),
    _height( geometry_.height() ),
    _outerBevel( geometry_.xOff() ),
    _innerBevel( geometry_.yOff() )
{
}
开发者ID:0xPr0xy,项目名称:ImageMagick,代码行数:8,代码来源:STL.cpp

示例4: return

int Magick::operator == ( const Magick::Geometry& left_,
			  const Magick::Geometry& right_ )
{
  return (
	  ( left_.isValid()   == right_.isValid() ) &&
	  ( left_.width()     == right_.width() ) &&
	  ( left_.height()    == right_.height() ) &&
	  ( left_.xOff()      == right_.xOff() ) &&
	  ( left_.yOff()      == right_.yOff() ) &&
	  ( left_.xNegative() == right_.xNegative() ) &&
	  ( left_.yNegative() == right_.yNegative() ) &&
	  ( left_.percent()   == right_.percent() ) &&
	  ( left_.aspect()    == right_.aspect() ) &&
	  ( left_.greater()   == right_.greater() ) &&
	  ( left_.less()      == right_.less() )
	  );
}
开发者ID:0xPr0xy,项目名称:ImageMagick,代码行数:17,代码来源:Geometry.cpp

示例5:

Magick::floodFillTextureImage::floodFillTextureImage(
  const Magick::Geometry &point_,const Magick::Image &texture_,
  const Magick::Color &borderColor_,const bool invert_)
  : _x(point_.xOff()),
    _y(point_.yOff()),
    _texture(texture_),
    _borderColor(borderColor_),
    _invert(invert_)
{
}
开发者ID:anorland,项目名称:ImageMagick,代码行数:10,代码来源:STL.cpp

示例6: floor

	void KBuild::Symbol::Frame::getGeometry(Magick::Geometry& geo) const {
		using namespace Magick;

		const Image atlas = parent->parent->atlases[getAtlasIdx()].second;

		float_type w0 = atlas.columns();
		float_type h0 = atlas.rows();

		geo.xOff(size_t( floor(w0*atlas_bbox.x()) ));
		geo.yOff(size_t( floor(h0*atlas_bbox.y()) ));
		geo.width(size_t( floor(w0*atlas_bbox.w() + 0.5) ));
		geo.height(size_t( floor(h0*atlas_bbox.h() + 0.5) ));
	}
开发者ID:KINGCODESABER,项目名称:ktools,代码行数:13,代码来源:kbuild.cpp

示例7: if

DefinitionFile * ResourcePackerScreen::ProcessPSD(const String & processDirectoryPath, const String & psdPathname, const String & psdName)
{
	int32 maxTextureSize = 1024;
	if (CommandLineParser::Instance()->IsFlagSet("--tsize2048"))
	{
		maxTextureSize = 2048;
	}
	
	// TODO: Check CRC32
	std::vector<Magick::Image> layers;
	
	String psdNameWithoutExtension = FileSystem::ReplaceExtension(psdName, "");
	
	try 
	{
		Magick::readImages(&layers, psdPathname);
		
		if (layers.size() == 0)
		{
			Logger::Error("Number of layers is too low: %s", psdPathname.c_str());
			return 0;
		}
		
		if (layers.size() == 1)
		{
			layers.push_back(layers[0]);
		}
		
		//Logger::Debug("psd file: %s wext: %s", psdPathname.c_str(), psdNameWithoutExtension.c_str());
		
		int width = (int)layers[0].columns();
		int height = (int)layers[0].rows();
		
		for(int k = 1; k < (int)layers.size(); ++k)
		{
			Magick::Image & currentLayer = layers[k];
			
			
			/* 
			MagickCore::ResetImagePropertyIterator(currentLayer.image());
			const char * property = MagickCore::GetNextImageProperty(currentLayer.image());
			if (property != (const char *) NULL)
			{
				printf("  Properties:\n");
				while (property != (const char *) NULL)
				{
					printf("    %c",*property);
					if (strlen(property) > 1)
						printf("%s: ",property+1);
					if (strlen(property) > 80)
						printf("\n");

					const char * value = MagickCore::GetImageProperty(currentLayer.image(), property);
					if (value != (const char *) NULL)
						printf("%s\n",value);
					property = MagickCore::GetNextImageProperty(currentLayer.image());
				}
			} */
			
			
			
			currentLayer.crop(Magick::Geometry(width,height, 0, 0));
			currentLayer.magick("PNG");
			String outputFile = processDirectoryPath + String("/") + psdNameWithoutExtension;
			outputFile += String(Format("%d.png", k - 1));
			currentLayer.write(outputFile);
		}
		
		
		DefinitionFile * defFile = new DefinitionFile;
		defFile->filename = processDirectoryPath + String("/") + psdNameWithoutExtension + String(".txt");
		// Logger::Debug("filename: %s", defFile->filename.c_str());
		defFile->spriteWidth = width;
		defFile->spriteHeight = height;
		defFile->frameCount = (int)layers.size() -1;
		defFile->frameRects = new Rect2i[defFile->frameCount];
		
		for(int k = 1; k < (int)layers.size(); ++k)
		{
			Magick::Image & currentLayer = layers[k];
			Magick::Geometry bbox = currentLayer.page();
			int xOff = (int)bbox.xOff();
			if (bbox.xNegative())
				xOff = -xOff;
			int yOff = (int)bbox.yOff();
			if (bbox.yNegative())
				yOff = -yOff;
			
			defFile->frameRects[k - 1] = Rect2i(xOff, yOff, (int32)bbox.width(), (int32)bbox.height());
			
			//printf("Percent: %d Aspect: %d Greater: %d Less: %d\n", (int)bbox.percent(), (int)bbox.aspect(), (int)bbox.greater(), (int)bbox.less());
			
			if ((defFile->frameRects[k - 1].dx >= maxTextureSize) || (defFile->frameRects[k - 1].dy >= maxTextureSize))
			{
				
				printf("* WARNING * - frame of %s layer %d is bigger than maxTextureSize(%d) layer exportSize (%d x %d) FORCE REDUCE TO (%d x %d). Bewarned!!! Results not guaranteed!!!\n", psdName.c_str(), k - 1, maxTextureSize
					   , defFile->frameRects[k - 1].dx, defFile->frameRects[k - 1].dy, width, height);
				defFile->frameRects[k - 1].dx = width;
				defFile->frameRects[k - 1].dy = height;
			}
//.........这里部分代码省略.........
开发者ID:vilonosec,项目名称:dava.framework,代码行数:101,代码来源:ResourcePackerScreen.cpp


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