SilentEye 0.4.1
|
#include <imagebmp.h>
Public Types | |
enum | HeaderPosition { TOP = 1, BOTTOM = 2, SIGNATURE = 3 } |
enum | DataDistribution { INLINE = 1, EQUI = 2 } |
Public Member Functions | |
ImageBMP () | |
~ImageBMP () | |
ImageBMP (const QString &filePath) | |
ImageBMP (const QPixmap &pixmap, QString filePath="Pixmap") | |
ImageBMP (const Image &image) | |
ImageBMP (Image *image) | |
unsigned short int | nbBits () const |
bool | setNbBits (const unsigned short int nb) |
void | setColorUsed (bool r=true, bool g=true, bool b=true) |
void | setDistribution (DataDistribution) |
void | setHeaderPosition (HeaderPosition) |
quint32 | capacity () const |
bool | loadData () |
bool | saveToDir (QString &outputDirPath) |
Private Member Functions | |
bool | hideData () |
int | changeColor (int color, const int val) |
int | computeDistributionStep (quint32 size) |
QPoint * | computeHeaderPosition () |
bool | isBetweenPoint (const QPoint &, const QPoint &, const QPoint &) |
QPoint | computeNewPosition (const QPoint &, int, bool=false) |
Private Attributes | |
QPointer< Logger > | m_logger |
QImage | m_img |
unsigned short int | m_nbBits |
bool | m_useRed |
bool | m_useGreen |
bool | m_useBlue |
int | m_nbColorUsed |
HeaderPosition | m_headerPosition |
DataDistribution | m_distribution |
unsigned short int | m_swap |
int | m_blockWidth |
int | m_blockHeight |
int | m_blockInnerPos |
Definition at line 29 of file imagebmp.h.
Definition at line 33 of file imagebmp.h.
Definition at line 32 of file imagebmp.h.
SEFormatBMP::ImageBMP::ImageBMP | ( | ) |
SEFormatBMP::ImageBMP::~ImageBMP | ( | ) |
Definition at line 85 of file imagebmp.cpp.
References m_logger.
SEFormatBMP::ImageBMP::ImageBMP | ( | const QString & | filePath | ) |
Definition at line 34 of file imagebmp.cpp.
References SEFormatBMP::m_distribution, SEFormatBMP::m_headerPosition, SEFormatBMP::m_logger, SEFormatBMP::setColorUsed(), and SEFormatBMP::setObjectName().
SEFormatBMP::ImageBMP::ImageBMP | ( | const QPixmap & | pixmap, |
QString | filePath = "Pixmap" |
||
) |
Definition at line 47 of file imagebmp.cpp.
References SEFormatBMP::m_distribution, SEFormatBMP::m_headerPosition, SEFormatBMP::m_logger, SEFormatBMP::setColorUsed(), and SEFormatBMP::setObjectName().
SEFormatBMP::ImageBMP::ImageBMP | ( | const Image & | image | ) |
Definition at line 60 of file imagebmp.cpp.
References SEFormatBMP::m_distribution, SEFormatBMP::m_headerPosition, SEFormatBMP::m_logger, SEFormatBMP::setColorUsed(), and SEFormatBMP::setObjectName().
SEFormatBMP::ImageBMP::ImageBMP | ( | Image * | image | ) |
Definition at line 73 of file imagebmp.cpp.
References SEFormatBMP::m_distribution, SEFormatBMP::m_headerPosition, SEFormatBMP::m_logger, SEFormatBMP::setColorUsed(), and SEFormatBMP::setObjectName().
quint32 SEFormatBMP::ImageBMP::capacity | ( | ) | const [virtual] |
Reimplemented from SilentEyeFramework::Media.
Definition at line 132 of file imagebmp.cpp.
References SilentEyeFramework::Image::imgHeight(), SilentEyeFramework::Image::imgWidth(), m_nbBits, and m_nbColorUsed.
Referenced by hideData(), and loadData().
int SEFormatBMP::ImageBMP::changeColor | ( | int | color, |
const int | val | ||
) | [private] |
int SEFormatBMP::ImageBMP::computeDistributionStep | ( | quint32 | size | ) | [private] |
Definition at line 426 of file imagebmp.cpp.
References EQUI, EQUI_NB_STEP_MIN, SilentEyeFramework::Image::imgHeight(), SilentEyeFramework::Image::imgWidth(), m_blockHeight, m_blockInnerPos, m_blockWidth, m_distribution, m_logger, m_nbBits, and m_nbColorUsed.
Referenced by hideData(), and loadData().
QPoint * SEFormatBMP::ImageBMP::computeHeaderPosition | ( | ) | [private] |
Definition at line 488 of file imagebmp.cpp.
References BOTTOM, SilentEyeFramework::Image::imgHeight(), SilentEyeFramework::Image::imgWidth(), m_headerPosition, m_logger, m_nbBits, m_nbColorUsed, and SIGNATURE.
Referenced by hideData(), and loadData().
QPoint SEFormatBMP::ImageBMP::computeNewPosition | ( | const QPoint & | oldPos, |
int | step, | ||
bool | first = false |
||
) | [private] |
Definition at line 539 of file imagebmp.cpp.
References EQUI_NB_STEP_MIN, SilentEyeFramework::Image::imgWidth(), m_blockHeight, m_blockInnerPos, and m_blockWidth.
Referenced by hideData(), and loadData().
bool SEFormatBMP::ImageBMP::hideData | ( | ) | [private] |
Definition at line 261 of file imagebmp.cpp.
References capacity(), changeColor(), computeDistributionStep(), computeHeaderPosition(), computeNewPosition(), isBetweenPoint(), SilentEyeFramework::Media::m_data, m_headerPosition, m_img, m_logger, m_nbBits, m_nbColorUsed, m_swap, m_useBlue, m_useGreen, m_useRed, and TOP.
Referenced by saveToDir().
bool SEFormatBMP::ImageBMP::isBetweenPoint | ( | const QPoint & | ref, |
const QPoint & | start, | ||
const QPoint & | end | ||
) | [private] |
Definition at line 525 of file imagebmp.cpp.
Referenced by hideData(), and loadData().
bool SEFormatBMP::ImageBMP::loadData | ( | ) | [virtual] |
Reimplemented from SilentEyeFramework::Media.
Definition at line 139 of file imagebmp.cpp.
References SilentEyeFramework::EncodedData::append(), capacity(), computeDistributionStep(), computeHeaderPosition(), computeNewPosition(), SilentEyeFramework::EncodedData::initialize(), isBetweenPoint(), SilentEyeFramework::Media::m_data, m_headerPosition, m_img, SilentEyeFramework::Media::m_isLoaded, m_logger, m_nbBits, m_useBlue, m_useGreen, m_useRed, nbBits(), TOP, and SilentEyeFramework::EncodedData::toUInt32().
unsigned short int SEFormatBMP::ImageBMP::nbBits | ( | ) | const |
Definition at line 90 of file imagebmp.cpp.
Referenced by loadData().
bool SEFormatBMP::ImageBMP::saveToDir | ( | QString & | outputDirPath | ) | [virtual] |
Reimplemented from SilentEyeFramework::Media.
Definition at line 400 of file imagebmp.cpp.
References hideData(), SilentEyeFramework::Media::m_filePath, m_img, m_logger, and SilentEyeFramework::Media::m_shortName.
void SEFormatBMP::ImageBMP::setColorUsed | ( | bool | r = true , |
bool | g = true , |
||
bool | b = true |
||
) |
Definition at line 94 of file imagebmp.cpp.
References m_nbColorUsed, m_useBlue, m_useGreen, and m_useRed.
Referenced by SEFormatBMP::SEFormatBmp::updateImage().
void SEFormatBMP::ImageBMP::setDistribution | ( | DataDistribution | value | ) |
Definition at line 108 of file imagebmp.cpp.
References m_distribution.
Referenced by SEFormatBMP::SEFormatBmp::updateImage().
void SEFormatBMP::ImageBMP::setHeaderPosition | ( | HeaderPosition | value | ) |
Definition at line 113 of file imagebmp.cpp.
References m_headerPosition.
Referenced by SEFormatBMP::SEFormatBmp::updateImage().
bool SEFormatBMP::ImageBMP::setNbBits | ( | const unsigned short int | nb | ) |
Definition at line 118 of file imagebmp.cpp.
References SilentEyeFramework::Media::m_isLoaded, and m_nbBits.
Referenced by SEFormatBMP::SEFormatBmp::updateImage().
int SEFormatBMP::ImageBMP::m_blockHeight [private] |
Definition at line 48 of file imagebmp.h.
Referenced by computeDistributionStep(), and computeNewPosition().
int SEFormatBMP::ImageBMP::m_blockInnerPos [private] |
Definition at line 49 of file imagebmp.h.
Referenced by computeDistributionStep(), and computeNewPosition().
int SEFormatBMP::ImageBMP::m_blockWidth [private] |
Definition at line 47 of file imagebmp.h.
Referenced by computeDistributionStep(), and computeNewPosition().
Definition at line 45 of file imagebmp.h.
Referenced by computeDistributionStep(), and setDistribution().
Definition at line 44 of file imagebmp.h.
Referenced by computeHeaderPosition(), hideData(), loadData(), and setHeaderPosition().
QImage SEFormatBMP::ImageBMP::m_img [private] |
Definition at line 38 of file imagebmp.h.
Referenced by hideData(), loadData(), and saveToDir().
QPointer<Logger> SEFormatBMP::ImageBMP::m_logger [private] |
Definition at line 36 of file imagebmp.h.
Referenced by computeDistributionStep(), computeHeaderPosition(), hideData(), loadData(), saveToDir(), and ~ImageBMP().
unsigned short int SEFormatBMP::ImageBMP::m_nbBits [private] |
Definition at line 39 of file imagebmp.h.
Referenced by capacity(), computeDistributionStep(), computeHeaderPosition(), hideData(), loadData(), and setNbBits().
int SEFormatBMP::ImageBMP::m_nbColorUsed [private] |
Definition at line 43 of file imagebmp.h.
Referenced by capacity(), computeDistributionStep(), computeHeaderPosition(), hideData(), and setColorUsed().
unsigned short int SEFormatBMP::ImageBMP::m_swap [private] |
Definition at line 46 of file imagebmp.h.
Referenced by changeColor(), and hideData().
bool SEFormatBMP::ImageBMP::m_useBlue [private] |
Definition at line 42 of file imagebmp.h.
Referenced by hideData(), loadData(), and setColorUsed().
bool SEFormatBMP::ImageBMP::m_useGreen [private] |
Definition at line 41 of file imagebmp.h.
Referenced by hideData(), loadData(), and setColorUsed().
bool SEFormatBMP::ImageBMP::m_useRed [private] |
Definition at line 40 of file imagebmp.h.
Referenced by hideData(), loadData(), and setColorUsed().