Pencil2D Animation
Download
Community
News
Docs
Contribute
Overview
Articles
Code
Class List
Class Index
Class Hierarchy
Class Members
File List
Loading...
Searching...
No Matches
core_lib
src
graphics
bitmap
tile.h
1
/*
2
3
Pencil2D - Traditional Animation Software
4
Copyright (C) 2012-2020 Matthew Chiawen Chang
5
6
This program is free software; you can redistribute it and/or
7
modify it under the terms of the GNU General Public License
8
as published by the Free Software Foundation; version 2 of the License.
9
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
GNU General Public License for more details.
14
15
*/
16
17
#ifndef TILE_H
18
#define TILE_H
19
20
#include <QPoint>
21
#include <QPixmap>
22
23
class
Tile
24
{
25
public
:
26
27
explicit
Tile
(
const
QPoint
& pos,
QSize
size);
28
~Tile
();
29
30
const
QPixmap
& pixmap()
const
{
return
mTilePixmap; }
31
QPixmap
& pixmap() {
return
mTilePixmap; }
32
33
const
QPoint
& pos()
const
{
return
mPos; }
34
const
QPointF
& posF()
const
{
return
mPosF; }
35
const
QRect
& bounds()
const
{
return
mBounds; }
36
const
QSize
& size()
const
{
return
mSize; }
37
39
void
load
(
const
QImage
& image,
const
QPoint
& topLeft);
40
void
clear();
41
42
private
:
43
QPixmap
mTilePixmap;
44
QPointF
mPosF;
45
QPoint
mPos;
46
QRect
mBounds;
47
QSize
mSize;
48
};
49
50
#endif
// TILE_H
Tile
Definition:
tile.h:24
Tile::load
void load(const QImage &image, const QPoint &topLeft)
Loads the input image into the tile.
Definition:
tile.cpp:35
QImage
QPixmap
QPoint
QPointF
QRect
QSize