本文整理汇总了C++中exifdata::const_iterator::size方法的典型用法代码示例。如果您正苦于以下问题:C++ const_iterator::size方法的具体用法?C++ const_iterator::size怎么用?C++ const_iterator::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类exifdata::const_iterator
的用法示例。
在下文中一共展示了const_iterator::size方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void Exiv2Lib::setWhiteBalanceCoeffsCanon(ExifData& data, float wb[3])
{
ExifData::const_iterator pos;
if (*mExifInfo.model == "Canon EOS 300D DIGITAL" ||
*mExifInfo.model == "Canon EOS DIGITAL REBEL")
{
pos = data.findKey(ExifKey("Exif.Canon.WhiteBalanceTable"));
if (pos != data.end())
{
qDebug() << "Reading EOS 300D tags";
uint16_t* cdata = new uint16_t[pos->size() / 2];
pos->copy((unsigned char*)cdata, littleEndian);
wb[0] = cdata[1];
wb[1] = (cdata[2] + cdata[3]) / 2;
wb[2] = cdata[4];
float mx = max3(wb[0], wb[1], wb[2]);
wb[0] /= mx;
wb[1] /= mx;
wb[2] /= mx;
delete [] cdata;
return;
}
}
pos = data.findKey(ExifKey("Exif.Canon.ColorData"));
if (pos != data.end())
{
uint8_t* cdata = new uint8_t[pos->size()];
struct Canon_ColorData* colorData;
pos->copy(cdata, littleEndian);
colorData = (struct Canon_ColorData*)cdata;
if (*mExifInfo.model == "Canon EOS 350D DIGITAL") // || EOS 20D
{
// optimize with bitshifts later
// wb[0] = colorData->V1.WhiteBalanceTable[WB_AsShot].RGGB[2];
// wb[1] = ((colorData->V1.WhiteBalanceTable[WB_AsShot].RGGB[1]+colorData->V1.WhiteBalanceTable[WB_AsShot].RGGB[3])/2);
// wb[2] = colorData->V1.WhiteBalanceTable[WB_AsShot].RGGB[0];
wb[0] = colorData->V1.WhiteBalanceTable[WB_AsShot].RGGB[0];
wb[1] =
((colorData->V1.WhiteBalanceTable[WB_AsShot].RGGB[1] +
colorData->V1.WhiteBalanceTable[WB_AsShot].RGGB[2]) / 2);
wb[2] = colorData->V1.WhiteBalanceTable[WB_AsShot].RGGB[3];
qDebug() << "WB EOS 350D DIGITAL RGGB" << wb[0] << "," << wb[1] <<
"," << wb[2];
}
else if (*mExifInfo.model == "Canon EOS 1D Mark II") // || 1Ds Mark II
{
qDebug() << "Whitebalance info unavailable";
}
else if (*mExifInfo.model == "Canon G10")
{
qDebug() << "Whitebalance info unavailable";
}
else if (*mExifInfo.model == "Canon PowerShot S30")
{
wb[0] = colorData->V5.WhiteBalanceTable[WB_AsShot].GRBG[1];
wb[1] =
(colorData->V5.WhiteBalanceTable[WB_AsShot].GRBG[0] +
colorData->V5.WhiteBalanceTable[WB_AsShot].GRBG[3]) / 2;
wb[2] = colorData->V5.WhiteBalanceTable[WB_AsShot].GRBG[2];
}
else if (*mExifInfo.model == "Canon PowerShot S110")
{
wb[0] = colorData->V3.WhiteBalanceTable[WB_AsShot].RGGB[0];
wb[1] = (colorData->V3.WhiteBalanceTable[WB_AsShot].RGGB[1] +
colorData->V3.WhiteBalanceTable[WB_AsShot].RGGB[2]) / 2;
wb[2] = colorData->V3.WhiteBalanceTable[WB_AsShot].RGGB[3];
}
else // attempt to read at the default position at V4
{
qDebug() <<
"Model unknown, Parsing whitebalance using canon default format";
qDebug() << "Color data version: " << colorData->V7.version;
// optimize with bitshifs later
wb[0] = colorData->V7.WhiteBalanceTable[WB_AsShot].RGGB[0];
wb[1] =
(colorData->V7.WhiteBalanceTable[WB_AsShot].RGGB[1] +
colorData->V7.WhiteBalanceTable[WB_AsShot].RGGB[2]) / 2;
wb[2] = colorData->V7.WhiteBalanceTable[WB_AsShot].RGGB[3];
}
float mx = max3(wb[0], wb[1], wb[2]);
wb[0] /= mx;
wb[1] /= mx;
wb[2] /= mx;
delete [] cdata;
}
else
{
//.........这里部分代码省略.........