SilentEye 0.4.1

modules/seformatjpeg/stegotable.h

Go to the documentation of this file.
00001 //  This file is part of SilentEye.
00002 //
00003 //  SilentEye is free software: you can redistribute it and/or modify
00004 //  it under the terms of the GNU General Public License as published by
00005 //  the Free Software Foundation, either version 3 of the License, or
00006 //  (at your option) any later version.
00007 //
00008 //  SilentEye is distributed in the hope that it will be useful,
00009 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011 //  GNU General Public License for more details.
00012 //
00013 //  You should have received a copy of the GNU General Public License
00014 //  along with SilentEye.  If not, see <http://www.gnu.org/licenses/>.
00015 
00016 #include <QString>
00017 #include <QBitArray>
00018 #include <QVector>
00019 
00020 #include <logger.h>
00021 #include <QPointer>
00022 
00023 #ifndef STEGOTABLE_H_
00024 #define STEGOTABLE_H_
00025 
00026 #define DEFAULT_K 20
00027 
00028 using namespace SilentEyeFramework;
00029 
00030 namespace SEFormatJPEG
00031 {
00033     class StegoTable : QObject
00034     {
00035     private:
00037         QPointer<Logger> m_logger;
00038 
00040         quint8 _k;
00041 
00043         quint8 _currentTable;
00044 
00046         QVector<QBitArray> _stTables;
00047 
00049         QVector<quint8> _indexTable;
00050 
00052         QString _md5;
00053 
00054     public:
00056         StegoTable(const QString&, const quint8=DEFAULT_K, QObject* parent=0);
00057         ~StegoTable();
00058 
00060         quint8 k();
00061 
00062         float computeNewMiv(float, bool);
00063         bool computeValue(float, bool=true);
00064 
00066         QString toString();
00067 
00068     private:
00070         QBitArray getNextTable();
00072         float computeMiddle(float);
00074         void init_tables();
00076         void initIndexTable();
00077 
00078     };
00079 }
00080 
00081 #endif