| 6 | * License as published by the Free Software Foundation; either |
| 7 | * version 2.1 of the License, or (at your option) any later version. |
| 8 | * |
| 9 | * This library 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 GNU |
| 12 | * Lesser General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU Lesser General Public |
| 15 | * License along with this library; if not, write to the Free Software |
| 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 17 | */ |
| 18 |
| 19 | #ifndef VPAINTER_H |
| 20 | #define VPAINTER_H |
| 21 |
| 22 | #include "vbrush.h" |
| 23 | #include "vpoint.h" |
| 24 | #include "vrle.h" |
| 25 |
| 26 | V_BEGIN_NAMESPACE |
| 27 |
| 28 | class VBitmap; |
| 29 | class VPainterImpl; |
| 30 | class VPainter { |
| 31 | public: |
| 32 | enum CompositionMode { |
| 33 | CompModeSrc, |
| 34 | CompModeSrcOver, |
| 35 | CompModeDestIn, |
| 36 | CompModeDestOut |
| 37 | }; |
| 38 | ~VPainter(); |
| 39 | VPainter(); |
| 40 | VPainter(VBitmap *buffer, bool clear); |
| 41 | bool begin(VBitmap *buffer, bool clear); |
| 42 | void end(); |
| 43 | void setDrawRegion(const VRect ®ion); // sub surface rendering area. |
| 44 | void setBrush(const VBrush &brush); |
| 45 | void setCompositionMode(CompositionMode mode); |
| 46 | void drawRle(const VPoint &pos, const VRle &rle); |
| 47 | void drawRle(const VRle &rle, const VRle &clip); |
| 48 | VRect clipBoundingRect() const; |
| 49 |
| 50 | void drawBitmap(const VPoint &point, const VBitmap &bitmap, const VRect &source, uint8_t const_alpha = 255); |
| 51 | void drawBitmap(const VRect &target, const VBitmap &bitmap, const VRect &source, uint8_t const_alpha = 255); |
| 52 | void drawBitmap(const VPoint &point, const VBitmap &bitmap, uint8_t const_alpha = 255); |
| 53 | void drawBitmap(const VRect &rect, const VBitmap &bitmap, uint8_t const_alpha = 255); |
| 54 | private: |
| 55 | VPainterImpl *mImpl; |
| 56 | }; |
| 57 |
| 58 | V_END_NAMESPACE |
| 59 |
| 60 | #endif // VPAINTER_H |
| 61 |