Okular

utils.h
1/*
2 SPDX-FileCopyrightText: 2006 Luigi Toscano <luigi.toscano@tiscali.it>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#ifndef _OKULAR_UTILS_H_
8#define _OKULAR_UTILS_H_
9
10#include "area.h"
11#include "okularcore_export.h"
12
13class QRect;
14class QImage;
15
16namespace Okular
17{
18/**
19 * @short General utility functions.
20 *
21 * This class contains some static functions of general utility.
22 */
23class OKULARCORE_EXPORT Utils
24{
25public:
26 /**
27 * Rotate the rect \p source in the area \p width x \p height with the
28 * specified \p orientation .
29 */
30 static QRect rotateRect(const QRect source, int width, int height, int orientation);
31
32 /**
33 * Return the real DPI of the display containing given window
34 *
35 * On X11, it can indicate the real horizontal DPI value without any Xrdb
36 * setting. Otherwise, returns the same as realDpiX/Y(),
37 *
38 * @since 22.04
39 */
40 static QSizeF realDpi(const QWindow *windowOnScreen);
41
42 /**
43 * Compute the smallest rectangle that contains all non-white pixels in image),
44 * in normalized [0,1] coordinates.
45 *
46 * @since 0.7 (KDE 4.1)
47 */
48 static NormalizedRect imageBoundingBox(const QImage *image);
49};
50
51}
52
53#endif
54
55/* kate: replace-tabs on; indent-width 4; */
A NormalizedRect is a rectangle which can be defined by two NormalizedPoints.
Definition area.h:189
General utility functions.
Definition utils.h:24
global.h
Definition action.h:17
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 8 2024 11:49:40 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.