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
qdistancefield_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 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 QDISTANCEFIELD_H
5#define QDISTANCEFIELD_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 <QtGui/private/qtguiglobal_p.h>
19#include <qrawfont.h>
20#include <private/qfontengine_p.h>
21#include <QtCore/qshareddata.h>
22#include <QtCore/qglobal.h>
23#include <QLoggingCategory>
24
26
27bool Q_GUI_EXPORT qt_fontHasNarrowOutlines(const QRawFont &f);
28bool Q_GUI_EXPORT qt_fontHasNarrowOutlines(QFontEngine *fontEngine);
29
30int Q_GUI_EXPORT QT_DISTANCEFIELD_BASEFONTSIZE(bool narrowOutlineFont);
31int Q_GUI_EXPORT QT_DISTANCEFIELD_TILESIZE(bool narrowOutlineFont);
32int Q_GUI_EXPORT QT_DISTANCEFIELD_SCALE(bool narrowOutlineFont);
33int Q_GUI_EXPORT QT_DISTANCEFIELD_RADIUS(bool narrowOutlineFont);
34int Q_GUI_EXPORT QT_DISTANCEFIELD_HIGHGLYPHCOUNT();
35
36class Q_GUI_EXPORT QDistanceFieldData : public QSharedData
37{
38public:
39 QDistanceFieldData() : glyph(0), width(0), height(0), nbytes(0), data(nullptr) {}
42
43 static QDistanceFieldData *create(const QSize &size);
44 static QDistanceFieldData *create(const QPainterPath &path, bool doubleResolution);
45
47 int width;
48 int height;
49 int nbytes;
51};
52
53class Q_GUI_EXPORT QDistanceField
54{
55public:
57 QDistanceField(int width, int height);
58 QDistanceField(const QRawFont &font, glyph_t glyph, bool doubleResolution = false);
59 QDistanceField(QFontEngine *fontEngine, glyph_t glyph, bool doubleResolution = false);
60 QDistanceField(const QPainterPath &path, glyph_t glyph, bool doubleResolution = false);
61
62 bool isNull() const;
63
64 glyph_t glyph() const;
65 void setGlyph(const QRawFont &font, glyph_t glyph, bool doubleResolution = false);
66 void setGlyph(QFontEngine *fontEngine, glyph_t glyph, bool doubleResolution = false);
67
68 int width() const;
69 int height() const;
70
71 QDistanceField copy(const QRect &rect = QRect()) const;
72 inline QDistanceField copy(int x, int y, int w, int h) const
73 { return copy(QRect(x, y, w, h)); }
74
75 uchar *bits();
76 const uchar *bits() const;
77 const uchar *constBits() const;
78
79 uchar *scanLine(int);
80 const uchar *scanLine(int) const;
81 const uchar *constScanLine(int) const;
82
84
85private:
87 QSharedDataPointer<QDistanceFieldData> d;
88
89 friend class QDistanceFieldData;
90};
91
93
94#endif // QDISTANCEFIELD_H
QDistanceField copy(int x, int y, int w, int h) const
\inmodule QtGui
Definition qimage.h:37
Format
The following image formats are available in Qt.
Definition qimage.h:41
@ Format_ARGB32_Premultiplied
Definition qimage.h:48
\inmodule QtGui
The QRawFont class provides access to a single physical instance of a font.
Definition qrawfont.h:24
\inmodule QtCore\reentrant
Definition qrect.h:30
\inmodule QtCore
Definition qshareddata.h:19
\inmodule QtCore
Definition qsize.h:25
rect
[4]
Combined button and popup list for selecting options.
static jboolean copy(JNIEnv *, jobject)
int Q_GUI_EXPORT QT_DISTANCEFIELD_TILESIZE(bool narrowOutlineFont)
QT_BEGIN_NAMESPACE bool Q_GUI_EXPORT qt_fontHasNarrowOutlines(const QRawFont &f)
int Q_GUI_EXPORT QT_DISTANCEFIELD_RADIUS(bool narrowOutlineFont)
int Q_GUI_EXPORT QT_DISTANCEFIELD_BASEFONTSIZE(bool narrowOutlineFont)
int Q_GUI_EXPORT QT_DISTANCEFIELD_SCALE(bool narrowOutlineFont)
int Q_GUI_EXPORT QT_DISTANCEFIELD_HIGHGLYPHCOUNT()
GLint GLint GLint GLint GLint x
[0]
GLfloat GLfloat GLfloat w
[0]
GLint GLsizei GLsizei height
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLfloat GLfloat f
GLint GLsizei width
GLint GLsizei GLsizei GLenum format
GLint y
GLfloat GLfloat GLfloat GLfloat h
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const void * bits
GLsizei const GLchar *const * path
unsigned int glyph_t
unsigned char uchar
Definition qtypes.h:32
QObject::connect nullptr
QSharedPointer< T > other(t)
[5]
view create()