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