Fix the test case of blur radius calculation. CG and CI now match in visual
This commit is contained in:
parent
1afadafc78
commit
86e3a164dc
|
@ -582,7 +582,8 @@ static inline CGImageRef _Nullable SDCGImageFromCIImage(CIImage * _Nonnull ciIma
|
|||
if (self.CIImage) {
|
||||
CIFilter *filter = [CIFilter filterWithName:@"CIGaussianBlur"];
|
||||
[filter setValue:self.CIImage forKey:kCIInputImageKey];
|
||||
[filter setValue:@(blurRadius) forKey:kCIInputRadiusKey];
|
||||
// Blur Radius use pixel count
|
||||
[filter setValue:@(blurRadius / 2) forKey:kCIInputRadiusKey];
|
||||
CIImage *ciImage = filter.outputImage;
|
||||
ciImage = [ciImage imageByCroppingToRect:CGRectMake(0, 0, self.size.width, self.size.height)];
|
||||
#if SD_UIKIT
|
||||
|
|
|
@ -182,7 +182,8 @@
|
|||
expect([leftColor.sd_hexString isEqualToString:expectedColor.sd_hexString]);
|
||||
// Check rounded corner operation not inversion the image
|
||||
UIColor *topCenterColor = [blurredImage sd_colorAtPoint:CGPointMake(150, 20)];
|
||||
expect([topCenterColor.sd_hexString isEqualToString:@"#9a430d06"]).beTruthy();
|
||||
UIColor *bottomCenterColor = [blurredImage sd_colorAtPoint:CGPointMake(150, 280)];
|
||||
expect([topCenterColor.sd_hexString isEqualToString:bottomCenterColor.sd_hexString]).beFalsy();
|
||||
}
|
||||
|
||||
- (void)test08UIImageTransformFilterCG {
|
||||
|
|
Loading…
Reference in New Issue