File indexing completed on 2024-05-19 04:26:40

0001 /*
0002  *  SPDX-FileCopyrightText: 2013 Dmitry Kazakov <dimula73@gmail.com>
0003  *
0004  *  SPDX-License-Identifier: GPL-2.0-or-later
0005  */
0006 
0007 #ifndef __KIS_WRAPPED_RANDOM_ACCESSOR_H
0008 #define __KIS_WRAPPED_RANDOM_ACCESSOR_H
0009 
0010 #include "tiles3/kis_random_accessor.h"
0011 #include "KisWraparoundAxis.h"
0012 
0013 
0014 class KisWrappedRandomAccessor : public KisRandomAccessor2
0015 {
0016 public:
0017     KisWrappedRandomAccessor(KisTiledDataManager *ktm,
0018                              qint32 offsetX, qint32 offsetY,
0019                              bool writable,
0020                              KisIteratorCompleteListener *completeListener,
0021                              const QRect &wrapRect,
0022                              const WrapAroundAxis wrapAroundModeAxis);
0023 
0024     void moveTo(qint32 x, qint32 y) override;
0025     qint32 numContiguousColumns(qint32 x) const override;
0026     qint32 numContiguousRows(qint32 y) const override;
0027     qint32 rowStride(qint32 x, qint32 y) const override;
0028 
0029     qint32 x() const override;
0030     qint32 y() const override;
0031 
0032 private:
0033     QRect m_wrapRect;
0034     QPoint m_currentPos;
0035     WrapAroundAxis m_wrapAxis;
0036 };
0037 
0038 #endif /* __KIS_WRAPPED_RANDOM_ACCESSOR_H */