initial commit
[goodguy/cinelerra.git] / cinelerra-5.1 / plugins / motion-hv / motioncache-hv.h
1 /*
2  * CINELERRA
3  * Copyright (C) 2016 Adam Williams <broadcast at earthling dot net>
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 2 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  * 
19  */
20
21
22 #ifndef MOTIONCACHE_HV_H
23 #define MOTIONCACHE_HV_H
24
25 // store previously scaled intermediates here for operations 
26 // with multiple motion scans on the same frame.
27
28 #include "arraylist.h"
29 #include "mutex.inc"
30 #include "vframe.inc"
31
32 class MotionHVCacheItem
33 {
34 public:
35         MotionHVCacheItem();
36         ~MotionHVCacheItem();
37
38         VFrame *image;
39         int ratio;
40         int is_previous;
41 };
42
43
44 class MotionHVCache
45 {
46 public:
47         MotionHVCache();
48         ~MotionHVCache();
49         
50         VFrame *get_image(int ratio, 
51                 int is_previous,
52                 int downsampled_w,
53                 int downsampled_h,
54                 VFrame *src);
55         
56         void clear();
57
58         void downsample_frame(VFrame *dst, 
59                 VFrame *src, 
60                 int downsample);
61
62         ArrayList<MotionHVCacheItem*> images;
63         Mutex *lock;
64 };
65
66
67
68
69
70 #endif
71
72