File indexing completed on 2024-05-12 15:58:48
0001 /* 0002 * kis_vec.h - part of KImageShop 0003 * 0004 * SPDX-FileCopyrightText: 1999 Matthias Elter <me@kde.org> 0005 * 0006 * SPDX-License-Identifier: GPL-2.0-or-later 0007 */ 0008 0009 #ifndef __kis_vec_h__ 0010 #define __kis_vec_h__ 0011 0012 #include <QPoint> 0013 #include <Eigen/Core> 0014 #include <QVector2D> 0015 0016 0017 typedef Eigen::Matrix<qreal, 2, 1> KisVector2D; 0018 0019 inline KisVector2D toKisVector2D(const QPointF& p) 0020 { 0021 return KisVector2D(p.x(), p.y()); 0022 } 0023 inline KisVector2D toKisVector2D(const QPoint& p) 0024 { 0025 return KisVector2D(p.x(), p.y()); 0026 } 0027 0028 template<typename ExpressionType> 0029 inline QPointF toQPointF(const ExpressionType& expr) 0030 { 0031 return QPointF(expr.x(), expr.y()); 0032 } 0033 0034 #endif