Kstars

scanrender.h
1/*
2 SPDX-FileCopyrightText: 2015-2017 Pavel Mraz
3
4 SPDX-FileCopyrightText: 2017 Jasem Mutlaq
5
6 SPDX-License-Identifier: GPL-2.0-or-later
7*/
8
9#pragma once
10
11#include <QImage>
12#include <QColor>
13#include <QPointF>
14
15#define MAX_BK_SCANLINES 32000
16
17typedef struct
18{
19 int scan[2];
20 float uv[2][2];
21} bkScan_t;
22
23
24class ScanRender
25{
26 public:
27 explicit ScanRender(void);
28 void setBilinearInterpolationEnabled(bool enable);
29 bool isBilinearInterpolationEnabled(void);
30 void resetScanPoly(int sx, int sy);
31 void scanLine(int x1, int y1, int x2, int y2);
32 void scanLine(int x1, int y1, int x2, int y2, float u1, float v1, float u2, float v2);
33 void renderPolygon(QColor col, QImage *dst);
34 void renderPolygon(QImage *dst, QImage *src);
35 void renderPolygon(int interpolation, QPointF *pts, QImage *pDest, QImage *pSrc, QPointF *uv);
36
37 void renderPolygonNI(QImage *dst, QImage *src);
38 void renderPolygonBI(QImage *dst, QImage *src);
39
40 void renderPolygonAlpha(QImage *dst, QImage *src);
41 void renderPolygonAlphaBI(QImage *dst, QImage *src);
42 void renderPolygonAlphaNI(QImage *dst, QImage *src);
43
44 void renderPolygonAlpha(QColor col, QImage *dst);
45 void setOpacity(float opacity);
46
47private:
48 float m_opacity { 1.0f };
49 int plMinY { 0 };
50 int plMaxY { 0 };
51 int m_sx { 0 };
52 int m_sy { 0 };
53 bkScan_t scLR[MAX_BK_SCANLINES];
54 bool bBilinear { false };
55};
PRISONSCANNER_EXPORT ScanResult scan(const QImage &image, Format::BarcodeFormats formats={})
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:16:41 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.