1 /*
2 * Copyright 2017 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can
5 * be found in the LICENSE file.
6 *
7 */
8
9 //
10 //
11 //
12
13 #include "composition.h"
14 // #include "common.h"
15 // #include "context.h"
16
17 //
18 // high level composition object
19 //
20
21 skc_err
skc_composition_retain(skc_composition_t composition)22 skc_composition_retain(skc_composition_t composition)
23 {
24 composition->ref_count += 1;
25
26 return SKC_ERR_SUCCESS;
27 }
28
29 skc_err
skc_composition_release(skc_composition_t composition)30 skc_composition_release(skc_composition_t composition)
31 {
32 composition->release(composition->impl);
33
34 return SKC_ERR_SUCCESS;
35 }
36
37 //
38 //
39 //
40
41 skc_err
skc_composition_seal(skc_composition_t composition)42 skc_composition_seal(skc_composition_t composition)
43 {
44 //
45 // seal the composition
46 //
47 composition->seal(composition->impl);
48
49 return SKC_ERR_SUCCESS;
50 }
51
52 //
53 //
54 //
55
56 skc_err
skc_composition_unseal(skc_composition_t composition,bool reset)57 skc_composition_unseal(skc_composition_t composition, bool reset)
58 {
59 //
60 // unseal the composition
61 //
62 composition->unseal(composition->impl,reset);
63
64 return SKC_ERR_SUCCESS;
65 }
66
67 //
68 //
69 //
70
71 skc_err
skc_composition_place(skc_composition_t composition,skc_raster_t const * rasters,skc_layer_id const * layer_ids,float const * txs,float const * tys,uint32_t count)72 skc_composition_place(skc_composition_t composition,
73 skc_raster_t const * rasters,
74 skc_layer_id const * layer_ids,
75 float const * txs,
76 float const * tys,
77 uint32_t count) // NOTE: A PER-PLACE CLIP IS POSSIBLE
78 {
79 return composition->place(composition->impl,rasters,layer_ids,txs,tys,count);
80 }
81
82 //
83 //
84 //
85
86 skc_err
skc_composition_get_bounds(skc_composition_t composition,int32_t bounds[4])87 skc_composition_get_bounds(skc_composition_t composition, int32_t bounds[4])
88 {
89 //
90 // not working yet -- need to think about the semantics
91 //
92 // Option 1: return tight bounds of entire composition
93 // Option 2: ?
94 //
95
96 return SKC_ERR_SUCCESS;
97 }
98
99 //
100 //
101 //
102