krita
KisDataManager Class Reference
#include <kis_datamanager.h>
Detailed Description
KisDataManager defines the interface that modules responsible for storing and retrieving data must inmplement.Data modules, like the tile manager, are responsible for:
* Storing undo/redo data * Offering ordererd and unordered iterators over rects of pixels * (eventually) efficiently loading and saving data in a format that may allow deferred loading.
A datamanager knows nothing about the type of pixel data except how many Q_UINT8's a single pixel takes.
Definition at line 45 of file kis_datamanager.h.
Public Member Functions | |
KisDataManager (Q_UINT32 pixelSize, const Q_UINT8 *defPixel) | |
KisDataManager (const KisDataManager &dm) | |
void | setDefaultPixel (const Q_UINT8 *defPixel) |
const Q_UINT8 * | defaultPixel () const |
KisMementoSP | getMemento () |
void | rollback (KisMementoSP memento) |
void | rollforward (KisMementoSP memento) |
bool | write (KoStore *store) |
bool | read (KoStore *store) |
Q_UINT32 | pixelSize () |
void | extent (Q_INT32 &x, Q_INT32 &y, Q_INT32 &w, Q_INT32 &h) const |
QRect | extent () const |
void | setExtent (Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h) |
void | setExtent (const QRect &rect) |
void | clear (Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, Q_UINT8 def) |
void | clear (Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, const Q_UINT8 *def) |
void | clear () |
void | paste (KisDataManagerSP data, Q_INT32 sx, Q_INT32 sy, Q_INT32 dx, Q_INT32 dy, Q_INT32 w, Q_INT32 h) |
KDE_DEPRECATED const Q_UINT8 * | pixel (Q_INT32 x, Q_INT32 y) |
KDE_DEPRECATED Q_UINT8 * | writablePixel (Q_INT32 x, Q_INT32 y) |
void | setPixel (Q_INT32 x, Q_INT32 y, const Q_UINT8 *data) |
void | readBytes (Q_UINT8 *data, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h) |
void | writeBytes (const Q_UINT8 *data, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h) |
Q_INT32 | numContiguousColumns (Q_INT32 x, Q_INT32 minY, Q_INT32 maxY) |
Q_INT32 | numContiguousRows (Q_INT32 y, Q_INT32 minX, Q_INT32 maxX) |
Q_INT32 | rowStride (Q_INT32 x, Q_INT32 y) |
Friends | |
class | KisRectIterator |
class | KisHLineIterator |
class | KisVLineIterator |
Member Function Documentation
void KisDataManager::setDefaultPixel | ( | const Q_UINT8 * | defPixel | ) | [inline] |
Sets the default pixel.
Note that this might change every occurrance, and it might not, but new data well be initialised with this pixel
Definition at line 56 of file kis_datamanager.h.
const Q_UINT8* KisDataManager::defaultPixel | ( | ) | const [inline] |
KisMementoSP KisDataManager::getMemento | ( | ) | [inline] |
Reguests a memento from the data manager.
There is only one memento active at any given moment for a given paint device and all and any write actions on the datamanger builds undo data into this memento necessary to rollback the transaction.
Definition at line 69 of file kis_datamanager.h.
void KisDataManager::rollback | ( | KisMementoSP | memento | ) | [inline] |
Restores the image data to the state at the time of the getMemento() call.
Note that rollback should be performed with mementos in the reverse order of their creation, as mementos only store incremental changes
Definition at line 77 of file kis_datamanager.h.
void KisDataManager::rollforward | ( | KisMementoSP | memento | ) | [inline] |
Restores the image data to the state at the time of the rollback call of the memento.
Note that rollforward must only be called when an rollback have previously been performed, and no intermittent actions have been performed (though it's ok to rollback other mementos and roll them forward again)
Definition at line 86 of file kis_datamanager.h.
bool KisDataManager::write | ( | KoStore * | store | ) | [inline] |
Reads and writes the tiles from/onto a KoStore (wich is simply a file within a zip file).
Definition at line 93 of file kis_datamanager.h.
Q_UINT32 KisDataManager::pixelSize | ( | ) | [inline] |
void KisDataManager::extent | ( | Q_INT32 & | x, | |
Q_INT32 & | y, | |||
Q_INT32 & | w, | |||
Q_INT32 & | h | |||
) | const [inline] |
void KisDataManager::setExtent | ( | Q_INT32 | x, | |
Q_INT32 | y, | |||
Q_INT32 | w, | |||
Q_INT32 | h | |||
) | [inline] |
void KisDataManager::clear | ( | Q_INT32 | x, | |
Q_INT32 | y, | |||
Q_INT32 | w, | |||
Q_INT32 | h, | |||
Q_UINT8 | def | |||
) | [inline] |
void KisDataManager::clear | ( | Q_INT32 | x, | |
Q_INT32 | y, | |||
Q_INT32 | w, | |||
Q_INT32 | h, | |||
const Q_UINT8 * | def | |||
) | [inline] |
Clear the specified rect to the specified pixel value.
Definition at line 134 of file kis_datamanager.h.
void KisDataManager::clear | ( | ) | [inline] |
void KisDataManager::paste | ( | KisDataManagerSP | data, | |
Q_INT32 | sx, | |||
Q_INT32 | sy, | |||
Q_INT32 | dx, | |||
Q_INT32 | dy, | |||
Q_INT32 | w, | |||
Q_INT32 | h | |||
) | [inline] |
Copy the specified rect from the specified data into this data.
Definition at line 150 of file kis_datamanager.h.
KDE_DEPRECATED const Q_UINT8* KisDataManager::pixel | ( | Q_INT32 | x, | |
Q_INT32 | y | |||
) | [inline] |
KDE_DEPRECATED Q_UINT8* KisDataManager::writablePixel | ( | Q_INT32 | x, | |
Q_INT32 | y | |||
) | [inline] |
void KisDataManager::setPixel | ( | Q_INT32 | x, | |
Q_INT32 | y, | |||
const Q_UINT8 * | data | |||
) | [inline] |
Write the specified data to x, y.
There is no checking on pixelSize!
Definition at line 169 of file kis_datamanager.h.
void KisDataManager::readBytes | ( | Q_UINT8 * | data, | |
Q_INT32 | x, | |||
Q_INT32 | y, | |||
Q_INT32 | w, | |||
Q_INT32 | h | |||
) | [inline] |
Copy the bytes in the specified rect to a chunk of memory.
The pixelSize in bytes is w * h * pixelSize. XXX: Better use QValueVector?
Definition at line 178 of file kis_datamanager.h.
void KisDataManager::writeBytes | ( | const Q_UINT8 * | data, | |
Q_INT32 | x, | |||
Q_INT32 | y, | |||
Q_INT32 | w, | |||
Q_INT32 | h | |||
) | [inline] |
Copy the bytes to the specified rect.
w * h * pixelSize bytes will be read, whether the caller prepared them or not. XXX: Better use QValueVector?
Definition at line 187 of file kis_datamanager.h.
The documentation for this class was generated from the following file: