BMIHeader.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /*
00003  * This file is a part of the libzmf project.
00004  *
00005  * This Source Code Form is subject to the terms of the Mozilla Public
00006  * License, v. 2.0. If a copy of the MPL was not distributed with this
00007  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
00008  */
00009 
00010 #ifndef BMIHEADER_H_INCLUDED
00011 #define BMIHEADER_H_INCLUDED
00012 
00013 #include "libzmf_utils.h"
00014 #include "BMITypes.h"
00015 #include <vector>
00016 
00017 namespace libzmf
00018 {
00019 
00020 class BMIHeader
00021 {
00022 public:
00023   BMIHeader();
00024 
00025   bool load(const RVNGInputStreamPtr &input);
00026 
00027   bool isSupported() const;
00028 
00029   unsigned size() const;
00030 
00031   unsigned startOffset() const;
00032 
00033   unsigned width() const;
00034   unsigned height() const;
00035 
00036   bool isPaletteMode() const;
00037 
00038   unsigned colorDepth() const;
00039 
00040   unsigned paletteColorCount() const;
00041 
00042   const std::vector<BMIOffset> &offsets() const;
00043 
00044 private:
00045   void readOffsets(const RVNGInputStreamPtr &input, uint16_t offsetCount);
00046 
00047   std::string m_signature;
00048 
00049   unsigned m_size;
00050 
00051   unsigned m_startOffset;
00052 
00053   unsigned m_width;
00054   unsigned m_height;
00055 
00056   bool m_isPaletteMode;
00057 
00058   unsigned m_colorDepth;
00059 
00060   std::vector<BMIOffset> m_offsets;
00061 };
00062 
00063 }
00064 
00065 #endif // BMIHEADER_H_INCLUDED
00066 
00067 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */