steghide 0.5.1
BmpRGBSampleValue.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_BMPRGBSAMPLEVALUE_H
22#define SH_BMPRGBSAMPLEVALUE_H
23
24#include "BmpSampleValue.h"
25#include "RGBTriple.h"
26#include "common.h"
27
33 public:
36
37 UWORD32 calcDistance (const SampleValue *s) const ;
39 std::string getName (void) const ;
40
41 BYTE getRed (void) const { return Color.Red ; } ;
42 BYTE getGreen (void) const { return Color.Green ; } ;
43 BYTE getBlue (void) const { return Color.Blue ; } ;
44
45 private:
47
48 UWORD32 calcKey (const RGBTriple& rgb) const
49 { return (((UWORD32) rgb.Red << 16) | ((UWORD32) rgb.Green << 8) | ((UWORD32) rgb.Blue)) ;} ;
50
51 EmbValue calcEValue (const RGBTriple& rgb) const
52 // { /* for Modulus 8 */ return ((EmbValue) (((rgb.Red & 1) << 2) | ((rgb.Green & 1) << 1) | (rgb.Blue & 1))) ; } ;
53 { /* for Modulus 4 */ return ((EmbValue) ((((rgb.Red & 1) ^ (rgb.Green & 1)) << 1) | ((rgb.Red & 1) ^ (rgb.Blue & 1)))) ; } ;
54
55 enum COLOR { RED, GREEN, BLUE } ;
56 enum DIRECTION { UP, DOWN } ;
57
62 BYTE plus (BYTE a, BYTE b) const ;
63
68 BYTE minus (BYTE a, BYTE b) const ;
69
77 void addNTSVCandidates (std::vector<RGBTriple>& cands, const BYTE cube[3][2], COLOR fc, DIRECTION fd, COLOR i1, COLOR i2, EmbValue t) const ;
78} ;
79
80#endif // ndef SH_BMPRGBSAMPLEVALUE_H
a sample in a bmp rgb (i.e. 24-bit) file
Definition: BmpRGBSampleValue.h:32
COLOR
Definition: BmpRGBSampleValue.h:55
@ GREEN
Definition: BmpRGBSampleValue.h:55
@ RED
Definition: BmpRGBSampleValue.h:55
@ BLUE
Definition: BmpRGBSampleValue.h:55
BmpRGBSampleValue(BYTE r, BYTE g, BYTE b)
Definition: BmpRGBSampleValue.cc:23
BYTE getBlue(void) const
Definition: BmpRGBSampleValue.h:43
UWORD32 calcDistance(const SampleValue *s) const
Definition: BmpRGBSampleValue.cc:37
RGBTriple Color
Definition: BmpRGBSampleValue.h:46
std::string getName(void) const
Definition: BmpRGBSampleValue.cc:122
BYTE plus(BYTE a, BYTE b) const
Definition: BmpRGBSampleValue.cc:138
void addNTSVCandidates(std::vector< RGBTriple > &cands, const BYTE cube[3][2], COLOR fc, DIRECTION fd, COLOR i1, COLOR i2, EmbValue t) const
Definition: BmpRGBSampleValue.cc:96
BYTE getRed(void) const
Definition: BmpRGBSampleValue.h:41
SampleValue * getNearestTargetSampleValue(EmbValue t) const
Definition: BmpRGBSampleValue.cc:50
BYTE getGreen(void) const
Definition: BmpRGBSampleValue.h:42
DIRECTION
Definition: BmpRGBSampleValue.h:56
@ DOWN
Definition: BmpRGBSampleValue.h:56
@ UP
Definition: BmpRGBSampleValue.h:56
EmbValue calcEValue(const RGBTriple &rgb) const
Definition: BmpRGBSampleValue.h:51
BYTE minus(BYTE a, BYTE b) const
Definition: BmpRGBSampleValue.cc:129
UWORD32 calcKey(const RGBTriple &rgb) const
Definition: BmpRGBSampleValue.h:48
an (abstract) sample value in a bmp file
Definition: BmpSampleValue.h:31
Definition: RGBTriple.h:26
BYTE Green
Definition: RGBTriple.h:51
BYTE Blue
Definition: RGBTriple.h:52
BYTE Red
Definition: RGBTriple.h:50
the value of a sample in a CvrStgFile
Definition: SampleValue.h:61
unsigned char BYTE
Definition: common.h:47
unsigned long UWORD32
Definition: common.h:45
BYTE EmbValue
Definition: common.h:66