本文整理汇总了C++中ExifData::count方法的典型用法代码示例。如果您正苦于以下问题:C++ ExifData::count方法的具体用法?C++ ExifData::count怎么用?C++ ExifData::count使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ExifData
的用法示例。
在下文中一共展示了ExifData::count方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: writeExifData
uint32_t PsdImage::writeExifData(const ExifData& exifData, BasicIo& out)
{
uint32_t resLength = 0;
byte buf[8];
if (exifData.count() > 0) {
Blob blob;
ByteOrder bo = byteOrder();
if (bo == invalidByteOrder) {
bo = littleEndian;
setByteOrder(bo);
}
ExifParser::encode(blob, bo, exifData);
if (blob.size() > 0) {
#ifdef DEBUG
std::cerr << std::hex << "write: resourceId: " << kPhotoshopResourceID_ExifInfo << "\n";
std::cerr << std::dec << "Writing ExifInfo: size: " << blob.size() << "\n";
#endif
ul2Data(buf, kPhotoshopResourceType, bigEndian);
if (out.write(buf, 4) != 4) throw Error(21);
us2Data(buf, kPhotoshopResourceID_ExifInfo, bigEndian);
if (out.write(buf, 2) != 2) throw Error(21);
us2Data(buf, 0, bigEndian); // NULL resource name
if (out.write(buf, 2) != 2) throw Error(21);
ul2Data(buf, blob.size(), bigEndian);
if (out.write(buf, 4) != 4) throw Error(21);
// Write encoded Exif data
if (out.write(&blob[0], blob.size()) != static_cast<long>(blob.size())) throw Error(21);
resLength += blob.size() + 12;
if (blob.size() & 1) // even padding
{
buf[0] = 0;
if (out.write(buf, 1) != 1) throw Error(21);
resLength++;
}
}
}
return resLength;
} // PsdImage::writeExifData