void dng_tile_iterator::Initialize (const dng_rect &tile,
						 			const dng_rect &area)
	{
	
	fArea = area;
	
	if (area.IsEmpty ())
		{
		
		fVerticalPage =  0;
		fBottomPage   = -1;
		
		return;
		
		}
	
	int32 vOffset = tile.t;
	int32 hOffset = tile.l;
	
	int32 tileHeight = tile.b - vOffset;
	int32 tileWidth  = tile.r - hOffset;
	
	fTileHeight = tileHeight;
	fTileWidth  = tileWidth;
	
	fLeftPage  = (fArea.l - hOffset    ) / tileWidth;
	fRightPage = (fArea.r - hOffset - 1) / tileWidth;
	
	fHorizontalPage = fLeftPage;
	
	fTopPage    = (fArea.t - vOffset    ) / tileHeight;
	fBottomPage = (fArea.b - vOffset - 1) / tileHeight;
	
	fVerticalPage = fTopPage;
	
	fTileLeft = fHorizontalPage * tileWidth  + hOffset;
	fTileTop  = fVerticalPage   * tileHeight + vOffset;

	fRowLeft = fTileLeft;
			
	}
Exemplo n.º 2
0
dng_image::dng_image (const dng_rect &bounds,
				      uint32 planes,
				      uint32 pixelType)

	: 	fBounds    (bounds)
	,	fPlanes    (planes)
	,	fPixelType (pixelType)
	
	{
	if (bounds.IsEmpty () || planes == 0 || PixelSize () == 0)
		{
		
		#if qDNGValidate
		
		ReportError ("Fuzz: Attempt to create zero size image");
		
		#endif
		
		ThrowBadFormat ();
		
		}
		
	}