synfig-core
1.0.3
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
src
synfig
target_cairo_tile.h
Go to the documentation of this file.
1
/* === S Y N F I G ========================================================= */
22
/* ========================================================================= */
23
24
/* === S T A R T =========================================================== */
25
26
#ifndef __SYNFIG_TARGET_CAIRO_TILE_H
27
#define __SYNFIG_TARGET_CAIRO_TILE_H
28
29
/* === H E A D E R S ======================================================= */
30
31
#include "
target.h
"
32
#include "cairo.h"
33
34
35
/* === M A C R O S ========================================================= */
36
37
#define TILE_SIZE 120
38
39
/* === T Y P E D E F S ===================================================== */
40
41
/* === C L A S S E S & S T R U C T S ======================================= */
42
43
namespace
synfig {
44
45
class
CairoSurface;
46
51
class
Target_Cairo_Tile
:
public
Target
52
{
54
int
threads_;
56
int
tile_w_;
58
int
tile_h_;
60
int
curr_tile_;
63
bool
clipping_;
64
65
public
:
66
typedef
etl::handle<Target_Cairo_Tile>
Handle
;
67
typedef
etl::loose_handle<Target_Cairo_Tile>
LooseHandle
;
68
typedef
etl::handle<const Target_Cairo_Tile>
ConstHandle
;
70
Target_Cairo_Tile
();
71
73
virtual
bool
render
(
ProgressCallback
*cb=NULL);
74
76
82
virtual
int
next_tile
(
int
& x,
int
& y);
83
86
virtual
int
next_frame
(
Time
& time);
87
89
virtual
bool
add_tile
(cairo_surface_t* surface,
int
x,
int
y)=0;
91
virtual
int
total_tiles
()
const
92
{
93
// Width of the image(in tiles)
94
const
int
tw(
rend_desc
().get_w()/tile_w_+(
rend_desc
().get_w()%tile_w_?1:0));
95
const
int
th(
rend_desc
().get_h()/tile_h_+(
rend_desc
().get_h()%tile_h_?1:0));
96
97
return
tw*th;
98
}
100
void
set_threads
(
int
x) { threads_=x; }
102
int
get_threads
()
const
{
return
threads_; }
104
void
set_tile_w
(
int
w) { tile_w_=w; }
106
int
get_tile_w
()
const
{
return
tile_w_; }
108
void
set_tile_h
(
int
h) { tile_h_=h; }
110
int
get_tile_h
()
const
{
return
tile_h_; }
112
bool
get_clipping
()
const
{
return
clipping_; }
114
void
set_clipping
(
bool
x) { clipping_=x; }
115
116
118
120
virtual
bool
start_frame
(
ProgressCallback
*cb=NULL)=0;
121
123
124
virtual
void
end_frame
()=0;
125
127
static
void
gamma_filter
(cairo_surface_t* surface,
const
synfig::Gamma
gamma
);
128
129
private
:
131
bool
render_frame_(
Context
context,
ProgressCallback
*cb=0);
132
133
};
// END of class Target_Cairo_Tile
134
135
};
// END of namespace synfig
136
137
/* === E N D =============================================================== */
138
139
#endif
Generated on Mon Nov 16 2015 15:33:51 for synfig-core by
1.8.1.2