Okular

utils.h
1 /*
2  SPDX-FileCopyrightText: 2006 Luigi Toscano <[email protected]>
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 
13 class QRect;
14 class QImage;
15 
16 namespace Okular
17 {
18 /**
19  * @short General utility functions.
20  *
21  * This class contains some static functions of general utility.
22  */
23 class OKULARCORE_EXPORT Utils
24 {
25 public:
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; */
The documentation to the global Okular namespace.
Definition: action.h:16
A NormalizedRect is a rectangle which can be defined by two NormalizedPoints.
Definition: area.h:188
General utility functions.
Definition: utils.h:23
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Sep 26 2023 04:06:53 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.