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
Graph::check_SVALists_completeness
bool check_SVALists_completeness(bool verbose=false) const
Definition: Graph.cc:499
Graph::unmarkDeletedSampleOccurence
std::list< SampleOccurence >::iterator unmarkDeletedSampleOccurence(std::list< SampleOccurence >::iterator it)
Definition: Graph.cc:204
Graph::Graph
Graph(CvrStgFile *cvr, const BitString &emb, Selector &sel)
Definition: Graph.cc:38
Graph
a graph constructed from a cover file and a message to be embedded
Definition: Graph.h:51
CvrStgFile
a cover-/stego-file
Definition: CvrStgFile.h:46
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::unmarkDeletedAllVertices
void unmarkDeletedAllVertices(void)
Definition: Graph.cc:186
Graph::NumDeletedSampleOccurences
std::vector< UWORD32 * > NumDeletedSampleOccurences
Definition: Graph.h:159
Graph::check
bool check(bool verbose=false) const
Definition: Graph.cc:261
Graph::check_SVALists_uniqueness
bool check_SVALists_uniqueness(bool verbose=false) const
Definition: Graph.cc:474
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::check_SampleOccurences_size
bool check_SampleOccurences_size(bool verbose=false) const
Definition: Graph.cc:336
Graph::getAvgVertexDegree
float getAvgVertexDegree(void) const
Definition: Graph.cc:215
Graph::check_SampleValues
bool check_SampleValues(bool verbose=false) const
Definition: Graph.cc:290
Graph::check_SVALists_soundness
bool check_SVALists_soundness(bool verbose=false) const
Definition: Graph.cc:404
Graph::SamplesPerVertex
unsigned short SamplesPerVertex
Definition: Graph.h:196
Graph::NumSampleOccurences
std::vector< UWORD32 * > NumSampleOccurences
Definition: Graph.h:155
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::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_SVALists_size
bool check_SVALists_size(bool verbose=false) const
Definition: Graph.cc:389
VertexLabel
UWORD32 VertexLabel
Definition: common.h:68
Graph::constructVertices
void constructVertices(std::vector< SamplePos *> &sposs, std::vector< SampleValue **> &svalues, const std::vector< EmbValue > &tvalues)
Definition: Graph.cc:113
SampleValueAdjacencyList
an adjacency list-like data structur for sample values
Definition: SampleValueAdjacencyList.h:33
EdgeIterator.h
WKSConstructionHeuristic
a heuristic algorithm for constructing a matching
Definition: WKSConstructionHeuristic.h:48
Selector
a random permutation of a random combination
Definition: Selector.h:36
Graph::constructSamples
void constructSamples(const std::vector< SamplePos *> &sposs, std::vector< SampleValue **> &svalues)
Definition: Graph.cc:80
Graph::constructEdges
void constructEdges(void)
Definition: Graph.cc:122
Graph::check_SampleOccurences_correctness
bool check_SampleOccurences_correctness(bool verbose=false) const
Definition: Graph.cc:348
EdgeIterator
allows an iteration trough all edges of a vertex
Definition: EdgeIterator.h:51
SampleOccurence
Definition: SampleOccurence.h:26
Graph::printVerboseInfo
void printVerboseInfo(void)
Definition: Graph.cc:224
Graph::getNumVertices
unsigned long getNumVertices(void) const
Definition: Graph.h:68
BitString
a string of bits
Definition: BitString.h:42
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::check_SampleOccurences
bool check_SampleOccurences(bool verbose=false) const
Definition: Graph.cc:327
SampleValueAdjacencyList.h
common.h
EmbValue
BYTE EmbValue
Definition: common.h:66
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::check_SVALists_sorted
bool check_SVALists_sorted(bool verbose=false) const
Definition: Graph.cc:439
Graph::markDeletedSampleOccurence
std::list< SampleOccurence >::iterator markDeletedSampleOccurence(std::list< SampleOccurence >::iterator it)
Definition: Graph.cc:193
Graph::check_SVALists
bool check_SVALists(bool verbose=false) const
Definition: Graph.cc:378
wrapper_hash_set.h
Graph::check_SampleOccurences_completeness
bool check_SampleOccurences_completeness(bool verbose=false) const
Definition: Graph.cc:363
Graph::check_Vertices
bool check_Vertices(bool verbose=false) const
Definition: Graph.cc:271
Vertex
a vertex in a graph
Definition: Vertex.h:43
Graph::~Graph
~Graph(void)
Definition: Graph.cc:166