steghide  0.5.1
Edge.h
Go to the documentation of this file.
1 /*
2  * steghide 0.5.1 - a steganography program
3  * Copyright (C) 1999-2003 Stefan Hetzl <shetzl@chello.at>
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18  *
19  */
20 
21 #ifndef SH_EDGE_H
22 #define SH_EDGE_H
23 
24 #include "SampleValue.h"
25 #include "Vertex.h"
26 #include "common.h"
27 
28 class Edge {
29  public:
33  Edge (void)
34  : Vertex1(NULL), Index1(0), Vertex2(NULL), Index2(0), Weight(UWORD32_MAX) {} ;
35 
39  Edge (Vertex *v1, unsigned short idx1, Vertex *v2, unsigned short idx2) ;
40 
44  Edge (const Edge& e) ;
45 
46  Vertex *getVertex1 (void) const
47  { return Vertex1 ; } ;
48 
49  void setVertex1 (Vertex* v)
50  { Vertex1 = v ; } ;
51 
52  Vertex *getVertex2 (void) const
53  { return Vertex2 ; } ;
54 
55  unsigned short getIndex1 (void) const
56  { return Index1 ; } ;
57 
58  void setIndex1 (unsigned short i)
59  { Index1 = i ; } ;
60 
61  unsigned short getIndex2 (void) const
62  { return Index2 ; } ;
63 
64  UWORD32 getWeight (void) ;
65 
66  void set (Vertex* v1, unsigned short idx1, Vertex* v2, unsigned short idx2) ;
67 
68  void set1 (Vertex* v1, unsigned short idx1) ;
69 
70  void set2 (Vertex* v2, unsigned short idx2) ;
71 
72  bool operator== (const Edge& e) const ;
73 
74  bool operator!= (const Edge& e) const ;
75 
79  void swap (void) ;
80 
84  bool contains (const Vertex *v) const ;
85 
89  Vertex *getOtherVertex (const Vertex *v) const ;
90 
94  SamplePos getSamplePos (Vertex* v) const ;
95 
100 
105 
106  void print (unsigned short spc = 0) const ;
107 
108  private:
111  unsigned short Index1 ;
112 
115  unsigned short Index2 ;
116 
118 } ;
119 
120 #endif // ndef SH_EDGE_H
Edge::set1
void set1(Vertex *v1, unsigned short idx1)
Definition: Edge.cc:58
SamplePos
UWORD32 SamplePos
Definition: common.h:67
UWORD32_MAX
#define UWORD32_MAX
Definition: common.h:53
Edge::getOtherVertex
Vertex * getOtherVertex(const Vertex *v) const
Definition: Edge.cc:106
UWORD32
unsigned long UWORD32
Definition: common.h:45
Edge::operator!=
bool operator!=(const Edge &e) const
Definition: Edge.cc:85
Edge::Index2
unsigned short Index2
contains the index of the sample (of those in Vertex2) that will be changed (if this edge is used)
Definition: Edge.h:115
Edge::swap
void swap(void)
Definition: Edge.cc:90
Edge::Edge
Edge(void)
Definition: Edge.h:33
Edge::Vertex2
Vertex * Vertex2
Definition: Edge.h:113
Edge::operator==
bool operator==(const Edge &e) const
Definition: Edge.cc:72
Edge::contains
bool contains(const Vertex *v) const
Definition: Edge.cc:101
SampleValue
the value of a sample in a CvrStgFile
Definition: SampleValue.h:61
Edge::Index1
unsigned short Index1
contains the index of the sample (of those in Vertex1) that will be changed (if this edge is used)
Definition: Edge.h:111
Edge::getVertex2
Vertex * getVertex2(void) const
Definition: Edge.h:52
Edge::getWeight
UWORD32 getWeight(void)
Definition: Edge.cc:41
Vertex.h
Edge::set
void set(Vertex *v1, unsigned short idx1, Vertex *v2, unsigned short idx2)
Definition: Edge.cc:49
Edge::getVertex1
Vertex * getVertex1(void) const
Definition: Edge.h:46
Edge::getIndex2
unsigned short getIndex2(void) const
Definition: Edge.h:61
Edge::setVertex1
void setVertex1(Vertex *v)
Definition: Edge.h:49
common.h
Edge
Definition: Edge.h:28
Edge::Weight
UWORD32 Weight
Definition: Edge.h:117
Edge::getIndex1
unsigned short getIndex1(void) const
Definition: Edge.h:55
Edge::print
void print(unsigned short spc=0) const
Definition: Edge.cc:166
Vertex
a vertex in a graph
Definition: Vertex.h:43
Edge::Vertex1
Vertex * Vertex1
Definition: Edge.h:109
Edge::getSamplePos
SamplePos getSamplePos(Vertex *v) const
Definition: Edge.cc:121
SampleValue.h
Edge::set2
void set2(Vertex *v2, unsigned short idx2)
Definition: Edge.cc:65
Edge::getReplacingSampleValue
SampleValue * getReplacingSampleValue(Vertex *v) const
Definition: Edge.cc:151
Edge::setIndex1
void setIndex1(unsigned short i)
Definition: Edge.h:58
Edge::getOriginalSampleValue
SampleValue * getOriginalSampleValue(Vertex *v) const
Definition: Edge.cc:136