dng_simple_image::dng_simple_image (const dng_rect &bounds,
									uint32 planes,
								    uint32 pixelType,
								    dng_memory_allocator &allocator)
								    
	:	dng_image (bounds,
				   planes,
				   pixelType)
				   
	,	fMemory    ()
	,	fAllocator (allocator)
				   
	{
	
	uint32 bytes =
		ComputeBufferSize (pixelType, bounds.Size (), planes, pad16Bytes);
				   
	fMemory.Reset (allocator.Allocate (bytes));
	
	fBuffer = dng_pixel_buffer (bounds, 0, planes, pixelType, pcInterleaved, fMemory->Buffer ());
	
	}
Ejemplo n.º 2
0
dng_gain_map::dng_gain_map (dng_memory_allocator &allocator,
							const dng_point &points,
							const dng_point_real64 &spacing,
							const dng_point_real64 &origin,
							uint32 planes)
					
	:	fPoints  (points)
	,	fSpacing (spacing)
	,	fOrigin  (origin)
	,	fPlanes  (planes)
	
	,	fRowStep (planes * points.h)
	
	,	fBuffer ()
	
	{
	
	fBuffer.Reset (allocator.Allocate (fPoints.v *
									   fPoints.h *
									   fPlanes * sizeof (real32)));
	
	}
Ejemplo n.º 3
0
dng_simple_image::dng_simple_image (const dng_rect &bounds,
									uint32 planes,
								    uint32 pixelType,
								    uint32 pixelRange,
								    dng_memory_allocator &allocator)
								    
	:	dng_image (bounds,
				   planes,
				   pixelType,
				   pixelRange)
				   
	,	fMemory ()
	,	fBuffer ()
				   
	{
	
	uint32 pixelSize = TagTypeSize (pixelType);
	
	uint32 bytes = bounds.H () * bounds.W () * planes * pixelSize;
				   
	fMemory.Reset (allocator.Allocate (bytes));
	
	fBuffer.fArea = bounds;
	
	fBuffer.fPlane  = 0;
	fBuffer.fPlanes = planes;
	
	fBuffer.fRowStep   = planes * bounds.W ();
	fBuffer.fColStep   = planes;
	fBuffer.fPlaneStep = 1;
	
	fBuffer.fPixelType  = pixelType;
	fBuffer.fPixelSize  = pixelSize;
	fBuffer.fPixelRange = pixelRange;
	
	fBuffer.fData = fMemory->Buffer ();
	
	}