The ModelPC class Model Layer of the app. Main class that does the work of PictureCrypt logic Controled by ControllerPC.
More...
#include <modelpc.h>
|
QImage * | encrypt (QByteArray data, QImage *image, int _mode, QString key="", int _bitsUsed=8, QString *_error=nullptr) |
| ModelPC::encrypt Slot to zip and inject data and provide it with some extra stuff After completion start standard ModelPC::inject Isn't used in PictureCrypt, but used can be used in other - custom projects. More...
|
|
QByteArray | decrypt (QImage *image, QString key, int _mode=Unspecified, QString *_error=nullptr) |
| ModelPC::decrypt Slot to be called when decrypt mode in ViewPC is selected and started. More...
|
|
void | fail (QString message) |
| ModelPC::fail Slot to stop execution of cryption. More...
|
|
void | alert (QString message, bool isWarning=false) |
| ModelPC::alert Function emits signal ModelPC::alertView and calls ViewPC::alert. More...
|
|
|
static QImage * | Encrypt (QByteArray data, QImage *image, CryptMode _mode, QString key="", int _bitsUsed=8, QString *_error=nullptr) |
|
static QByteArray | Decrypt (QImage *image, QString key, CryptMode _mode=Unspecified, QString *_error=nullptr) |
|
|
QImage * | inject (QByteArray encr_data, QImage *image, int _mode, int _bitsUsed=8, QString *_error=nullptr) |
| ModelPC::inject Slot to be called when encrypt mode in ViewPC is selected and started. More...
|
|
|
void | circuit (QImage *image, QByteArray *data, long long int countBytes) |
| ModelPC::circuit The brain of the app. Via special circuit stores data in image. More...
|
|
void | jphs (QImage *image, QByteArray *data) |
| ModelPC::jphs JPHS function to use jphide and jpseek (currently under development) More...
|
|
void | processPixel (QPoint pos, QVector< QPoint > *were, bool isEncrypt) |
| ModelPC::processPixel Processes every pixel. Reads its contains or writes data. More...
|
|
void | encryptv1_4 (QImage *image, QByteArray data, QString key) |
| ModelPC::encryptv1_4 Encrypts and injects data to image used in v1.4+. More...
|
|
QByteArray | decryptv1_3 (QImage *image, QString key) |
| ModelPC::decryptv1_3 Decrytps data from image in v1.3. More...
|
|
QByteArray | decryptv1_4 (QImage *image, QString key) |
| ModelPC::decryptv1_4 Decrypts data from image in v1.4+. More...
|
|
void | proccessPixelsv1_4 (QImage *image, QByteArray *data, QByteArray key, bool isEncrypt, QVector< QPair< QPoint, QPair< int, int > > > *were, long long size=-1) |
| ModelPC::proccessPixelsv1_4 Hides (or retrieves) data to/from pixels. More...
|
|
QByteArray | zip (QByteArray data, QByteArray key) |
| ModelPC::zip Zip function, copy of EncryptDialog::zip Used for ModelPC in custom projects, other than PictureCrypt. More...
|
|
|
static QImage * | Inject (QByteArray encr_data, QImage *image, CryptMode _mode, int _bitsUsed=8, QString *_error=nullptr) |
|
The ModelPC class Model Layer of the app. Main class that does the work of PictureCrypt logic Controled by ControllerPC.
- See also
- ViewPC, ControllerPC
- Author
- Alex Kovrigin (waleko)
Definition at line 33 of file modelpc.h.
Enumerator |
---|
Unspecified |
|
v1_3 |
|
v1_4 |
|
jphs_mode |
|
Definition at line 38 of file modelpc.h.
void ModelPC::alert |
( |
QString |
message, |
|
|
bool |
isWarning = false |
|
) |
| |
|
slot |
void ModelPC::alertView |
( |
QString |
messageCode, |
|
|
bool |
isWarning |
|
) |
| |
|
signal |
alertView Signal to be called to create MessageBox.
- Parameters
-
messageCode | Message Code to be shown. |
isWarning | Flag if message is critical. |
- See also
- ModelPC::alert, ViewPC::alert
void ModelPC::circuit |
( |
QImage * |
image, |
|
|
QByteArray * |
data, |
|
|
long long int |
countBytes |
|
) |
| |
|
protected |
ModelPC::circuit The brain of the app. Via special circuit stores data in image.
The circuit itself can be found in documentation or in commentaries in source.
- Parameters
-
image | Image to be processed. |
data | Data to be processed. |
countBytes | Number of bytes to be read or written. |
- See also
- ModelPC::processPixel
Definition at line 359 of file modelpc.cpp.
QByteArray ModelPC::Decrypt |
( |
QImage * |
image, |
|
|
QString |
key, |
|
|
CryptMode |
_mode = Unspecified , |
|
|
QString * |
_error = nullptr |
|
) |
| |
|
static |
QByteArray ModelPC::decrypt |
( |
QImage * |
image, |
|
|
QString |
key, |
|
|
int |
_mode = Unspecified , |
|
|
QString * |
_error = nullptr |
|
) |
| |
|
slot |
QByteArray ModelPC::decryptv1_3 |
( |
QImage * |
image, |
|
|
QString |
key |
|
) |
| |
|
protected |
QByteArray ModelPC::decryptv1_4 |
( |
QImage * |
image, |
|
|
QString |
key |
|
) |
| |
|
protected |
QImage * ModelPC::Encrypt |
( |
QByteArray |
data, |
|
|
QImage * |
image, |
|
|
CryptMode |
_mode, |
|
|
QString |
key = "" , |
|
|
int |
_bitsUsed = 8 , |
|
|
QString * |
_error = nullptr |
|
) |
| |
|
static |
QImage * ModelPC::encrypt |
( |
QByteArray |
data, |
|
|
QImage * |
image, |
|
|
int |
_mode, |
|
|
QString |
key = "" , |
|
|
int |
_bitsUsed = 8 , |
|
|
QString * |
_error = nullptr |
|
) |
| |
|
slot |
ModelPC::encrypt Slot to zip and inject data and provide it with some extra stuff After completion start standard ModelPC::inject Isn't used in PictureCrypt, but used can be used in other - custom projects.
- Parameters
-
data | Data for embedding |
image | Image for embedding |
_mode | Mode for embedding |
key | Key for extra encryption |
_bitsUsed | Bits per byte (see ModelPC::bitsUsed) |
_error | Error output |
- Returns
- Returns image with embedded data
- See also
- ModelPC::inject
Definition at line 51 of file modelpc.cpp.
void ModelPC::encryptv1_4 |
( |
QImage * |
image, |
|
|
QByteArray |
data, |
|
|
QString |
key |
|
) |
| |
|
protected |
ModelPC::encryptv1_4 Encrypts and injects data to image used in v1.4+.
- Parameters
-
image | Image for injecting |
data | Data for embedding |
key | Key of encryption |
Definition at line 561 of file modelpc.cpp.
void ModelPC::fail |
( |
QString |
message | ) |
|
|
slot |
QImage * ModelPC::Inject |
( |
QByteArray |
encr_data, |
|
|
QImage * |
image, |
|
|
CryptMode |
_mode, |
|
|
int |
_bitsUsed = 8 , |
|
|
QString * |
_error = nullptr |
|
) |
| |
|
staticprotected |
QImage * ModelPC::inject |
( |
QByteArray |
encr_data, |
|
|
QImage * |
image, |
|
|
int |
_mode, |
|
|
int |
_bitsUsed = 8 , |
|
|
QString * |
_error = nullptr |
|
) |
| |
|
protectedslot |
void ModelPC::jphs |
( |
QImage * |
image, |
|
|
QByteArray * |
data |
|
) |
| |
|
protected |
ModelPC::jphs JPHS function to use jphide and jpseek (currently under development)
- Parameters
-
image | Image for embedding |
data | Data |
Definition at line 298 of file modelpc.cpp.
void ModelPC::proccessPixelsv1_4 |
( |
QImage * |
image, |
|
|
QByteArray * |
data, |
|
|
QByteArray |
key, |
|
|
bool |
isEncrypt, |
|
|
QVector< QPair< QPoint, QPair< int, int > > > * |
were, |
|
|
long long |
size = -1 |
|
) |
| |
|
protected |
ModelPC::proccessPixelsv1_4 Hides (or retrieves) data to/from pixels.
- Parameters
-
image | Original image |
data | Data to write (Pointer to empty QByteArray if decrypting) |
key | Key |
isEncrypt | Mode of Cryption (true -> encryption, false -> decryption) |
were | Were vector for visited pixels |
size | Size of reading data, unneeded if writing |
Definition at line 664 of file modelpc.cpp.
void ModelPC::processPixel |
( |
QPoint |
pos, |
|
|
QVector< QPoint > * |
were, |
|
|
bool |
isEncrypt |
|
) |
| |
|
protected |
ModelPC::processPixel Processes every pixel. Reads its contains or writes data.
- Parameters
-
pos | Position of pixel |
were | Vector array containing pixels, that were already processed. |
isEncrypt | Mode of operation. If true encryption operations will continue, else the decryption ones. |
Definition at line 500 of file modelpc.cpp.
void ModelPC::saveData |
( |
QByteArray |
data | ) |
|
|
signal |
void ModelPC::saveImage |
( |
QImage * |
image | ) |
|
|
signal |
void ModelPC::setProgress |
( |
int |
val | ) |
|
|
signal |
setProgress Signal to be called to set progress of ProgressDialog.
- Parameters
-
- See also
- ViewPC::setProgress
QByteArray ModelPC::unzip |
( |
QByteArray |
data, |
|
|
QByteArray |
key |
|
) |
| |
QByteArray ModelPC::zip |
( |
QByteArray |
data, |
|
|
QByteArray |
key |
|
) |
| |
|
protected |
QString ModelPC::defaultJPHSDir |
defaultJPHSDir Default JPHS directory
Definition at line 92 of file modelpc.h.
error Current error
Definition at line 108 of file modelpc.h.
success Flag that true by default, but in case of error or cancelling of ProgressDialog it turns to false, which stops execution of ModelPC::circuit
Definition at line 80 of file modelpc.h.
version Version of the class
Definition at line 84 of file modelpc.h.
QString ModelPC::versionString |
versionString Version as string
Definition at line 88 of file modelpc.h.
The documentation for this class was generated from the following files: