Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++
869 B
Raw Blame
/* This file is part of the KDE project
 * SPDX-FileCopyrightText: 2008 Jan Hambrecht <[email protected]>
 *
 * SPDX-License-Identifier: LGPL-2.0-or-later
 */

#ifndef KOCHECKERBOARDPAINTER_H
#define KOCHECKERBOARDPAINTER_H

#include <QPixmap>
#include <QColor>
#include "kritawidgetutils_export.h"

class QPainter;

class KRITAWIDGETUTILS_EXPORT KoCheckerBoardPainter
{
public:
    explicit KoCheckerBoardPainter(int checkerSize);
    void setCheckerColors(const QColor &lightColor, const QColor &darkColor);
    void setCheckerSize(int checkerSize);
    void paint(QPainter &painter, const QRectF &rect, const QPointF &patternOrigin) const;
    void paint(QPainter &painter, const QRectF &rect) const;

private:
    void createChecker();
    int m_checkerSize;
    QPixmap m_checker;
    QColor m_lightColor;
    QColor m_darkColor;
};

#endif // KOCHECKERBOARDPAINTER_H