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
28class 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
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
Definition: Edge.h:28
void set1(Vertex *v1, unsigned short idx1)
Definition: Edge.cc:58
void set2(Vertex *v2, unsigned short idx2)
Definition: Edge.cc:65
unsigned short getIndex1(void) const
Definition: Edge.h:55
Vertex * Vertex1
Definition: Edge.h:109
Vertex * getVertex2(void) const
Definition: Edge.h:52
unsigned short getIndex2(void) const
Definition: Edge.h:61
bool contains(const Vertex *v) const
Definition: Edge.cc:101
bool operator==(const Edge &e) const
Definition: Edge.cc:72
Edge(void)
Definition: Edge.h:33
void print(unsigned short spc=0) const
Definition: Edge.cc:166
void setIndex1(unsigned short i)
Definition: Edge.h:58
Vertex * getOtherVertex(const Vertex *v) const
Definition: Edge.cc:106
SampleValue * getReplacingSampleValue(Vertex *v) const
Definition: Edge.cc:151
Vertex * Vertex2
Definition: Edge.h:113
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
void setVertex1(Vertex *v)
Definition: Edge.h:49
UWORD32 Weight
Definition: Edge.h:117
bool operator!=(const Edge &e) const
Definition: Edge.cc:85
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
UWORD32 getWeight(void)
Definition: Edge.cc:41
SampleValue * getOriginalSampleValue(Vertex *v) const
Definition: Edge.cc:136
Vertex * getVertex1(void) const
Definition: Edge.h:46
void set(Vertex *v1, unsigned short idx1, Vertex *v2, unsigned short idx2)
Definition: Edge.cc:49
void swap(void)
Definition: Edge.cc:90
SamplePos getSamplePos(Vertex *v) const
Definition: Edge.cc:121
the value of a sample in a CvrStgFile
Definition: SampleValue.h:61
a vertex in a graph
Definition: Vertex.h:43
UWORD32 SamplePos
Definition: common.h:67
unsigned long UWORD32
Definition: common.h:45
#define UWORD32_MAX
Definition: common.h:53