1 /*****************************************************************************
2 
3         ProcAlpha.h
4         Author: Laurent de Soras, 2021
5 
6 --- Legal stuff ---
7 
8 This program is free software. It comes without any warranty, to
9 the extent permitted by applicable law. You can redistribute it
10 and/or modify it under the terms of the Do What The Fuck You Want
11 To Public License, Version 2, as published by Sam Hocevar. See
12 http://www.wtfpl.net/ for more details.
13 
14 *Tab=3***********************************************************************/
15 
16 
17 
18 #pragma once
19 #if ! defined (fmtcavs_ProcAlpha_HEADER_INCLUDED)
20 #define fmtcavs_ProcAlpha_HEADER_INCLUDED
21 
22 
23 
24 /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
25 
26 #include "fmtcavs/FmtAvs.h"
27 #include "fmtcl/BitBltConv.h"
28 #include "fmtcl/SplFmt.h"
29 
30 
31 
32 class PVideoFrame;
33 
34 namespace fmtcavs
35 {
36 
37 
38 
39 class CpuOpt;
40 
41 class ProcAlpha
42 {
43 
44 /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
45 
46 public:
47 
48 	explicit       ProcAlpha (FmtAvs fmt_dst, FmtAvs fmt_src, int w, int h, const CpuOpt &cpu_opt);
49 
50 	void           process_plane (::PVideoFrame &dst_sptr, ::PVideoFrame &src_sptr) const;
51 
52 
53 
54 /*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
55 
56 protected:
57 
58 
59 
60 /*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
61 
62 private:
63 
64 	bool           _dst_a_flag = false;
65 	bool           _src_a_flag = false;
66 	int            _dst_res    = -1;
67 	int            _src_res    = -1;
68 	fmtcl::SplFmt  _splfmt_dst = fmtcl::SplFmt_ILLEGAL;
69 	fmtcl::SplFmt  _splfmt_src = fmtcl::SplFmt_ILLEGAL;
70 	int            _w          = 0;
71 	int            _h          = 0;
72 	fmtcl::BitBltConv::ScaleInfo // Set only when both source and dest have an alpha plane
73 	               _scale_info;
74 	bool           _sse2_flag  = false;
75 	bool           _avx2_flag  = false;
76 
77 
78 
79 /*\\\ FORBIDDEN MEMBER FUNCTIONS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
80 
81 private:
82 
83 	               ProcAlpha ()                               = delete;
84 	               ProcAlpha (const ProcAlpha &other)         = delete;
85 	               ProcAlpha (ProcAlpha &&other)              = delete;
86 	ProcAlpha &    operator = (const ProcAlpha &other)        = delete;
87 	ProcAlpha &    operator = (ProcAlpha &&other)             = delete;
88 	bool           operator == (const ProcAlpha &other) const = delete;
89 	bool           operator != (const ProcAlpha &other) const = delete;
90 
91 }; // class ProcAlpha
92 
93 
94 
95 }  // namespace fmtcavs
96 
97 
98 
99 //#include "fmtcavs/ProcAlpha.hpp"
100 
101 
102 
103 #endif   // fmtcavs_ProcAlpha_HEADER_INCLUDED
104 
105 
106 
107 /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
108