本文整理汇总了C++中dng_stream类的典型用法代码示例。如果您正苦于以下问题:C++ dng_stream类的具体用法?C++ dng_stream怎么用?C++ dng_stream使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了dng_stream类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PutStream
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));
}
}
}
}
示例2:
dng_opcode_GainMap::dng_opcode_GainMap (dng_host &host,
dng_stream &stream)
: dng_inplace_opcode (dngOpcode_GainMap,
stream,
"GainMap")
, fAreaSpec ()
, fGainMap ()
{
uint32 byteCount = stream.Get_uint32 ();
uint64 startPosition = stream.Position ();
fAreaSpec.GetData (stream);
fGainMap.Reset (dng_gain_map::GetStream (host, stream));
if (stream.Position () != startPosition + byteCount)
{
ThrowBadFormat ();
}
}
示例3: DuplicateStream
void dng_stream::DuplicateStream (dng_stream &dstStream)
{
// Turn off sniffers for this operation.
TempStreamSniffer noSniffer1 (*this , NULL);
TempStreamSniffer noSniffer2 (dstStream, NULL);
// First grow the destination stream if required, in an attempt to
// reserve any needed space before overwriting the existing data.
if (dstStream.Length () < Length ())
{
dstStream.SetLength (Length ());
}
SetReadPosition (0);
dstStream.SetWritePosition (0);
CopyToStream (dstStream, Length ());
dstStream.Flush ();
dstStream.SetLength (Length ());
}
示例4: ReadHueSatMap
void dng_camera_profile::ReadHueSatMap (dng_stream &stream,
dng_hue_sat_map &hueSatMap,
uint32 hues,
uint32 sats,
uint32 vals,
bool skipSat0)
{
hueSatMap.SetDivisions (hues, sats, vals);
for (uint32 val = 0; val < vals; val++)
{
for (uint32 hue = 0; hue < hues; hue++)
{
for (uint32 sat = skipSat0 ? 1 : 0; sat < sats; sat++)
{
dng_hue_sat_map::HSBModify modify;
modify.fHueShift = stream.Get_real32 ();
modify.fSatScale = stream.Get_real32 ();
modify.fValScale = stream.Get_real32 ();
hueSatMap.SetDelta (hue, sat, val, modify);
}
}
}
}
示例5:
dng_opcode_MapPolynomial::dng_opcode_MapPolynomial (dng_stream &stream)
: dng_inplace_opcode (dngOpcode_MapPolynomial,
stream,
"MapPolynomial")
, fAreaSpec ()
, fDegree (0)
{
uint32 dataSize = stream.Get_uint32 ();
fAreaSpec.GetData (stream);
fDegree = stream.Get_uint32 ();
if (dataSize != dng_area_spec::kDataSize + 4 + (fDegree + 1) * 8)
{
ThrowBadFormat ();
}
if (fDegree > kMaxDegree)
{
ThrowBadFormat ();
}
for (uint32 j = 0; j <= kMaxDegree; j++)
{
if (j <= fDegree)
{
fCoefficient [j] = stream.Get_real64 ();
}
else
{
fCoefficient [j] = 0.0;
}
}
#if qDNGValidate
if (gVerbose)
{
for (uint32 k = 0; k <= fDegree; k++)
{
printf (" Coefficient [%u] = %f\n", k, fCoefficient [k]);
}
}
#endif
}
示例6: PutData
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);
}
示例7: GetData
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
}
示例8: WriteData
void dng_jpeg_preview::WriteData (dng_host & /* host */,
dng_image_writer & /* writer */,
dng_basic_tag_set &basic,
dng_stream &stream) const
{
basic.SetTileOffset (0, (uint32) stream.Position ());
basic.SetTileByteCount (0, fCompressedData->LogicalSize ());
stream.Put (fCompressedData->Buffer (),
fCompressedData->LogicalSize ());
if (fCompressedData->LogicalSize () & 1)
{
stream.Put_uint8 (0);
}
}
示例9: CopyToStream
void dng_stream::CopyToStream (dng_stream &dstStream,
uint64 count)
{
uint8 smallBuffer [1024];
if (count <= sizeof (smallBuffer))
{
Get (smallBuffer, (uint32) count);
dstStream.Put (smallBuffer, (uint32) count);
}
else
{
const uint32 bigBufferSize = (uint32) Min_uint64 (kBigBufferSize,
count);
dng_memory_data bigBuffer (bigBufferSize);
while (count)
{
uint32 blockCount = (uint32) Min_uint64 (bigBufferSize,
count);
Get (bigBuffer.Buffer (),
blockCount);
dstStream.Put (bigBuffer.Buffer (),
blockCount);
count -= blockCount;
}
}
}
示例10: PutData
void dng_opcode_GainMap::PutData (dng_stream &stream) const
{
stream.Put_uint32 (dng_area_spec::kDataSize +
fGainMap->PutStreamSize ());
fAreaSpec.PutData (stream);
fGainMap->PutStream (stream);
}
示例11:
TempStreamSniffer::TempStreamSniffer (dng_stream &stream,
dng_abort_sniffer *sniffer)
: fStream (stream)
, fOldSniffer (stream.Sniffer ())
{
fStream.SetSniffer (sniffer);
}
示例12: ParseString
void dng_iptc::ParseString (dng_stream &stream,
dng_string &s,
CharSet charSet)
{
uint32 length = stream.Get_uint16 ();
dng_memory_data buffer (length + 1);
char *c = buffer.Buffer_char ();
stream.Get (c, length);
c [length] = 0;
switch (charSet)
{
case kCharSetUTF8:
{
s.Set_UTF8 (c);
break;
}
default:
{
s.Set_SystemEncoding (c);
}
}
s.SetLineEndingsToNewLines ();
s.StripLowASCII ();
s.TrimTrailingBlanks ();
}
示例13: CopyToStream
void dng_memory_stream::CopyToStream (dng_stream &dstStream,
uint64 count)
{
if (count < kBigBufferSize)
{
dng_stream::CopyToStream (dstStream, count);
}
else
{
Flush ();
uint64 offset = Position ();
if (offset + count > Length ())
{
ThrowEndOfFile ();
}
while (count)
{
uint32 pageIndex = (uint32) (offset / fPageSize);
uint32 pageOffset = (uint32) (offset % fPageSize);
uint32 blockCount = (uint32) Min_uint64 (fPageSize - pageOffset, count);
const uint8 *sPtr = fPageList [pageIndex]->Buffer_uint8 () +
pageOffset;
dstStream.Put (sPtr, blockCount);
offset += blockCount;
count -= blockCount;
}
SetReadPosition (offset);
}
}
示例14: Parse
void dng_info::Parse (dng_host &host,
dng_stream &stream)
{
fTIFFBlockOffset = stream.Position ();
fTIFFBlockOriginalOffset = stream.PositionInOriginalFile ();
// Check byte order indicator.
uint16 byteOrder = stream.Get_uint16 ();
if (byteOrder == byteOrderII)
{
fBigEndian = false;
#if qDNGValidate
if (gVerbose)
{
printf ("\nUses little-endian byte order\n");
}
#endif
stream.SetLittleEndian ();
}
else if (byteOrder == byteOrderMM)
{
fBigEndian = true;
#if qDNGValidate
if (gVerbose)
{
printf ("\nUses big-endian byte order\n");
}
#endif
stream.SetBigEndian ();
}
else
{
#if qDNGValidate
ReportError ("Unknown byte order");
#endif
ThrowBadFormat ();
}
// Check "magic number" indicator.
fMagic = stream.Get_uint16 ();
#if qDNGValidate
if (gVerbose)
{
printf ("Magic number = %u\n\n", (unsigned) fMagic);
}
#endif
ValidateMagic ();
// Parse IFD 0.
uint64 next_offset = stream.Get_uint32 ();
fExif.Reset (host.Make_dng_exif ());
fShared.Reset (host.Make_dng_shared ());
fIFD [0].Reset (host.Make_dng_ifd ());
ParseIFD (host,
stream,
fExif.Get (),
fShared.Get (),
fIFD [0].Get (),
fTIFFBlockOffset + next_offset,
fTIFFBlockOffset,
0);
next_offset = fIFD [0]->fNextIFD;
fIFDCount = 1;
// Parse chained IFDs.
//.........这里部分代码省略.........
示例15: ParseTag
void dng_info::ParseTag (dng_host &host,
dng_stream &stream,
dng_exif *exif,
dng_shared *shared,
dng_ifd *ifd,
uint32 parentCode,
uint32 tagCode,
uint32 tagType,
uint32 tagCount,
uint64 tagOffset,
int64 offsetDelta)
{
bool isSubIFD = parentCode >= tcFirstSubIFD &&
parentCode <= tcLastSubIFD;
bool isMainIFD = (parentCode == 0 || isSubIFD) &&
ifd &&
ifd->fUsesNewSubFileType &&
ifd->fNewSubFileType == sfMainImage;
// Panasonic RAW format stores private tags using tag codes < 254 in
// IFD 0. Redirect the parsing of these tags into a logical
// "PanasonicRAW" IFD.
// Panasonic is starting to use some higher numbers also (280..283).
if (fMagic == 85 && parentCode == 0 && (tagCode < tcNewSubFileType ||
(tagCode >= 280 && tagCode <= 283)))
{
parentCode = tcPanasonicRAW;
ifd = NULL;
}
stream.SetReadPosition (tagOffset);
if (ifd && ifd->ParseTag (stream,
parentCode,
tagCode,
tagType,
tagCount,
tagOffset))
{
return;
}
stream.SetReadPosition (tagOffset);
if (exif && shared && exif->ParseTag (stream,
*shared,
parentCode,
isMainIFD,
tagCode,
tagType,
tagCount,
tagOffset))
{
return;
}
stream.SetReadPosition (tagOffset);
if (shared && exif && shared->ParseTag (stream,
*exif,
parentCode,
isMainIFD,
tagCode,
tagType,
tagCount,
tagOffset,
offsetDelta))
{
return;
}
if (parentCode == tcOlympusMakerNote &&
tagType == ttUndefined &&
tagCount >= 14)
{
uint32 olympusMakerParent = 0;
switch (tagCode)
{
case 8208:
olympusMakerParent = tcOlympusMakerNote8208;
break;
case 8224:
olympusMakerParent = tcOlympusMakerNote8224;
//.........这里部分代码省略.........