void dng_gain_map::PutStream (dng_stream &stream) const { stream.Put_uint32 (fPoints.v); stream.Put_uint32 (fPoints.h); stream.Put_real64 (fSpacing.v); stream.Put_real64 (fSpacing.h); stream.Put_real64 (fOrigin.v); stream.Put_real64 (fOrigin.h); stream.Put_uint32 (fPlanes); for (int32 rowIndex = 0; rowIndex < fPoints.v; rowIndex++) { for (int32 colIndex = 0; colIndex < fPoints.h; colIndex++) { for (uint32 plane = 0; plane < fPlanes; plane++) { stream.Put_real32 (Entry (rowIndex, colIndex, plane)); } } } }
void dng_opcode_MapPolynomial::PutData (dng_stream &stream) const { stream.Put_uint32 (dng_area_spec::kDataSize + 4 + (fDegree + 1) * 8); fAreaSpec.PutData (stream); stream.Put_uint32 (fDegree); for (uint32 j = 0; j <= fDegree; j++) { stream.Put_real64 (fCoefficient [j]); } }
void dng_area_spec::PutData (dng_stream &stream) const { stream.Put_int32 (fArea.t); stream.Put_int32 (fArea.l); stream.Put_int32 (fArea.b); stream.Put_int32 (fArea.r); stream.Put_uint32 (fPlane); stream.Put_uint32 (fPlanes); stream.Put_uint32 (fRowPitch); stream.Put_uint32 (fColPitch); }
void dng_opcode_MapTable::PutData (dng_stream &stream) const { stream.Put_uint32 (dng_area_spec::kDataSize + 4 + fCount * 2); fAreaSpec.PutData (stream); stream.Put_uint32 (fCount); uint16 *table = fTable->Buffer_uint16 (); for (uint32 index = 0; index < fCount; index++) { stream.Put_uint16 (table [index]); } }
void dng_opcode_GainMap::PutData (dng_stream &stream) const { stream.Put_uint32 (dng_area_spec::kDataSize + fGainMap->PutStreamSize ()); fAreaSpec.PutData (stream); fGainMap->PutStream (stream); }
void dng_opcode_TrimBounds::PutData (dng_stream &stream) const { stream.Put_uint32 (16); stream.Put_int32 (fBounds.t); stream.Put_int32 (fBounds.l); stream.Put_int32 (fBounds.b); stream.Put_int32 (fBounds.r); }
void dng_opcode_DeltaPerRow::PutData (dng_stream &stream) const { uint32 deltas = (fAreaSpec.Area ().H () + fAreaSpec.RowPitch () - 1) / fAreaSpec.RowPitch (); stream.Put_uint32 (dng_area_spec::kDataSize + 4 + deltas * 4); fAreaSpec.PutData (stream); stream.Put_uint32 (deltas); real32 *table = fTable->Buffer_real32 (); for (uint32 j = 0; j < deltas; j++) { stream.Put_real32 (table [j]); } }
void dng_opcode_ScalePerColumn::PutData (dng_stream &stream) const { uint32 scales = (fAreaSpec.Area ().W () + fAreaSpec.ColPitch () - 1) / fAreaSpec.ColPitch (); stream.Put_uint32 (dng_area_spec::kDataSize + 4 + scales * 4); fAreaSpec.PutData (stream); stream.Put_uint32 (scales); real32 *table = fTable->Buffer_real32 (); for (uint32 j = 0; j < scales; j++) { stream.Put_real32 (table [j]); } }
void dng_jpeg_preview::SpoolAdobeThumbnail (dng_stream &stream) const { DNG_ASSERT (fCompressedData.Get (), "SpoolAdobeThumbnail: no data"); DNG_ASSERT (fPhotometricInterpretation == piYCbCr, "SpoolAdobeThumbnail: Non-YCbCr"); uint32 compressedSize = fCompressedData->LogicalSize (); stream.Put_uint32 (DNG_CHAR4 ('8','B','I','M')); stream.Put_uint16 (1036); stream.Put_uint16 (0); stream.Put_uint32 (compressedSize + 28); uint32 widthBytes = (fPreviewSize.h * 24 + 31) / 32 * 4; stream.Put_uint32 (1); stream.Put_uint32 (fPreviewSize.h); stream.Put_uint32 (fPreviewSize.v); stream.Put_uint32 (widthBytes); stream.Put_uint32 (widthBytes * fPreviewSize.v); stream.Put_uint32 (compressedSize); stream.Put_uint16 (24); stream.Put_uint16 (1); stream.Put (fCompressedData->Buffer (), compressedSize); if (compressedSize & 1) { stream.Put_uint8 (0); } }