AJA NTV2 SDK
17.1.3.1410
NTV2 SDK 17.1.3.1410
ntv2verticalfilter.cpp
Go to the documentation of this file.
1
/* SPDX-License-Identifier: MIT */
8
#include "
ntv2verticalfilter.h
"
9
#include <
memory.h
>
10
11
12
static
inline
RGBAlphaPixel
VerticalFilterPixel
(
RGBAlphaPixel
* pTop,
13
RGBAlphaPixel
* pCurrent,
14
RGBAlphaPixel
* pBottom)
15
{
16
RGBAlphaPixel
destPixel;
17
18
destPixel.
Red
= (pTop->
Red
>> 2) + (pCurrent->
Red
>> 1) + (pBottom->
Red
>> 2);
19
destPixel.
Green
= (pTop->
Green
>> 2) + (pCurrent->
Green
>> 1) + (pBottom->
Green
>> 2);
20
destPixel.
Blue
= (pTop->
Blue
>> 2) + (pCurrent->
Blue
>> 1) + (pBottom->
Blue
>> 2);
21
destPixel.
Alpha
= (pTop->
Alpha
>> 2) + (pCurrent->
Alpha
>> 1) + (pBottom->
Alpha
>> 2);
22
23
return
destPixel;
24
}
25
26
27
static
inline
RGBAlphaPixel
FieldInterpolatePixel
(
RGBAlphaPixel
* pTop,
28
RGBAlphaPixel
* pBottom)
29
{
30
RGBAlphaPixel
destPixel;
31
32
destPixel.
Red
= (pTop->
Red
+ pBottom->
Red
) >> 1;
33
destPixel.
Green
= (pTop->
Green
+ pBottom->
Green
) >> 1;
34
destPixel.
Blue
= (pTop->
Blue
+ pBottom->
Blue
) >> 1;
35
destPixel.
Alpha
= (pTop->
Alpha
+ pBottom->
Alpha
) >> 1;
36
37
return
destPixel;
38
}
39
40
41
42
void
VerticalFilterLine
(
RGBAlphaPixel
* topLine,
43
RGBAlphaPixel
* midLine,
44
RGBAlphaPixel
* bottomLine,
45
RGBAlphaPixel
* destLine,
46
LWord
numPixels )
47
{
48
for
(
LWord
pixelCount = 0; pixelCount < numPixels; pixelCount++ )
49
{
50
*destLine =
VerticalFilterPixel
(topLine, midLine, bottomLine);
51
topLine++;
52
midLine++;
53
bottomLine++;
54
destLine++;
55
}
56
}
57
58
59
void
FieldInterpolateLine
(
RGBAlphaPixel
* topLine,
60
RGBAlphaPixel
* bottomLine,
61
RGBAlphaPixel
* destLine,
62
LWord
numPixels )
63
{
64
for
(
LWord
pixelCount = 0; pixelCount < numPixels; pixelCount++ )
65
{
66
*destLine =
FieldInterpolatePixel
(topLine, bottomLine);
67
topLine++;
68
bottomLine++;
69
destLine++;
70
}
71
}
LWord
int32_t LWord
Definition:
ajatypes.h:252
RGBAlphaPixel::Alpha
unsigned char Alpha
Definition:
ntv2videodefines.h:141
RGBAlphaPixel::Red
unsigned char Red
Definition:
ntv2videodefines.h:140
RGBAlphaPixel::Green
unsigned char Green
Definition:
ntv2videodefines.h:139
FieldInterpolatePixel
static RGBAlphaPixel FieldInterpolatePixel(RGBAlphaPixel *pTop, RGBAlphaPixel *pBottom)
Definition:
ntv2verticalfilter.cpp:27
ntv2verticalfilter.h
Declares the VerticalFilterLine and FieldInterpolateLine functions.
VerticalFilterLine
void VerticalFilterLine(RGBAlphaPixel *topLine, RGBAlphaPixel *midLine, RGBAlphaPixel *bottomLine, RGBAlphaPixel *destLine, LWord numPixels)
Definition:
ntv2verticalfilter.cpp:42
VerticalFilterPixel
static RGBAlphaPixel VerticalFilterPixel(RGBAlphaPixel *pTop, RGBAlphaPixel *pCurrent, RGBAlphaPixel *pBottom)
Definition:
ntv2verticalfilter.cpp:12
RGBAlphaPixel::Blue
unsigned char Blue
Definition:
ntv2videodefines.h:138
memory.h
Declares the AJAMemory class.
RGBAlphaPixel
Definition:
ntv2videodefines.h:137
FieldInterpolateLine
void FieldInterpolateLine(RGBAlphaPixel *topLine, RGBAlphaPixel *bottomLine, RGBAlphaPixel *destLine, LWord numPixels)
Definition:
ntv2verticalfilter.cpp:59
libajantv2
ajantv2
src
ntv2verticalfilter.cpp
Generated on Tue Dec 3 2024 10:26:02 for AJA NTV2 SDK by
1.8.17