GCC Code Coverage Report


Directory: avs_core/
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 2 / 0 / 2
Functions: 100.0% 1 / 0 / 1
Branches: 50.0% 1 / 0 / 2

filters/overlay/overlay.h
Line Branch Exec Source
1 // Avisynth v2.5. Copyright 2002 Ben Rudiak-Gould et al.
2 // http://avisynth.nl
3
4 // This program is free software; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation; either version 2 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit
17 // http://www.gnu.org/copyleft/gpl.html .
18 //
19 // Linking Avisynth statically or dynamically with other modules is making a
20 // combined work based on Avisynth. Thus, the terms and conditions of the GNU
21 // General Public License cover the whole combination.
22 //
23 // As a special exception, the copyright holders of Avisynth give you
24 // permission to link Avisynth with independent modules that communicate with
25 // Avisynth solely through the interfaces defined in avisynth.h, regardless of the license
26 // terms of these independent modules, and to copy and distribute the
27 // resulting combined work under terms of your choice, provided that
28 // every copy of the combined work is accompanied by a complete copy of
29 // the source code of Avisynth (the version of Avisynth used to produce the
30 // combined work), being distributed under the terms of the GNU General
31 // Public License plus this exception. An independent module is a module
32 // which is not derived from or based on Avisynth, such as 3rd-party filters,
33 // import and export plugins, or graphical user interfaces.
34
35 // Overlay (c) 2003, 2004 by Klaus Post
36
37 #ifndef __Overlay_h
38 #define __Overlay_h
39
40 #include <avisynth.h>
41 #include "444convert.h"
42 #include "overlayfunctions.h"
43 #include "blend_common.h"
44
45
46 class Overlay : public GenericVideoFilter
47 /**
48 *
49 **/
50 {
51 public:
52 Overlay(PClip _child, AVSValue args, IScriptEnvironment *env);
53 PVideoFrame __stdcall GetFrame(int n, IScriptEnvironment *env) override;
54 ~Overlay();
55 static AVSValue __cdecl Create(AVSValue args, void*, IScriptEnvironment* env);
56
57 29 int __stdcall SetCacheHints(int cachehints, int frame_range) override
58 {
59 AVS_UNUSED(frame_range);
60
1/2
✓ Branch 2 → 3 taken 29 times.
✗ Branch 2 → 4 not taken.
29 return cachehints == CACHE_GET_MTMODE ? MT_NICE_FILTER : 0;
61 }
62
63 private:
64 void SetOfModeByName(const char* name, IScriptEnvironment* env);
65 OverlayFunction* SelectFunction();
66 static void ClipFrames(ImageOverlayInternal* input, ImageOverlayInternal* overlay, int x, int y);
67 static void FetchConditionals(IScriptEnvironment* env, int*, float *, int*, int*, bool, const char *);
68
69 VideoInfo overlayVi;
70 VideoInfo maskVi;
71 VideoInfo inputVi;
72 VideoInfo outputVi;
73 VideoInfo viInternalWorkingFormat;
74 VideoInfo viInternalOverlayWorkingFormat; // different size
75
76 PClip overlay;
77 PClip mask;
78 int opacity;
79 float opacity_f;
80 bool greymask;
81 bool ignore_conditional;
82 bool full_range;
83 int offset_x, offset_y;
84 bool use444; // conversionless support
85 const char* condVarSuffix;
86
87 const char* name; // Blend parameter
88
89 int pixelsize;
90 int bits_per_pixel;
91 int of_mode;
92
93 const char* output_pixel_format_override;
94
95 int placement; // PLACEMENT_MPEG2 (default) or PLACEMENT_MPEG1
96
97 bool isInternalRGB; // must be planar rgb
98 bool isInternalGrey;
99 bool isInternal444;
100 bool isInternal422;
101 bool isInternal420;
102
103 PClip child444;
104
105 };
106
107
108 #endif //Overlay_h
109