Graph.h
Go to the documentation of this file.
/*
* steghide 0.5.1 - a steganography program
* Copyright (C) 1999-2003 Stefan Hetzl <shetzl@chello.at>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
#ifndef SH_GRAPH_H
#define SH_GRAPH_H
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <vector>
#include "EdgeIterator.h"
#include "SampleValueAdjacencyList.h"
#include "common.h"
#include "wrapper_hash_set.h"
class BitString ;
class SampleOccurence ;
class Selector ;
class Vertex ;
class VertexContent ;
struct VertexContentsEqual ;
class Graph {
public:
Graph (CvrStgFile* cvr, const BitString& emb, Selector& sel) ;
~Graph (void) ;
unsigned long getNumVertices (void) const
{ return Vertices.size() ; } ;
Vertex* getVertex (VertexLabel l) const
{ return Vertices[l] ; } ;
void unmarkDeletedAllVertices (void) ;
float getAvgVertexDegree (void) const ;
void printVerboseInfo (void) ;
bool check (bool verbose = false) const ;
bool check_Vertices (bool verbose = false) const ;
bool check_SampleValues (bool verbose = false) const ;
bool check_SampleOccurences (bool verbose = false) const ;
bool check_SVALists (bool verbose = false) const ;
#ifdef DEBUG
void print (void) const ;
void print_gml (std::ostream& out) const ;
void printVertex_gml (std::ostream& out, Vertex* v, unsigned int recdepth, std::vector<bool>& nodeprinted, std::vector<bool>& edgesprinted, bool start = true) const ;
void printPrologue_gml (std::ostream& out) const ;
void printEpilogue_gml (std::ostream& out) const ;
void print_Vertices (unsigned short spc = 0) const ;
#endif
private:
//
// friend-declarations
//
friend class WKSConstructionHeuristic ;
friend class EdgeIterator ;
friend class SampleValueAdjacencyList ;
friend class Vertex ;
std::vector<Vertex*> Vertices ;
std::vector<SampleValue*> SampleValues ;
std::vector<SampleValueAdjacencyList*> SVALists ;
std::vector<std::list<SampleOccurence> > SampleOccurences ;
std::vector<UWORD32*> NumSampleOccurences ;
std::vector<std::list<SampleOccurence> > DeletedSampleOccurences ;
std::vector<UWORD32*> NumDeletedSampleOccurences ;
std::list<SampleOccurence>::iterator markDeletedSampleOccurence (std::list<SampleOccurence>::iterator it) ;
std::list<SampleOccurence>::iterator unmarkDeletedSampleOccurence (std::list<SampleOccurence>::iterator it) ;
//
// end of friend-declarations
// Note: private members of Graph that are declared beyond this point should
// not be used by friends.
//
void constructSamples (const std::vector<SamplePos*> &sposs, std::vector<SampleValue**>& svalues) ;
void constructVertices (std::vector<SamplePos*>& sposs, std::vector<SampleValue**>& svalues, const std::vector<EmbValue>& tvalues) ;
void constructEdges (void) ;
CvrStgFile *File ;
EmbValue EmbValueModulus ;
unsigned short SamplesPerVertex ;
bool check_SampleOccurences_size (bool verbose = false) const ;
bool check_SampleOccurences_correctness (bool verbose = false) const ;
bool check_SampleOccurences_completeness (bool verbose = false) const ;
bool check_SVALists_size (bool verbose = false) const ;
bool check_SVALists_soundness (bool verbose = false) const ;
bool check_SVALists_sorted (bool verbose = false) const ;
bool check_SVALists_uniqueness (bool verbose = false) const ;
bool check_SVALists_completeness (bool verbose = false) const ;
} ;
#endif // ndef SH_GRAPH_H
EdgeIterator.h
SampleValueAdjacencyList.h
BitString
a string of bits
Definition BitString.h:42
CvrStgFile
a cover-/stego-file
Definition CvrStgFile.h:46
Graph::~Graph
~Graph(void)
Definition Graph.cc:167
Graph::printVerboseInfo
void printVerboseInfo(void)
Definition Graph.cc:225
Graph::constructVertices
void constructVertices(std::vector< SamplePos * > &sposs, std::vector< SampleValue ** > &svalues, const std::vector< EmbValue > &tvalues)
Definition Graph.cc:114
Graph::check_SVALists_completeness
bool check_SVALists_completeness(bool verbose=false) const
Definition Graph.cc:500
Graph::Vertex
friend class Vertex
Definition Graph.h:138
Graph::File
CvrStgFile * File
Definition Graph.h:194
Graph::EmbValueModulus
EmbValue EmbValueModulus
Definition Graph.h:195
Graph::getVertex
Vertex * getVertex(VertexLabel l) const
Definition Graph.h:76
Graph::EdgeIterator
friend class EdgeIterator
Definition Graph.h:136
Graph::check_SVALists
bool check_SVALists(bool verbose=false) const
Definition Graph.cc:379
Graph::getNumVertices
unsigned long getNumVertices(void) const
Definition Graph.h:68
Graph::check_SVALists_soundness
bool check_SVALists_soundness(bool verbose=false) const
Definition Graph.cc:405
Graph::Vertices
std::vector< Vertex * > Vertices
contains the vertices in this graph - Vertices[l] is the vertex with label l
Definition Graph.h:141
Graph::check_SampleOccurences
bool check_SampleOccurences(bool verbose=false) const
Definition Graph.cc:328
Graph::unmarkDeletedSampleOccurence
std::list< SampleOccurence >::iterator unmarkDeletedSampleOccurence(std::list< SampleOccurence >::iterator it)
Definition Graph.cc:205
Graph::check_Vertices
bool check_Vertices(bool verbose=false) const
Definition Graph.cc:272
Graph::check_SVALists_uniqueness
bool check_SVALists_uniqueness(bool verbose=false) const
Definition Graph.cc:475
Graph::check
bool check(bool verbose=false) const
Definition Graph.cc:262
Graph::check_SampleOccurences_correctness
bool check_SampleOccurences_correctness(bool verbose=false) const
Definition Graph.cc:349
Graph::getAvgVertexDegree
float getAvgVertexDegree(void) const
Definition Graph.cc:216
Graph::check_SampleOccurences_size
bool check_SampleOccurences_size(bool verbose=false) const
Definition Graph.cc:337
Graph::SampleValues
std::vector< SampleValue * > SampleValues
contains the list of (unique) sample values - SampleValues[l] is the sample value with label l
Definition Graph.h:144
Graph::check_SampleValues
bool check_SampleValues(bool verbose=false) const
Definition Graph.cc:291
Graph::SampleValueAdjacencyList
friend class SampleValueAdjacencyList
Definition Graph.h:137
Graph::check_SampleOccurences_completeness
bool check_SampleOccurences_completeness(bool verbose=false) const
Definition Graph.cc:364
Graph::SVALists
std::vector< SampleValueAdjacencyList * > SVALists
contains the sample value adjacency lists (SVALists[v] contains only sample values with embedded valu...
Definition Graph.h:147
Graph::SamplesPerVertex
unsigned short SamplesPerVertex
Definition Graph.h:196
Graph::constructSamples
void constructSamples(const std::vector< SamplePos * > &sposs, std::vector< SampleValue ** > &svalues)
Definition Graph.cc:81
Graph::check_SVALists_size
bool check_SVALists_size(bool verbose=false) const
Definition Graph.cc:390
Graph::constructEdges
void constructEdges(void)
Definition Graph.cc:123
Graph::NumDeletedSampleOccurences
std::vector< UWORD32 * > NumDeletedSampleOccurences
Definition Graph.h:159
Graph::WKSConstructionHeuristic
friend class WKSConstructionHeuristic
Definition Graph.h:135
Graph::DeletedSampleOccurences
std::vector< std::list< SampleOccurence > > DeletedSampleOccurences
contains those sample occurences that have been marked as deleted from SampleOccurences
Definition Graph.h:158
Graph::Graph
Graph(CvrStgFile *cvr, const BitString &emb, Selector &sel)
Definition Graph.cc:39
Graph::unmarkDeletedAllVertices
void unmarkDeletedAllVertices(void)
Definition Graph.cc:187
Graph::SampleOccurences
std::vector< std::list< SampleOccurence > > SampleOccurences
SampleOccurences[l] contains all occurences of the sample value with label l.
Definition Graph.h:150
Graph::NumSampleOccurences
std::vector< UWORD32 * > NumSampleOccurences
Definition Graph.h:155
Graph::markDeletedSampleOccurence
std::list< SampleOccurence >::iterator markDeletedSampleOccurence(std::list< SampleOccurence >::iterator it)
Definition Graph.cc:194
Graph::check_SVALists_sorted
bool check_SVALists_sorted(bool verbose=false) const
Definition Graph.cc:440
SampleOccurence
Definition SampleOccurence.h:26
Selector
a random permutation of a random combination
Definition Selector.h:36
Vertex
a vertex in a graph
Definition Vertex.h:43
common.h
VertexLabel
UWORD32 VertexLabel
Definition common.h:68
EmbValue
BYTE EmbValue
Definition common.h:66
wrapper_hash_set.h