VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/globals/UIImageTools.h

Last change on this file was 101396, checked in by vboxsync, 7 months ago

FE/Qt: VBox Manager: Moving foreground color selection to UIImageTools so that it could be reused from various places; It's previously used in Chooser and Tools panes.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.5 KB
Line 
1/* $Id: UIImageTools.h 101396 2023-10-10 05:46:03Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - Declarations of utility classes and functions for image manipulation.
4 */
5
6/*
7 * Copyright (C) 2010-2023 Oracle and/or its affiliates.
8 *
9 * This file is part of VirtualBox base platform packages, as
10 * available from https://www.virtualbox.org.
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation, in version 3 of the
15 * License.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, see <https://www.gnu.org/licenses>.
24 *
25 * SPDX-License-Identifier: GPL-3.0-only
26 */
27
28#ifndef FEQT_INCLUDED_SRC_globals_UIImageTools_h
29#define FEQT_INCLUDED_SRC_globals_UIImageTools_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34/* Qt includes: */
35#include <QImage>
36#include <QPixmap>
37
38/* GUI includes: */
39#include "UILibraryDefs.h"
40
41/* Forward declarations: */
42class QPalette;
43
44/** Image operation namespace. */
45namespace UIImageTools
46{
47 /** Converts @a image to gray-scale. */
48 SHARED_LIBRARY_STUFF QImage toGray(const QImage &image);
49
50 /** Makes @a image more dark and dim. */
51 SHARED_LIBRARY_STUFF void dimImage(QImage &image);
52
53 /** Blurs passed @a source image to @a destination cropping by certain @a iRadius. */
54 SHARED_LIBRARY_STUFF void blurImage(const QImage &source, QImage &destination, int iRadius);
55 /** Blurs passed @a source image horizontally to @a destination cropping by certain @a iRadius. */
56 SHARED_LIBRARY_STUFF void blurImageHorizontal(const QImage &source, QImage &destination, int iRadius);
57 /** Blurs passed @a source image vertically to @a destination cropping by certain @a iRadius. */
58 SHARED_LIBRARY_STUFF void blurImageVertical(const QImage &source, QImage &destination, int iRadius);
59
60 /** Applies BET-label of passed @a size. */
61 SHARED_LIBRARY_STUFF QPixmap betaLabel(const QSize &size = QSize(80, 16), QWidget *pHint = 0);
62
63 /** Gathers suitable foreground color for passed @a background color. */
64 SHARED_LIBRARY_STUFF QColor suitableForegroundColor(const QPalette &pal, const QColor &background);
65}
66using namespace UIImageTools /* if header included */;
67
68#endif /* !FEQT_INCLUDED_SRC_globals_UIImageTools_h */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use