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