6#include <private/qcore_mac_p.h>
7#include <private/qcoregraphics_p.h>
9#import <Foundation/Foundation.h>
10#import <CoreGraphics/CoreGraphics.h>
11#include <Accelerate/Accelerate.h>
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37CGImageRef QImage::toCGImage()
const
42 auto cgImageFormat = qt_mac_cgImageFormatForImage(*
this);
47 auto deleter = [](
void *image,
const void *, size_t)
48 {
delete static_cast<QImage *>(image); };
49 QCFType<CGDataProviderRef> dataProvider =
50 CGDataProviderCreateWithData(
new QImage(*
this), bits(), sizeInBytes(), deleter);
52 const bool shouldInterpolate =
false;
54 return CGImageCreate(width(), height(),
55 cgImageFormat->bitsPerComponent, cgImageFormat->bitsPerPixel,
56 this->bytesPerLine(), cgImageFormat->colorSpace,
57 cgImageFormat->bitmapInfo, dataProvider, cgImageFormat->decode,
58 shouldInterpolate, cgImageFormat->renderingIntent