1

現在、画像を再スケーリングするために次のことを行っています。

CGImageRef resizeCGImage(CGImageRef image, size_t new_width, size_t new_height)
{


CGColorSpaceRef colorspace = CGImageGetColorSpace(image);
CGContextRef context = CGBitmapContextCreate(NULL, new_width,new_height,
                                             8,
                                             new_width*4,
                                             colorspace,
                                             kCGImageAlphaNoneSkipLast);

if (context != NULL)
{
    CGContextSetInterpolationQuality(context, kCGInterpolationHigh);
    CGContextDrawImage(context, CGRectMake(0 , 0, new_width, new_height), image);
    CGImageRef imgRef = CGBitmapContextCreateImage(context);
    CGContextRelease(context);

    return imgRef;
}

return NULL;

}

1920x1080 から 1280x720 にサイズを変更すると、画質が低すぎます。小さなテキストの周りで最も目立ちます (読みにくくなります)。

画像を再スケーリングするためのより良い方法 (Cocoa API によって提供される) はありますか? 「より良い」とは、より良い画質を意味します。

4

1 に答える 1