krita
kis_random_accessor.cpp00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "kis_random_accessor.h"
00021
00022 #include "kis_tiled_random_accessor.h"
00023
00024 KisRandomAccessor::KisRandomAccessor(KisTiledDataManager *ktm, Q_INT32 x, Q_INT32 y, Q_INT32 offsetx, Q_INT32 offsety, bool writable) : m_offsetx(offsetx), m_offsety(offsety)
00025 {
00026 m_accessor = new KisTiledRandomAccessor(ktm, x, y, writable);
00027 }
00028
00029 KisRandomAccessor::KisRandomAccessor(const KisRandomAccessor& rhs) {
00030 m_accessor = rhs.m_accessor;
00031 }
00032
00033 KisRandomAccessor::~KisRandomAccessor()
00034 {
00035
00036 }
00037
00038 void KisRandomAccessor::moveTo(Q_INT32 x, Q_INT32 y)
00039 {
00040 m_accessor->moveTo(x - m_offsetx, y - m_offsety);
00041 }
00042
00043 Q_UINT8* KisRandomAccessor::rawData() const
00044 {
00045 return m_accessor->rawData();
00046 }
00047
00048 const Q_UINT8* KisRandomAccessor::oldRawData() const
00049 {
00050 return m_accessor->oldRawData();
00051 }
00052
00053 KisRandomAccessorPixel::KisRandomAccessorPixel(KisTiledDataManager *ktm, KisTiledDataManager *ktmselect, Q_INT32 x, Q_INT32 y, Q_INT32 offsetx, Q_INT32 offsety, bool writable) :
00054 KisRandomAccessor( ktm, x, y, offsetx, offsety, writable),
00055 KisRandomAccessorPixelTrait( this, (ktmselect) ? new KisRandomAccessor(ktm, x, y, offsetx, offsety, false) : 0 )
00056 {
00057
00058 }
|