chalk

KisDataManager Class Reference

#include <kis_datamanager.h>

Public Member Functions

 KisDataManager (TQ_UINT32 pixelSize, const TQ_UINT8 *defPixel)
 KisDataManager (const KisDataManager &dm)
void setDefaultPixel (const TQ_UINT8 *defPixel)
const TQ_UINT8 * defaultPixel () const
KisMementoSP getMemento ()
void rollback (KisMementoSP memento)
void rollforward (KisMementoSP memento)
bool write (KoStore *store)
bool read (KoStore *store)
TQ_UINT32 pixelSize ()
void extent (TQ_INT32 &x, TQ_INT32 &y, TQ_INT32 &w, TQ_INT32 &h) const
TQRect extent () const
void setExtent (TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h)
void setExtent (const TQRect &rect)
void clear (TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h, TQ_UINT8 def)
void clear (TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h, const TQ_UINT8 *def)
void clear ()
void paste (KisDataManagerSP data, TQ_INT32 sx, TQ_INT32 sy, TQ_INT32 dx, TQ_INT32 dy, TQ_INT32 w, TQ_INT32 h)
TDE_DEPRECATED const TQ_UINT8 * pixel (TQ_INT32 x, TQ_INT32 y)
TDE_DEPRECATED TQ_UINT8 * writablePixel (TQ_INT32 x, TQ_INT32 y)
void setPixel (TQ_INT32 x, TQ_INT32 y, const TQ_UINT8 *data)
void readBytes (TQ_UINT8 *data, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h)
void writeBytes (const TQ_UINT8 *data, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h)
TQ_INT32 numContiguousColumns (TQ_INT32 x, TQ_INT32 minY, TQ_INT32 maxY)
TQ_INT32 numContiguousRows (TQ_INT32 y, TQ_INT32 minX, TQ_INT32 maxX)
TQ_INT32 rowStride (TQ_INT32 x, TQ_INT32 y)

Friends

class KisRectIterator
class KisHLineIterator
class KisVLineIterator

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 TQ_UINT8's a single pixel takes.

Definition at line 45 of file kis_datamanager.h.

Constructor & Destructor Documentation

◆ KisDataManager() [1/2]

KisDataManager::KisDataManager ( TQ_UINT32 pixelSize,
const TQ_UINT8 * defPixel )
inline

Definition at line 48 of file kis_datamanager.h.

◆ KisDataManager() [2/2]

KisDataManager::KisDataManager ( const KisDataManager & dm)
inline

Definition at line 49 of file kis_datamanager.h.

Member Function Documentation

◆ clear() [1/3]

void KisDataManager::clear ( )
inline

Clear all back to default values.

Definition at line 141 of file kis_datamanager.h.

◆ clear() [2/3]

void KisDataManager::clear ( TQ_INT32 x,
TQ_INT32 y,
TQ_INT32 w,
TQ_INT32 h,
const TQ_UINT8 * def )
inline

Clear the specified rect to the specified pixel value.

Definition at line 134 of file kis_datamanager.h.

◆ clear() [3/3]

void KisDataManager::clear ( TQ_INT32 x,
TQ_INT32 y,
TQ_INT32 w,
TQ_INT32 h,
TQ_UINT8 def )
inline

Clear the specified rect to the specified value.

Definition at line 127 of file kis_datamanager.h.

◆ defaultPixel()

const TQ_UINT8 * KisDataManager::defaultPixel ( ) const
inline

Gets the default pixel.

Definition at line 61 of file kis_datamanager.h.

◆ extent() [1/2]

TQRect KisDataManager::extent ( ) const
inline

Definition at line 109 of file kis_datamanager.h.

◆ extent() [2/2]

void KisDataManager::extent ( TQ_INT32 & x,
TQ_INT32 & y,
TQ_INT32 & w,
TQ_INT32 & h ) const
inline

Return the extent of the data in x,y,w,h.

Definition at line 106 of file kis_datamanager.h.

◆ getMemento()

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.

◆ numContiguousColumns()

TQ_INT32 KisDataManager::numContiguousColumns ( TQ_INT32 x,
TQ_INT32 minY,
TQ_INT32 maxY )
inline

Definition at line 194 of file kis_datamanager.h.

◆ numContiguousRows()

TQ_INT32 KisDataManager::numContiguousRows ( TQ_INT32 y,
TQ_INT32 minX,
TQ_INT32 maxX )
inline

Definition at line 200 of file kis_datamanager.h.

◆ paste()

void KisDataManager::paste ( KisDataManagerSP data,
TQ_INT32 sx,
TQ_INT32 sy,
TQ_INT32 dx,
TQ_INT32 dy,
TQ_INT32 w,
TQ_INT32 h )
inline

Copy the specified rect from the specified data into this data.

Definition at line 150 of file kis_datamanager.h.

◆ pixel()

TDE_DEPRECATED const TQ_UINT8 * KisDataManager::pixel ( TQ_INT32 x,
TQ_INT32 y )
inline

Get a read-only pointer to the specified pixel.

Definition at line 157 of file kis_datamanager.h.

◆ pixelSize()

TQ_UINT32 KisDataManager::pixelSize ( )
inline

Returns the number of bytes a pixel takes.

Definition at line 101 of file kis_datamanager.h.

◆ read()

bool KisDataManager::read ( KoStore * store)
inline

Definition at line 94 of file kis_datamanager.h.

◆ readBytes()

void KisDataManager::readBytes ( TQ_UINT8 * data,
TQ_INT32 x,
TQ_INT32 y,
TQ_INT32 w,
TQ_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 TQValueVector?

Definition at line 178 of file kis_datamanager.h.

◆ rollback()

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.

◆ rollforward()

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.

◆ rowStride()

TQ_INT32 KisDataManager::rowStride ( TQ_INT32 x,
TQ_INT32 y )
inline

Definition at line 206 of file kis_datamanager.h.

◆ setDefaultPixel()

void KisDataManager::setDefaultPixel ( const TQ_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.

◆ setExtent() [1/2]

void KisDataManager::setExtent ( const TQRect & rect)
inline

Definition at line 120 of file kis_datamanager.h.

◆ setExtent() [2/2]

void KisDataManager::setExtent ( TQ_INT32 x,
TQ_INT32 y,
TQ_INT32 w,
TQ_INT32 h )
inline

Crop or extend the data to x, y, w, h.

Definition at line 117 of file kis_datamanager.h.

◆ setPixel()

void KisDataManager::setPixel ( TQ_INT32 x,
TQ_INT32 y,
const TQ_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.

◆ writablePixel()

TDE_DEPRECATED TQ_UINT8 * KisDataManager::writablePixel ( TQ_INT32 x,
TQ_INT32 y )
inline

Get a read-write pointer to the specified pixel.

Definition at line 163 of file kis_datamanager.h.

◆ write()

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.

◆ writeBytes()

void KisDataManager::writeBytes ( const TQ_UINT8 * data,
TQ_INT32 x,
TQ_INT32 y,
TQ_INT32 w,
TQ_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 TQValueVector?

Definition at line 187 of file kis_datamanager.h.

◆ KisHLineIterator

friend class KisHLineIterator
friend

Definition at line 211 of file kis_datamanager.h.

◆ KisRectIterator

friend class KisRectIterator
friend

Definition at line 210 of file kis_datamanager.h.

◆ KisVLineIterator

friend class KisVLineIterator
friend

Definition at line 212 of file kis_datamanager.h.


The documentation for this class was generated from the following file: