39 [NSURL fileURLWithPath:[NSString stringWithUTF8String:path.c_str()]];
40 CGImageDestinationRef destination = CGImageDestinationCreateWithURL(
41 (__bridge CFURLRef)output_url, kUTTypePNG, 1,
nullptr);
42 if (destination !=
nullptr) {
43 CGImageDestinationAddImage(destination, cg_image_,
44 (__bridge CFDictionaryRef) @{});
46 if (CGImageDestinationFinalize(destination)) {
50 CFRelease(destination);