MCPcopy Create free account
hub / github.com/Exiv2/exiv2 / encodeArray

Method encodeArray

src/crwimage_int.cpp:908–934  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

906}
907
908void CrwMap::encodeArray(const Image& image, const CrwMapping* pCrwMapping, CiffHeader* pHead) {
909 auto ifdId = [=] {
910 switch (pCrwMapping->tag_) {
911 case 0x0001:
912 return IfdId::canonCsId;
913 case 0x0004:
914 return IfdId::canonSiId;
915 case 0x000f:
916 return IfdId::canonCfId;
917 case 0x0012:
918 return IfdId::canonPiId;
919 }
920 return IfdId::ifdIdNotSet;
921 }();
922 DataBuf buf = packIfdId(image.exifData(), ifdId, pHead->byteOrder());
923 if (buf.empty()) {
924 // Try the undecoded tag
925 encodeBasic(image, pCrwMapping, pHead);
926 }
927 if (!buf.empty()) {
928 // Write the number of shorts to the beginning of buf
929 buf.write_uint16(0, static_cast<uint16_t>(buf.size()), pHead->byteOrder());
930 pHead->add(pCrwMapping->crwTagId_, pCrwMapping->crwDir_, std::move(buf));
931 } else {
932 pHead->remove(pCrwMapping->crwTagId_, pCrwMapping->crwDir_);
933 }
934} // CrwMap::encodeArray
935
936void CrwMap::encode0x180e(const Image& image, const CrwMapping* pCrwMapping, CiffHeader* pHead) {
937 time_t t = 0;

Callers

nothing calls this directly

Calls 7

packIfdIdFunction · 0.85
write_uint16Method · 0.80
removeMethod · 0.80
byteOrderMethod · 0.45
emptyMethod · 0.45
sizeMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected