File indexing completed on 2024-05-05 12:00:09
0001 /* 0002 SPDX-FileCopyrightText: 2015-2017 Pavel Mraz 0003 0004 SPDX-FileCopyrightText: 2017 Jasem Mutlaq 0005 0006 SPDX-License-Identifier: GPL-2.0-or-later 0007 */ 0008 0009 #pragma once 0010 0011 #include <QImage> 0012 #include <QColor> 0013 #include <QPointF> 0014 0015 #define MAX_BK_SCANLINES 32000 0016 0017 typedef struct 0018 { 0019 int scan[2]; 0020 float uv[2][2]; 0021 } bkScan_t; 0022 0023 0024 class ScanRender 0025 { 0026 public: 0027 explicit ScanRender(void); 0028 void setBilinearInterpolationEnabled(bool enable); 0029 bool isBilinearInterpolationEnabled(void); 0030 void resetScanPoly(int sx, int sy); 0031 void scanLine(int x1, int y1, int x2, int y2); 0032 void scanLine(int x1, int y1, int x2, int y2, float u1, float v1, float u2, float v2); 0033 void renderPolygon(QColor col, QImage *dst); 0034 void renderPolygon(QImage *dst, QImage *src); 0035 void renderPolygon(int interpolation, QPointF *pts, QImage *pDest, QImage *pSrc, QPointF *uv); 0036 0037 void renderPolygonNI(QImage *dst, QImage *src); 0038 void renderPolygonBI(QImage *dst, QImage *src); 0039 0040 void renderPolygonAlpha(QImage *dst, QImage *src); 0041 void renderPolygonAlphaBI(QImage *dst, QImage *src); 0042 void renderPolygonAlphaNI(QImage *dst, QImage *src); 0043 0044 void renderPolygonAlpha(QColor col, QImage *dst); 0045 void setOpacity(float opacity); 0046 0047 private: 0048 float m_opacity { 1.0f }; 0049 int plMinY { 0 }; 0050 int plMaxY { 0 }; 0051 int m_sx { 0 }; 0052 int m_sy { 0 }; 0053 bkScan_t scLR[MAX_BK_SCANLINES]; 0054 bool bBilinear { false }; 0055 };