synfig-core
1.0.3
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
src
synfig
target_tile.h
Go to the documentation of this file.
1
/* === S Y N F I G ========================================================= */
23
/* ========================================================================= */
24
25
/* === S T A R T =========================================================== */
26
27
#ifndef __SYNFIG_TARGET_TILE_H
28
#define __SYNFIG_TARGET_TILE_H
29
30
/* === H E A D E R S ======================================================= */
31
32
#include "
target.h
"
33
34
/* === M A C R O S ========================================================= */
35
36
#define TILE_SIZE 120
37
38
/* === T Y P E D E F S ===================================================== */
39
40
/* === C L A S S E S & S T R U C T S ======================================= */
41
42
namespace
synfig {
43
48
class
Target_Tile
:
public
Target
49
{
51
int
threads_;
53
int
tile_w_;
55
int
tile_h_;
57
int
curr_tile_;
60
bool
clipping_;
61
62
struct
TileGroup;
63
public
:
64
typedef
etl::handle<Target_Tile>
Handle
;
65
typedef
etl::loose_handle<Target_Tile>
LooseHandle
;
66
typedef
etl::handle<const Target_Tile>
ConstHandle
;
67
68
Target_Tile
();
69
71
virtual
bool
render
(
ProgressCallback
*cb=NULL);
72
74
80
virtual
int
next_tile
(
int
& x,
int
& y);
81
84
virtual
int
next_frame
(
Time
& time);
85
87
virtual
bool
add_tile
(
const
synfig::Surface
&surface,
int
x,
int
y)=0;
89
virtual
int
total_tiles
()
const
90
{
91
// Width of the image(in tiles)
92
const
int
tw(
rend_desc
().get_w()/tile_w_+(
rend_desc
().get_w()%tile_w_?1:0));
93
const
int
th(
rend_desc
().get_h()/tile_h_+(
rend_desc
().get_h()%tile_h_?1:0));
94
95
return
tw*th;
96
}
97
99
102
virtual
bool
start_frame
(
ProgressCallback
*cb=NULL)=0;
103
105
106
virtual
void
end_frame
()=0;
108
void
set_threads
(
int
x) { threads_=x; }
110
int
get_threads
()
const
{
return
threads_; }
112
void
set_tile_w
(
int
w) { tile_w_=w; }
114
int
get_tile_w
()
const
{
return
tile_w_; }
116
void
set_tile_h
(
int
h) { tile_h_=h; }
118
int
get_tile_h
()
const
{
return
tile_h_; }
120
bool
get_clipping
()
const
{
return
clipping_; }
122
void
set_clipping
(
bool
x) { clipping_=x; }
123
124
private
:
126
bool
render_frame_(
Context
context,
ProgressCallback
*cb=0);
127
128
};
// END of class Target_Tile
129
130
};
// END of namespace synfig
131
132
/* === E N D =============================================================== */
133
134
#endif
Generated on Mon Nov 16 2015 15:33:52 for synfig-core by
1.8.1.2