Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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 <QtGui/private/qa8image_p.h>
20#include <qrawfont.h>
21#include <private/qfontengine_p.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 QDistanceField : public QA8Image
37{
38public:
39 QDistanceField();
40 QDistanceField(int width, int height);
41 QDistanceField(const QRawFont &font, glyph_t glyph, bool doubleResolution = false);
42 QDistanceField(QFontEngine *fontEngine, glyph_t glyph, bool doubleResolution = false);
43 QDistanceField(const QPainterPath &path, glyph_t glyph, bool doubleResolution = false);
44 QDistanceField(QSize size, const QPainterPath &path, glyph_t glyph, bool doubleResolution = false);
45
46 glyph_t glyph() const;
47 void setGlyph(const QRawFont &font, glyph_t glyph, bool doubleResolution = false);
48 void setGlyph(QFontEngine *fontEngine, glyph_t glyph, bool doubleResolution = false);
49
50 QDistanceField copy(const QRect &rect = QRect()) const;
51 inline QDistanceField copy(int x, int y, int w, int h) const
52 { return copy(QRect(x, y, w, h)); }
53
54private:
55 QDistanceField(const QA8Image &image, glyph_t glyph);
56
57 glyph_t m_glyph = 0;
58};
59
60QT_END_NAMESPACE
61
62#endif // QDISTANCEFIELD_H
The QRawFont class provides access to a single physical instance of a font.
Definition qrawfont.h:24
Combined button and popup list for selecting options.
static QPainterPath glyphPath(QFontEngine *fontEngine, glyph_t glyph)
static void makeDistanceField(QA8Image *image, const QPainterPath &path, int dfScale, int offs)
static QPainterPath glyphPath(const QRawFont &font, glyph_t glyph, bool doubleResolution)
int QT_DISTANCEFIELD_HIGHGLYPHCOUNT()
bool qt_fontHasNarrowOutlines(const QRawFont &f)
void fillLines(qint32 *bits, int width, int height, int upperY, int lowerY, int &lx, int ldx, int &rx, int rdx, qint32 &d, qint32 ddy, qint32 ddx)
static QSize distanceFieldSize(const QPainterPath &path, bool doubleResolution)
static int QT_DISTANCEFIELD_DEFAULT_BASEFONTSIZE
static void drawPolygons(qint32 *bits, int width, int height, const QPoint *vertices, const quint32 *indices, int indexCount, qint32 value)
static int QT_DISTANCEFIELD_DEFAULT_HIGHGLYPHCOUNT
void drawRectangle(qint32 *bits, int width, int height, const QPoint *int1, const QPoint *center1, const QPoint *ext1, const QPoint *int2, const QPoint *center2, const QPoint *ext2, qint32 extValue)
void fillLine(qint32 *, int, int, int, qint32, qint32)
static int QT_DISTANCEFIELD_DEFAULT_RADIUS
bool qt_fontHasNarrowOutlines(QFontEngine *fontEngine)
int QT_DISTANCEFIELD_RADIUS(bool narrowOutlineFont)
static bool isWithinAllocationLimit(QSize size)
int QT_DISTANCEFIELD_SCALE(bool narrowOutlineFont)
static int QT_DISTANCEFIELD_DEFAULT_SCALE
void fillLine< Clip, LeftToRight >(qint32 *line, int width, int lx, int rx, qint32 d, qint32 dd)
static void initialDistanceFieldFactor()
void drawTriangle(qint32 *bits, int width, int height, const QPoint *center, const QPoint *v1, const QPoint *v2, qint32 value)
int QT_DISTANCEFIELD_BASEFONTSIZE(bool narrowOutlineFont)
static bool imageHasNarrowOutlines(const QImage &im)
void fillLine< Clip, RightToLeft >(qint32 *line, int width, int lx, int rx, qint32 d, qint32 dd)
QT_BEGIN_NAMESPACE Q_STATIC_LOGGING_CATEGORY(lcSynthesizedIterableAccess, "qt.iterable.synthesized", QtWarningMsg)
QDebug Q_GUI_EXPORT & operator<<(QDebug &s, const QVectorPath &path)