2014-07-16 2 views
0

비디오 카메라 입력 마스크가 잘되어 있지만 마스크가 예상대로 표시되지 않습니다. 서로 다른 폼 팩터에 따라 크기가 다른 2 가지 버전이 있습니다.GPUImageMaskFilter와 함께 사용할 때 마스크가 왜 스케일됩니까?

enter image description here

내 미리보기는 다음과 같습니다 그러나 :

아이폰 5에 대한 테스트는, 마스크 이미지는 다음과 같습니다 (여기에 표시된 일반 크기 만 축소 된 @ 2 배 버전이있다) enter image description here

마스크의 크기가 조절되고 변경되는 방법을 확인하십시오. 왜 이런 일이 일어나는 걸까요?

_camera = [[GPUImageVideoCamera alloc] initWithSessionPreset:AVCaptureSessionPresetHigh cameraPosition:AVCaptureDevicePositionBack]; 
_camera.outputImageOrientation = UIInterfaceOrientationLandscapeRight; 

GPUImageMaskFilter *maskFilter = [[GPUImageMaskFilter alloc] init]; 
[maskFilter setBackgroundColorRed:0.7 green:0.7 blue:0.7 alpha:1.0]; 

[_camera addTarget:maskFilter]; 

CGRect screenRect = [[UIScreen mainScreen] bounds]; 
CGFloat screenHeight = screenRect.size.height; 
NSString *imageName = (screenHeight == 568 ? @"TallCheckMask" : @"ShortCheckMask"); 
UIImage *inputImage = [UIImage imageNamed:imageName]; 
sourcePicture = [[GPUImagePicture alloc] initWithImage:inputImage smoothlyScaleOutput:YES]; 
[sourcePicture processImage]; 
[sourcePicture addTarget:maskFilter]; 

[maskFilter addTarget:_backgroundImageView]; 
[_camera startCameraCapture]; 

답변

0

미리보기가 가로 모드 인 동안 마스크가 세로입니다. 마스크가 회전하지 않습니다.

관련 문제