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
BmpSampleValue.h
RGBTriple.h
BmpRGBSampleValue::COLOR
COLOR
Definition BmpRGBSampleValue.h:55
BmpRGBSampleValue::GREEN
@ GREEN
Definition BmpRGBSampleValue.h:55
BmpRGBSampleValue::RED
@ RED
Definition BmpRGBSampleValue.h:55
BmpRGBSampleValue::BLUE
@ BLUE
Definition BmpRGBSampleValue.h:55
BmpRGBSampleValue::BmpRGBSampleValue
BmpRGBSampleValue(BYTE r, BYTE g, BYTE b)
Definition BmpRGBSampleValue.cc:23
BmpRGBSampleValue::getBlue
BYTE getBlue(void) const
Definition BmpRGBSampleValue.h:43
BmpRGBSampleValue::calcDistance
UWORD32 calcDistance(const SampleValue *s) const
Definition BmpRGBSampleValue.cc:37
BmpRGBSampleValue::Color
RGBTriple Color
Definition BmpRGBSampleValue.h:46
BmpRGBSampleValue::getName
std::string getName(void) const
Definition BmpRGBSampleValue.cc:122
BmpRGBSampleValue::plus
BYTE plus(BYTE a, BYTE b) const
Definition BmpRGBSampleValue.cc:138
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::getRed
BYTE getRed(void) const
Definition BmpRGBSampleValue.h:41
BmpRGBSampleValue::getNearestTargetSampleValue
SampleValue * getNearestTargetSampleValue(EmbValue t) const
Definition BmpRGBSampleValue.cc:50
BmpRGBSampleValue::getGreen
BYTE getGreen(void) const
Definition BmpRGBSampleValue.h:42
BmpRGBSampleValue::DIRECTION
DIRECTION
Definition BmpRGBSampleValue.h:56
BmpRGBSampleValue::DOWN
@ DOWN
Definition BmpRGBSampleValue.h:56
BmpRGBSampleValue::UP
@ UP
Definition BmpRGBSampleValue.h:56
BmpRGBSampleValue::calcEValue
EmbValue calcEValue(const RGBTriple &rgb) const
Definition BmpRGBSampleValue.h:51
BmpRGBSampleValue::minus
BYTE minus(BYTE a, BYTE b) const
Definition BmpRGBSampleValue.cc:129
BmpRGBSampleValue::calcKey
UWORD32 calcKey(const RGBTriple &rgb) const
Definition BmpRGBSampleValue.h:48
BmpSampleValue::BmpSampleValue
BmpSampleValue(void)
Definition BmpSampleValue.h:33
RGBTriple
Definition RGBTriple.h:26
RGBTriple::Green
BYTE Green
Definition RGBTriple.h:51
RGBTriple::Blue
BYTE Blue
Definition RGBTriple.h:52
RGBTriple::Red
BYTE Red
Definition RGBTriple.h:50
SampleValue::SampleValue
SampleValue(void)
Definition SampleValue.cc:25
common.h
BYTE
unsigned char BYTE
Definition common.h:47
UWORD32
unsigned long UWORD32
Definition common.h:45
EmbValue
BYTE EmbValue
Definition common.h:66