TiffEntryImpl.cpp revision 272b7f26c300d2029f278cf2af523cf94e513b89
1/* 2 * Copyright 2014 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17#include <img_utils/TiffEntryImpl.h> 18#include <img_utils/TiffIfd.h> 19 20#include <utils/Vector.h> 21 22namespace android { 23namespace img_utils { 24 25template<> 26size_t TiffEntryImpl<TiffIfd>::getSize() const { 27 uint32_t total = 0; 28 for (uint32_t i = 0; i < mCount; ++i) { 29 total += mData[i].getSize(); 30 } 31 return total; 32} 33 34template<> 35status_t TiffEntryImpl<TiffIfd>::writeData(uint32_t offset, EndianOutput* out) const { 36 status_t ret = OK; 37 for (uint32_t i = 0; i < mCount; ++i) { 38 BAIL_ON_FAIL(mData[i].writeData(offset, out), ret); 39 } 40 return ret; 41} 42 43} /*namespace img_utils*/ 44} /*namespace android*/ 45