chalk

kis_background.h
1/*
2 * Copyright (c) 2002 Patrick Julien <freak@codepimps.org>
3 *
4 * this program is free software; you can redistribute it and/or modify
5 * it under the terms of the gnu general public license as published by
6 * the free software foundation; either version 2 of the license, or
7 * (at your option) any later version.
8 *
9 * this program is distributed in the hope that it will be useful,
10 * but without any warranty; without even the implied warranty of
11 * merchantability or fitness for a particular purpose. see the
12 * gnu general public license for more details.
13 *
14 * you should have received a copy of the gnu general public license
15 * along with this program; if not, write to the free software
16 * foundation, inc., 675 mass ave, cambridge, ma 02139, usa.
17 */
18#ifndef KIS_BACKGROUND_H_
19#define KIS_BACKGROUND_H_
20
21#include <tqimage.h>
22
23#include <ksharedptr.h>
24
25class KisBackground : public TDEShared {
26
27public:
28 KisBackground();
29 virtual ~KisBackground();
30
31 // Paint the background pattern into the image, 'behind' the image
32 // contents. The coordinates are for the image's top-left corner
33 // in image space.
34 void paintBackground(TQImage image, int leftX, int topY);
35
36 void paintBackground(TQImage image, const TQRect& scaledImageRect, const TQSize& scaledImageSize, const TQSize& imageSize);
37
38 // Returns the pattern tile.
39 const TQImage& patternTile() const;
40
41protected:
42 static const int PATTERN_WIDTH = 32;
43 static const int PATTERN_HEIGHT = 32;
44
45 TQImage m_patternTile;
46};
47
48#endif // KIS_BACKGROUND_H_
49