summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qimage_compat.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@digia.com>2014-01-03 14:46:07 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-08 18:08:47 +0100
commitb28764c641e4fef19d5e800b7537439fb2054914 (patch)
treeec179914c4d94d59490c2a978dbae4b24f353cad /src/gui/image/qimage_compat.cpp
parentaf9910e450ae0374cb4d1479d416469c9f800b73 (diff)
Inplace versions of QImage rgbSwapped() and mirrored() for rvalue refs
Adds inplace version of QImage::rgbSwapped() and QImage::mirrored() that can be used on temporary QImage objects when supported by the compiler. [ChangeLog][QtGui][QImage]Rvalue qualified mirrored and rgbSwapped methods for inline conversions Change-Id: I4ffb658bf620dfc472d9db14c1aa70291c1fd842 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Diffstat (limited to 'src/gui/image/qimage_compat.cpp')
-rw-r--r--src/gui/image/qimage_compat.cpp62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/gui/image/qimage_compat.cpp b/src/gui/image/qimage_compat.cpp
new file mode 100644
index 0000000000..9886d392fb
--- /dev/null
+++ b/src/gui/image/qimage_compat.cpp
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifdef QIMAGE_H
+# error "This file cannot be used with precompiled headers"
+#endif
+#define QT_COMPILING_QIMAGE_COMPAT_CPP
+
+#include "qimage.h"
+
+QT_BEGIN_NAMESPACE
+
+// These implementations must be the same as the inline versions in qimage.h
+QImage QImage::mirrored(bool horizontally, bool vertically) const
+{
+ return mirrored_helper(horizontally, vertically);
+}
+
+QImage QImage::rgbSwapped() const
+{
+ return rgbSwapped_helper();
+}
+
+QT_END_NAMESPACE