Exemple #1
0
void dng_area_spec::GetData (dng_stream &stream)
	{

	fArea.t = stream.Get_int32 ();
	fArea.l = stream.Get_int32 ();
	fArea.b = stream.Get_int32 ();
	fArea.r = stream.Get_int32 ();

	fPlane  = stream.Get_uint32 ();
	fPlanes = stream.Get_uint32 ();

	fRowPitch = stream.Get_uint32 ();
	fColPitch = stream.Get_uint32 ();

	if (fPlanes < 1)
		{
		ThrowBadFormat ();
		}

	if (fRowPitch < 1 || fColPitch < 1)
		{
		ThrowBadFormat ();
		}

	if (fArea.IsEmpty () && (fRowPitch != 1 || fColPitch != 1))
		{
		ThrowBadFormat ();
		}

	#if qDNGValidate

	if (gVerbose)
		{

		printf ("AreaSpec: t=%d, l=%d, b=%d, r=%d, p=%u:%u, rp=%u, cp=%u\n",
				(int) fArea.t,
				(int) fArea.l,
				(int) fArea.b,
				(int) fArea.r,
				(unsigned) fPlane,
				(unsigned) fPlanes,
				(unsigned) fRowPitch,
				(unsigned) fColPitch);

		}

	#endif

	}
Exemple #2
0
dng_opcode_TrimBounds::dng_opcode_TrimBounds (dng_stream &stream)

	:	dng_opcode (dngOpcode_TrimBounds,
					stream,
					"TrimBounds")

	,	fBounds ()

	{

	if (stream.Get_uint32 () != 16)
		{
		ThrowBadFormat ();
		}

	fBounds.t = stream.Get_int32 ();
	fBounds.l = stream.Get_int32 ();
	fBounds.b = stream.Get_int32 ();
	fBounds.r = stream.Get_int32 ();

	if (fBounds.IsEmpty ())
		{
		ThrowBadFormat ();
		}

	#if qDNGValidate

	if (gVerbose)
		{

		printf ("Bounds: t=%d, l=%d, b=%d, r=%d\n",
				(int) fBounds.t,
				(int) fBounds.l,
				(int) fBounds.b,
				(int) fBounds.r);

		}

	#endif

	}