Skip to content

Commit 6db2c95

Browse files
committed
[WIP] call vImageCreateMonochromeColorSpaceWithWhitePointAndTransferFunction
1 parent 62c8e95 commit 6db2c95

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

SDWebImageAVIFCoder/Classes/SDImageAVIFCoder.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ static CGImageRef CreateImageFromBuffer(avifImage * avif, vImage_Buffer* result)
3030
// use avif->nclx.colourPrimaries and avif->nclx.transferCharacteristics to detect appropriate color space.
3131
CGColorSpaceRef colorSpace = NULL;
3232
if(monochrome){
33-
colorSpace = CGColorSpaceCreateDeviceGray();
33+
vImage_Error err;
34+
vImageWhitePoint whitePoint ;
35+
vImageTransferFunction transferFunction;
36+
CGColorRenderingIntent intent;
37+
colorSpace = vImageCreateMonochromeColorSpaceWithWhitePointAndTransferFunction(&whitePoint, &transferFunction, intent, kvImageNoFlags, &err);
3438
}else{
3539
colorSpace = CGColorSpaceCreateDeviceRGB();
3640
}

0 commit comments

Comments
 (0)