Kage Studio 0.7.230612
A Simple Free and Open Source 2D Animation Software
Loading...
Searching...
No Matches
vectordata.h
Go to the documentation of this file.
1/*
2 * Kage Studio - a simple free and open source vector-based 2D animation software
3 * Copyright (C) 2011~2022 Mj Mendoza IV
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
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 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18 * MA 02110-1301, USA. Or, see <https://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef GTKMM_KAGE_DATA_VECTOR_H
23 #define GTKMM_KAGE_DATA_VECTOR_H
24
25 #include <vector>
26 #include "color.h"
27 #include "point.h"
28 #include "strokecolor.h"
29
30 using namespace std;
31
32 class VectorData {
33 public:
34 enum type {
35 TYPE_INIT, //holds initial fill/stroke; no vectors to use
36 TYPE_FILL, //holds fillColor; no vectors to use
37 TYPE_CLOSE_PATH, //no vectors to use
38 TYPE_ENDFILL, //holds transparent fillColor; no vectors to use
39 TYPE_STROKE, //holds strokeColor
40 TYPE_MOVE, //moves p0 to p1; p1 is to be stored
41 TYPE_LINE, //draws a line from p0 to p1
42 TYPE_CURVE_QUADRATIC, //draws a curve from p0 with kink to p1 before ending at p2 then; p1 and p2 is to be stored
43 TYPE_CURVE_CUBIC, //draws a curve from p0 with kink to p1 before ending at p2 and another from p2 with kink to p3 then ends at p4
44 TYPE_TEXT, //TODO: handle string content
45 TYPE_IMAGE //TODO: think of how to handle blits from imageB to imageA
46 };
47
48 VectorData();
49 VectorData(type p_type);
50 virtual ~VectorData();
51
52 void setType(type p_type);
53 type getType() const;
54 void setPoints(vector<PointData> p_points);
55 vector<PointData> getPoints();
59 unsigned int count;
60
62 vector<PointData> points;
63
65 protected:
66
67 long lImg; //index reference to array of typeImage
68 };
69#endif //GTKMM_KAGE_DATA_VECTOR_H
Definition: color.h:28
Definition: strokecolor.h:27
Definition: vectordata.h:32
void setType(type p_type)
Definition: vectordata.cpp:37
VectorData()
Definition: vectordata.cpp:25
virtual ~VectorData()
Definition: vectordata.cpp:33
type getType() const
Definition: vectordata.cpp:43
vector< PointData > points
Definition: vectordata.h:62
ColorData fillColor
Definition: vectordata.h:57
VectorData clone()
Definition: vectordata.cpp:56
unsigned int count
Definition: vectordata.h:59
type
Definition: vectordata.h:34
@ TYPE_TEXT
Definition: vectordata.h:44
@ TYPE_CURVE_CUBIC
Definition: vectordata.h:43
@ TYPE_FILL
Definition: vectordata.h:36
@ TYPE_CURVE_QUADRATIC
Definition: vectordata.h:42
@ TYPE_IMAGE
Definition: vectordata.h:45
@ TYPE_CLOSE_PATH
Definition: vectordata.h:37
@ TYPE_INIT
Definition: vectordata.h:35
@ TYPE_MOVE
Definition: vectordata.h:40
@ TYPE_ENDFILL
Definition: vectordata.h:38
@ TYPE_STROKE
Definition: vectordata.h:39
@ TYPE_LINE
Definition: vectordata.h:41
long lImg
Definition: vectordata.h:67
void setPoints(vector< PointData > p_points)
Definition: vectordata.cpp:47
StrokeColorData stroke
Definition: vectordata.h:56
type vectorType
Definition: vectordata.h:61
string fillColorGradientID
Definition: vectordata.h:58
vector< PointData > getPoints()
Definition: vectordata.cpp:52