0
我使用下面的代碼來混合兩個圖像。它可以工作,但是topImage會被調整大小以匹配baseImage的長寬比。我如何保持baseImage和topImage的原始尺寸和縱橫比?GPUImage:如何混合兩張不同大小的圖像,同時保持兩張圖像的原始高寬比?
GPUImageMultiplyBlendFilter *overlayBlendFilter = [[GPUImageMultiplyBlendFilter alloc] init];
GPUImagePicture *pic1 = [[GPUImagePicture alloc] initWithImage:baseImage];
GPUImagePicture *pic2 = [[GPUImagePicture alloc] initWithImage:topImage];
[pic1 addTarget:overlayBlendFilter];
[pic1 processImage];
[pic2 addTarget:overlayBlendFilter];
[pic2 processImage];
UIImage *blendedImage = [overlayBlendFilter imageByFilteringImage:topImage];
[imageView setImage:blendedImage];