Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qcoregraphics_p.h
Go to the documentation of this file.
1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QCOREGRAPHICS_P_H
5#define QCOREGRAPHICS_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtCore/private/qcore_mac_p.h>
19
20#include <QtGui/private/qtguiglobal_p.h>
21#include <QtGui/qregion.h>
22#include <QtGui/qpalette.h>
23
24#include <CoreGraphics/CoreGraphics.h>
25
26#if defined(__OBJC__)
27# if defined(Q_OS_MACOS)
28# include <AppKit/AppKit.h>
29# elif defined(QT_PLATFORM_UIKIT)
30# include <UIKit/UIKit.h>
31# endif
32#endif
33
35
36Q_GUI_EXPORT CGBitmapInfo qt_mac_bitmapInfoForImage(const QImage &image);
37
38#ifdef QT_PLATFORM_UIKIT
39Q_GUI_EXPORT QImage qt_mac_toQImage(const UIImage *image, QSizeF size);
40#endif
41
42#ifdef Q_OS_MACOS
43Q_GUI_EXPORT QPixmap qt_mac_toQPixmap(const NSImage *image, const QSizeF &size);
44
46
47// @compatibility_alias doesn't work with categories or their methods
48#define imageFromQImage QT_MANGLE_NAMESPACE(imageFromQImage)
49#define imageFromQIcon QT_MANGLE_NAMESPACE(imageFromQIcon)
50
51@interface NSImage (QtExtras)
52+ (instancetype)imageFromQImage:(const QT_PREPEND_NAMESPACE(QImage) &)image;
53+ (instancetype)imageFromQIcon:(const QT_PREPEND_NAMESPACE(QIcon) &)icon;
54+ (instancetype)imageFromQIcon:(const QT_PREPEND_NAMESPACE(QIcon) &)icon withSize:(int)size;
55@end
57
58#endif
59Q_GUI_EXPORT CGImageRef qt_mac_toCGImage(const QImage &qImage);
60Q_GUI_EXPORT CGImageRef qt_mac_toCGImageMask(const QImage &qImage);
61Q_GUI_EXPORT QImage qt_mac_toQImage(CGImageRef image);
62
63Q_GUI_EXPORT void qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGImageRef inImage);
64
65Q_GUI_EXPORT void qt_mac_clip_cg(CGContextRef hd, const QRegion &rgn, CGAffineTransform *orig_xform);
66
67#ifdef Q_OS_MACOS
68Q_GUI_EXPORT QColor qt_mac_toQColor(const NSColor *color);
69Q_GUI_EXPORT QBrush qt_mac_toQBrush(const NSColor *color, QPalette::ColorGroup colorGroup = QPalette::Normal);
70#endif
71Q_GUI_EXPORT QColor qt_mac_toQColor(CGColorRef color);
72Q_GUI_EXPORT QBrush qt_mac_toQBrush(CGColorRef color);
73
74class Q_GUI_EXPORT QMacCGContext
75{
76public:
77 QMacCGContext() = default;
80
81 operator CGContextRef() { return context; }
82
83private:
84 void initialize(QPaintDevice *paintDevice);
85 void initialize(const QImage *, QPainter *painter = nullptr);
86 QCFType<CGContextRef> context;
87};
88
90
91#endif // QCOREGRAPHICS_P_H
\inmodule QtGui
Definition qbrush.h:30
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition qcolor.h:31
The QIcon class provides scalable icons in different modes and states.
Definition qicon.h:20
\inmodule QtGui
Definition qimage.h:37
QMacCGContext()=default
The QPainter class performs low-level painting on widgets and other paint devices.
Definition qpainter.h:46
ColorGroup
\value Disabled \value Active \value Inactive \value Normal synonym for Active
Definition qpalette.h:49
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
Definition qpixmap.h:27
The QRegion class specifies a clip region for a painter.
Definition qregion.h:27
\inmodule QtCore
Definition qsize.h:208
Combined button and popup list for selecting options.
Definition image.cpp:4
static void * context
void qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGImageRef inImage)
QBrush qt_mac_toQBrush(CGColorRef color)
void qt_mac_clip_cg(CGContextRef hd, const QRegion &rgn, CGAffineTransform *orig_xform)
QColor qt_mac_toQColor(CGColorRef color)
QImage qt_mac_toQImage(CGImageRef image)
CGImageRef qt_mac_toCGImage(const QImage &inImage)
CGImageRef qt_mac_toCGImageMask(const QImage &image)
Q_GUI_EXPORT QImage qt_mac_toQImage(CGImageRef image)
QT_BEGIN_NAMESPACE Q_GUI_EXPORT CGBitmapInfo qt_mac_bitmapInfoForImage(const QImage &image)
static bool initialize()
Definition qctf.cpp:94
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint color
[2]
GLfloat GLfloat p
[1]
struct CGContext * CGContextRef
QPainter painter(this)
[7]