Skip to content

Commit

Permalink
fix mac build error
Browse files Browse the repository at this point in the history
  • Loading branch information
jaaronkot committed Jan 15, 2025
1 parent ddb535f commit ab72463
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 58 deletions.
12 changes: 0 additions & 12 deletions examples/mac/GPUPixelMacApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@
/* Begin PBXBuildFile section */
840CD3D12B8843CD00EEF7B0 /* gpupixel.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 840CD3CF2B88431900EEF7B0 /* gpupixel.framework */; };
840CD3D22B8843CD00EEF7B0 /* gpupixel.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 840CD3CF2B88431900EEF7B0 /* gpupixel.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
840FD5BD2B7E523D00781FA6 /* vnn_face_osx.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 840FD5BA2B7E523D00781FA6 /* vnn_face_osx.framework */; };
840FD5BE2B7E523D00781FA6 /* vnn_face_osx.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 840FD5BA2B7E523D00781FA6 /* vnn_face_osx.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
840FD5BF2B7E523D00781FA6 /* vnn_core_osx.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 840FD5BB2B7E523D00781FA6 /* vnn_core_osx.framework */; };
840FD5C02B7E523D00781FA6 /* vnn_core_osx.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 840FD5BB2B7E523D00781FA6 /* vnn_core_osx.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
840FD5C12B7E523D00781FA6 /* vnn_kit_osx.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 840FD5BC2B7E523D00781FA6 /* vnn_kit_osx.framework */; };
840FD5C22B7E523D00781FA6 /* vnn_kit_osx.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 840FD5BC2B7E523D00781FA6 /* vnn_kit_osx.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
84AE136B26FCBCAA00E215AE /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84AE136A26FCBCAA00E215AE /* AVFoundation.framework */; };
84AE137526FCBCDA00E215AE /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84AE137426FCBCDA00E215AE /* CoreMedia.framework */; };
84AE137A26FCBCFA00E215AE /* VideoCameraManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84AE137926FCBCFA00E215AE /* VideoCameraManager.mm */; };
Expand All @@ -33,9 +27,6 @@
dstSubfolderSpec = 10;
files = (
840CD3D22B8843CD00EEF7B0 /* gpupixel.framework in Embed Frameworks */,
840FD5C02B7E523D00781FA6 /* vnn_core_osx.framework in Embed Frameworks */,
840FD5BE2B7E523D00781FA6 /* vnn_face_osx.framework in Embed Frameworks */,
840FD5C22B7E523D00781FA6 /* vnn_kit_osx.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -70,10 +61,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
840FD5C12B7E523D00781FA6 /* vnn_kit_osx.framework in Frameworks */,
840CD3D12B8843CD00EEF7B0 /* gpupixel.framework in Frameworks */,
840FD5BD2B7E523D00781FA6 /* vnn_face_osx.framework in Frameworks */,
840FD5BF2B7E523D00781FA6 /* vnn_core_osx.framework in Frameworks */,
84AE137526FCBCDA00E215AE /* CoreMedia.framework in Frameworks */,
84AE136B26FCBCAA00E215AE /* AVFoundation.framework in Frameworks */,
);
Expand Down
49 changes: 3 additions & 46 deletions examples/mac/GPUPixelMacApp/ViewController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ @interface ViewController() <GPUImageVideoCameraDelegate> {
GPUPixelView *gpuPixelView;
std::shared_ptr<BeautyFaceFilter> beauty_face_filter_;
std::shared_ptr<TargetRawDataOutput> targetRawOutput_;
std::shared_ptr<FaceReshapeFilter> face_reshape_filter_;
std::shared_ptr<gpupixel::FaceMakeupFilter> lipstick_filter_;
std::shared_ptr<gpupixel::FaceMakeupFilter> blusher_filter_;
}

@property (weak) IBOutlet NSSlider *levelSlider;
Expand Down Expand Up @@ -96,28 +93,12 @@ -(void) initVideoFilter {
gpuPixelView = [[GPUPixelView alloc] initWithFrame: self.view.frame];
[self.view addSubview:gpuPixelView positioned:NSWindowBelow relativeTo:nil];

// create filter

lipstick_filter_ = LipstickFilter::create();
blusher_filter_ = BlusherFilter::create();
face_reshape_filter_ = FaceReshapeFilter::create();

gpuPixelRawInput->RegLandmarkCallback([=](std::vector<float> landmarks) {
lipstick_filter_->SetFaceLandmarks(landmarks);
blusher_filter_->SetFaceLandmarks(landmarks);
face_reshape_filter_->SetFaceLandmarks(landmarks);
});

// create filter
targetRawOutput_ = TargetRawDataOutput::create();
beauty_face_filter_ = BeautyFaceFilter::create();


gpuPixelRawInput->addTarget(lipstick_filter_)
->addTarget(blusher_filter_)
->addTarget(face_reshape_filter_)
->addTarget(beauty_face_filter_)
->addTarget(gpuPixelView);

gpuPixelRawInput->addTarget(beauty_face_filter_);
beauty_face_filter_->addTarget(gpuPixelView);

[gpuPixelView setFillMode:(gpupixel::TargetView::PreserveAspectRatioAndFill)];

Expand All @@ -133,31 +114,7 @@ - (void)setWhithValue:(CGFloat)value{
_whithValue = value;
beauty_face_filter_->setWhite(value/20);
}
- (void)setSaturationValue:(CGFloat)value{
_saturationValue = value;
}

- (void)setThinFaceValue:(CGFloat)value{
_thinFaceValue = value;
face_reshape_filter_->setFaceSlimLevel(value/100);
}

- (void)setEyeValue:(CGFloat)value{
_eyeValue = value;
face_reshape_filter_->setEyeZoomLevel(value/50);
}

- (void)setLipstickValue:(CGFloat)value{
_lipstickValue = value;
lipstick_filter_->setBlendLevel(value/10);
}

- (void)setBlusherValue:(CGFloat)value{
_blusherValue = value;
blusher_filter_->setBlendLevel(value/10);
}


- (void)willOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer {
CVImageBufferRef imageBuffer = CMSampleBufferGetImageBuffer(sampleBuffer);
CVPixelBufferLockBaseAddress(imageBuffer, 0);
Expand Down

0 comments on commit ab72463

Please sign in to comment.