OpenShot Library | libopenshot
1.1.1
Toggle main menu visibility
Loading...
Searching...
No Matches
Pixelate.h
Go to the documentation of this file.
1
8
9
// Copyright (c) 2008-2019 OpenShot Studios, LLC
10
//
11
// SPDX-License-Identifier: LGPL-3.0-or-later
12
13
#ifndef OPENSHOT_PIXELATE_EFFECT_H
14
#define OPENSHOT_PIXELATE_EFFECT_H
15
16
#include "
../EffectBase.h
"
17
18
#include "
../Frame.h
"
19
#include "
../Json.h
"
20
#include "
../KeyFrame.h
"
21
22
#include <memory>
23
#include <string>
24
25
namespace
openshot
26
{
27
enum
PixelateMaskMode
{
28
PIXELATE_MASK_LIMIT_TO_AREA
= 0,
29
PIXELATE_MASK_VARY_STRENGTH
= 1
30
};
31
38
class
Pixelate
:
public
EffectBase
39
{
40
private
:
42
void
init_effect_details();
43
44
protected
:
45
bool
UseCustomMaskBlend
(int64_t frame_number)
const override
;
46
void
ApplyCustomMaskBlend
(std::shared_ptr<QImage> original_image, std::shared_ptr<QImage> effected_image,
47
std::shared_ptr<QImage> mask_image, int64_t frame_number)
const override
;
48
49
public
:
50
Keyframe
pixelization
;
51
Keyframe
left
;
52
Keyframe
top
;
53
Keyframe
right
;
54
Keyframe
bottom
;
55
int
mask_mode
;
56
58
Pixelate
();
59
67
Pixelate
(
Keyframe
pixelization
,
Keyframe
left
,
Keyframe
top
,
Keyframe
right
,
Keyframe
bottom
);
68
75
std::shared_ptr<openshot::Frame>
76
GetFrame
(int64_t frame_number)
override
{
77
return
GetFrame
(std::make_shared<openshot::Frame>(),
78
frame_number);
79
}
80
90
std::shared_ptr<openshot::Frame>
91
GetFrame
(std::shared_ptr<openshot::Frame> frame, int64_t frame_number)
override
;
92
93
// Get and Set JSON methods
94
std::string
Json
()
const override
;
95
void
SetJson
(
const
std::string value)
override
;
96
Json::Value
JsonValue
()
const override
;
97
void
SetJsonValue
(
const
Json::Value root)
override
;
98
101
std::string
PropertiesJSON
(int64_t requested_frame)
const override
;
102
};
103
104
}
105
106
#endif
EffectBase.h
Header file for EffectBase class.
Frame.h
Header file for Frame class.
Json.h
Header file for JSON class.
KeyFrame.h
Header file for the Keyframe class.
openshot::EffectBase
This abstract class is the base class, used by all effects in libopenshot.
Definition
EffectBase.h:57
openshot::Keyframe
A Keyframe is a collection of Point instances, which is used to vary a number or property over time.
Definition
KeyFrame.h:53
openshot::Pixelate::UseCustomMaskBlend
bool UseCustomMaskBlend(int64_t frame_number) const override
Optional override for effects that need custom mask behavior.
Definition
Pixelate.cpp:116
openshot::Pixelate::Pixelate
Pixelate()
Default constructor, useful when using Json to load the effect properties.
Definition
Pixelate.cpp:37
openshot::Pixelate::mask_mode
int mask_mode
Mask behavior mode for this effect.
Definition
Pixelate.h:55
openshot::Pixelate::right
Keyframe right
Size of right margin.
Definition
Pixelate.h:53
openshot::Pixelate::Json
std::string Json() const override
Generate JSON string of this object.
Definition
Pixelate.cpp:154
openshot::Pixelate::PropertiesJSON
std::string PropertiesJSON(int64_t requested_frame) const override
Definition
Pixelate.cpp:216
openshot::Pixelate::GetFrame
std::shared_ptr< openshot::Frame > GetFrame(int64_t frame_number) override
This method is required for all derived classes of ClipBase, and returns a new openshot::Frame object...
Definition
Pixelate.h:76
openshot::Pixelate::pixelization
Keyframe pixelization
Amount of pixelization.
Definition
Pixelate.h:50
openshot::Pixelate::left
Keyframe left
Size of left margin.
Definition
Pixelate.h:51
openshot::Pixelate::JsonValue
Json::Value JsonValue() const override
Generate Json::Value for this object.
Definition
Pixelate.cpp:161
openshot::Pixelate::SetJson
void SetJson(const std::string value) override
Load JSON string into this object.
Definition
Pixelate.cpp:178
openshot::Pixelate::ApplyCustomMaskBlend
void ApplyCustomMaskBlend(std::shared_ptr< QImage > original_image, std::shared_ptr< QImage > effected_image, std::shared_ptr< QImage > mask_image, int64_t frame_number) const override
Optional override for effects with custom mask implementation.
Definition
Pixelate.cpp:121
openshot::Pixelate::SetJsonValue
void SetJsonValue(const Json::Value root) override
Load Json::Value into this object.
Definition
Pixelate.cpp:195
openshot::Pixelate::top
Keyframe top
Size of top margin.
Definition
Pixelate.h:52
openshot::Pixelate::bottom
Keyframe bottom
Size of bottom margin.
Definition
Pixelate.h:54
openshot
This namespace is the default namespace for all code in the openshot library.
Definition
AnimatedCurve.h:24
openshot::PixelateMaskMode
PixelateMaskMode
Definition
Pixelate.h:27
openshot::PIXELATE_MASK_VARY_STRENGTH
@ PIXELATE_MASK_VARY_STRENGTH
Definition
Pixelate.h:29
openshot::PIXELATE_MASK_LIMIT_TO_AREA
@ PIXELATE_MASK_LIMIT_TO_AREA
Definition
Pixelate.h:28
effects
Pixelate.h
Generated by
1.17.0