-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 5d8d8c2
Showing
90 changed files
with
3,779 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.DS_Store |
30 changes: 30 additions & 0 deletions
30
gpupixel.framework/Headers/background_segmentation_filter.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* GPUPixel | ||
* | ||
* Created by pixpark on 2021/6/24. | ||
* Copyright © 2021 PixPark. All rights reserved. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "filter.h" | ||
#include "gpupixel_macros.h" | ||
|
||
NS_GPUPIXEL_BEGIN | ||
|
||
class BackgroundSegmentationFilter : public Filter { | ||
public: | ||
static std::shared_ptr<BackgroundSegmentationFilter> create(); | ||
bool init(); | ||
virtual bool proceed(bool bUpdateTargets = true, | ||
int64_t frameTime = 0) override; | ||
|
||
// void setBrightness(float brightness); | ||
|
||
protected: | ||
BackgroundSegmentationFilter(){}; | ||
|
||
float _brightness; | ||
}; | ||
|
||
NS_GPUPIXEL_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* GPUPixel | ||
* | ||
* Created by PixPark on 2021/6/24. | ||
* Copyright © 2021 PixPark. All rights reserved. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "filter_group.h" | ||
#include "gpupixel_macros.h" | ||
|
||
#include "beauty_face_unit_filter.h" | ||
#include "box_blur_filter.h" | ||
#include "box_high_pass_filter.h" | ||
#include "gaussian_blur_filter.h" | ||
NS_GPUPIXEL_BEGIN | ||
|
||
class BeautyFaceFilter : public FilterGroup { | ||
public: | ||
static std::shared_ptr<BeautyFaceFilter> create(); | ||
~BeautyFaceFilter(); | ||
bool init(); | ||
|
||
void setHighPassDelta(float highPassDelta); | ||
void setSharpen(float sharpen); | ||
void setBlurAlpha(float blurAlpha); | ||
void setWhite(float white); | ||
void setRadius(float sigma); | ||
|
||
virtual void setInputFramebuffer(std::shared_ptr<Framebuffer> framebuffer, | ||
RotationMode rotationMode /* = NoRotation*/, | ||
int texIdx /* = 0*/) override; | ||
|
||
protected: | ||
BeautyFaceFilter(); | ||
|
||
std::shared_ptr<BoxBlurFilter> boxBlurFilter; | ||
std::shared_ptr<BoxHighPassFilter> boxHighPassFilter; | ||
std::shared_ptr<BeautyFaceUnitFilter> beautyFilter; | ||
}; | ||
|
||
NS_GPUPIXEL_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* GPUPixel | ||
* | ||
* Created by PixPark on 2021/6/24. | ||
* Copyright © 2021 PixPark. All rights reserved. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "filter.h" | ||
#include "gpupixel_macros.h" | ||
|
||
NS_GPUPIXEL_BEGIN | ||
class SourceImage; | ||
|
||
class BeautyFaceUnitFilter : public Filter { | ||
public: | ||
static std::shared_ptr<BeautyFaceUnitFilter> create(); | ||
~BeautyFaceUnitFilter(); | ||
bool init(); | ||
bool proceed(bool bUpdateTargets = true, int64_t frameTime = 0) override; | ||
|
||
void setSharpen(float sharpen); | ||
void setBlurAlpha(float blurAlpha); | ||
void setWhite(float white); | ||
|
||
protected: | ||
BeautyFaceUnitFilter(); | ||
|
||
std::shared_ptr<SourceImage> grayImage_; | ||
std::shared_ptr<SourceImage> originImage_; | ||
std::shared_ptr<SourceImage> skinImage_; | ||
std::shared_ptr<SourceImage> customImage_; | ||
|
||
private: | ||
float sharpen_ = 0.0; | ||
float blurAlpha_ = 0.0; | ||
float white_ = 0.0; | ||
}; | ||
|
||
NS_GPUPIXEL_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* GPUPixel | ||
* | ||
* Created by PixPark on 2021/6/24. | ||
* Copyright © 2021 PixPark. All rights reserved. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "filter_group.h" | ||
#include "gpupixel_macros.h" | ||
|
||
NS_GPUPIXEL_BEGIN | ||
|
||
class BilateralMonoFilter : public Filter { | ||
public: | ||
enum Type { HORIZONTAL, VERTICAL }; | ||
|
||
static std::shared_ptr<BilateralMonoFilter> create(Type type = HORIZONTAL); | ||
bool init(); | ||
|
||
virtual bool proceed(bool bUpdateTargets = true, | ||
int64_t frameTime = 0) override; | ||
|
||
void setTexelSpacingMultiplier(float multiplier); | ||
void setDistanceNormalizationFactor(float value); | ||
|
||
protected: | ||
BilateralMonoFilter(Type type); | ||
Type _type; | ||
float _texelSpacingMultiplier; | ||
float _distanceNormalizationFactor; | ||
}; | ||
|
||
class BilateralFilter : public FilterGroup { | ||
public: | ||
virtual ~BilateralFilter(); | ||
|
||
static std::shared_ptr<BilateralFilter> create(); | ||
bool init(); | ||
|
||
void setTexelSpacingMultiplier(float multiplier); | ||
void setDistanceNormalizationFactor(float value); | ||
|
||
protected: | ||
BilateralFilter(); | ||
|
||
private: | ||
// friend BilateralMonoFilter; | ||
std::shared_ptr<BilateralMonoFilter> _hBlurFilter; | ||
std::shared_ptr<BilateralMonoFilter> _vBlurFilter; | ||
}; | ||
|
||
NS_GPUPIXEL_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* GPUPixel | ||
* | ||
* Created by PixPark on 2021/6/24. | ||
* Copyright © 2021 PixPark. All rights reserved. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "face_makeup_filter.h" | ||
|
||
NS_GPUPIXEL_BEGIN | ||
class BlusherFilter : public FaceMakeupFilter { | ||
public: | ||
static std::shared_ptr<BlusherFilter> create(); | ||
bool init() override; | ||
}; | ||
|
||
NS_GPUPIXEL_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* GPUPixel | ||
* | ||
* Created by PixPark on 2021/6/24. | ||
* Copyright © 2021 PixPark. All rights reserved. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "gpupixel_macros.h" | ||
|
||
#include "box_mono_blur_filter.h" | ||
#include "filter_group.h" | ||
NS_GPUPIXEL_BEGIN | ||
|
||
class BoxBlurFilter : public FilterGroup { | ||
public: | ||
virtual ~BoxBlurFilter(); | ||
|
||
static std::shared_ptr<BoxBlurFilter> create(int radius = 4, | ||
float sigma = 2.0); | ||
bool init(int radius, float sigma); | ||
void setRadius(int radius); | ||
void setSigma(float sigma); | ||
void setTexelSpacingMultiplier(float value); | ||
|
||
protected: | ||
BoxBlurFilter(); | ||
|
||
private: | ||
std::shared_ptr<BoxMonoBlurFilter> _hBlurFilter; | ||
std::shared_ptr<BoxMonoBlurFilter> _vBlurFilter; | ||
}; | ||
|
||
NS_GPUPIXEL_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* GPUPixel | ||
* | ||
* Created by PixPark on 2021/6/24. | ||
* Copyright © 2021 PixPark. All rights reserved. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "filter.h" | ||
#include "gpupixel_macros.h" | ||
|
||
NS_GPUPIXEL_BEGIN | ||
|
||
class BoxDifferenceFilter : public Filter { | ||
public: | ||
static std::shared_ptr<BoxDifferenceFilter> create(); | ||
~BoxDifferenceFilter(); | ||
bool init(); | ||
bool proceed(bool bUpdateTargets = true, int64_t frameTime = 0) override; | ||
|
||
// | ||
void setDelta(float delta); | ||
|
||
protected: | ||
BoxDifferenceFilter(); | ||
float delta_; | ||
GLuint filterTexCoordAttribute_; | ||
GLuint filterTexCoordAttribute2_; | ||
}; | ||
|
||
NS_GPUPIXEL_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* GPUPixel | ||
* | ||
* Created by PixPark on 2021/6/24. | ||
* Copyright © 2021 PixPark. All rights reserved. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "gpupixel_macros.h" | ||
|
||
#include "box_blur_filter.h" | ||
#include "box_difference_filter.h" | ||
#include "filter_group.h" | ||
NS_GPUPIXEL_BEGIN | ||
|
||
class BoxHighPassFilter : public FilterGroup { | ||
public: | ||
static std::shared_ptr<BoxHighPassFilter> create(); | ||
~BoxHighPassFilter(); | ||
bool init(); | ||
|
||
void setRadius(float radius); | ||
void setDelta(float delta); | ||
|
||
virtual void setInputFramebuffer(std::shared_ptr<Framebuffer> framebuffer, | ||
RotationMode rotationMode /* = NoRotation*/, | ||
int texIdx /* = 0*/) override; | ||
|
||
protected: | ||
BoxHighPassFilter(); | ||
|
||
std::shared_ptr<BoxBlurFilter> boxBlurFilter; | ||
std::shared_ptr<BoxDifferenceFilter> boxDifferenceFilter; | ||
}; | ||
|
||
NS_GPUPIXEL_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* GPUPixel | ||
* | ||
* Created by PixPark on 2021/6/24. | ||
* Copyright © 2021 PixPark. All rights reserved. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "gpupixel_macros.h" | ||
|
||
#include "gaussian_blur_mono_filter.h" | ||
|
||
NS_GPUPIXEL_BEGIN | ||
|
||
class BoxMonoBlurFilter : public GaussianBlurMonoFilter { | ||
public: | ||
static std::shared_ptr<BoxMonoBlurFilter> create(Type type = HORIZONTAL, | ||
int radius = 4, | ||
float sigma = 2.0); | ||
~BoxMonoBlurFilter(); | ||
bool init(int radius, float sigma); | ||
void setRadius(int radius); | ||
|
||
protected: | ||
BoxMonoBlurFilter(Type type); | ||
|
||
std::string _generateOptimizedVertexShaderString(int radius, | ||
float sigma) override; | ||
std::string _generateOptimizedFragmentShaderString(int radius, | ||
float sigma) override; | ||
}; | ||
|
||
NS_GPUPIXEL_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* GPUPixel | ||
* | ||
* Created by PixPark on 2021/6/24. | ||
* Copyright © 2021 PixPark. All rights reserved. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "filter.h" | ||
#include "gpupixel_macros.h" | ||
|
||
NS_GPUPIXEL_BEGIN | ||
|
||
class BrightnessFilter : public Filter { | ||
public: | ||
static std::shared_ptr<BrightnessFilter> create(float brightness = 0.0); | ||
bool init(float brightness); | ||
virtual bool proceed(bool bUpdateTargets = true, | ||
int64_t frameTime = 0) override; | ||
|
||
void setBrightness(float brightness); | ||
|
||
protected: | ||
BrightnessFilter(){}; | ||
|
||
float _brightness; | ||
}; | ||
|
||
NS_GPUPIXEL_END |
Oops, something went wrong.