krita

kis_background.h

00001 /*
00002  *  Copyright (c) 2002 Patrick Julien <freak@codepimps.org>
00003  *
00004  *  this program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the gnu general public license as published by
00006  *  the free software foundation; either version 2 of the license, or
00007  *  (at your option) any later version.
00008  *
00009  *  this program is distributed in the hope that it will be useful,
00010  *  but without any warranty; without even the implied warranty of
00011  *  merchantability or fitness for a particular purpose.  see the
00012  *  gnu general public license for more details.
00013  *
00014  *  you should have received a copy of the gnu general public license
00015  *  along with this program; if not, write to the free software
00016  *  foundation, inc., 675 mass ave, cambridge, ma 02139, usa.
00017  */
00018 #ifndef KIS_BACKGROUND_H_
00019 #define KIS_BACKGROUND_H_
00020 
00021 #include <qimage.h>
00022 
00023 #include <ksharedptr.h>
00024 
00025 class KisBackground : public KShared {
00026 
00027 public:
00028     KisBackground();
00029     virtual ~KisBackground();
00030 
00031     // Paint the background pattern into the image, 'behind' the image
00032     // contents. The coordinates are for the image's top-left corner
00033     // in image space.
00034     void paintBackground(QImage image, int leftX, int topY);
00035 
00036     void paintBackground(QImage image, const QRect& scaledImageRect, const QSize& scaledImageSize, const QSize& imageSize);
00037 
00038     // Returns the pattern tile.
00039     const QImage& patternTile() const;
00040 
00041 protected:
00042     static const int PATTERN_WIDTH = 32;
00043     static const int PATTERN_HEIGHT = 32;
00044 
00045     QImage m_patternTile;
00046 };
00047 
00048 #endif // KIS_BACKGROUND_H_
00049 
KDE Home | KDE Accessibility Home | Description of Access Keys