/***************************************************************************
** **
** QCustomPlot, an easy to use, modern plotting widget for Qt **
** Copyright (C) 2011, 2012, 2013, 2014 Emanuel Eichhammer **
** **
** This program is free software: you can redistribute it and/or modify **
** it under the terms of the GNU General Public License as published by **
** the Free Software Foundation, either version 3 of the License, or **
** (at your option) any later version. **
** **
** This program is distributed in the hope that it will be useful, **
** but WITHOUT ANY WARRANTY; without even the implied warranty of **
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the **
** GNU General Public License for more details. **
** **
** You should have received a copy of the GNU General Public License **
** along with this program. If not, see http://www.gnu.org/licenses/. **
** **
****************************************************************************
** Author: Emanuel Eichhammer **
** Website/Contact: http://www.qcustomplot.com/ **
** Date: 07.04.14 **
** Version: 1.2.1 **
****************************************************************************/
#include "qcustomplot.h"
////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////// QCPPainter
////////////////////////////////////////////////////////////////////////////////////////////////////
/*! \class QCPPainter
\brief QPainter subclass used internally
This QPainter subclass is used to provide some extended functionality e.g. for tweaking position
consistency between antialiased and non-antialiased painting. Further it provides workarounds
for QPainter quirks.
\warning This class intentionally hides non-virtual functions of QPainter, e.g. setPen, save and
restore. So while it is possible to pass a QCPPainter instance to a function that expects a
QPainter pointer, some of the workarounds and tweaks will be unavailable to the function (because
it will call the base class implementations of the functions actually hidden by QCPPainter).
*/
/*!
Creates a new QCPPainter instance and sets default values
*/
QCPPainter::QCPPainter() :
QPainter(),
mModes(pmDefault),
mIsAntialiasing(false)
{
// don't setRenderHint(QPainter::NonCosmeticDefautPen) here, because painter isn't active yet and
// a call to begin() will follow
}
/*!
Creates a new QCPPainter instance on the specified paint \a device and sets default values. Just
like the analogous QPainter constructor, begins painting on \a device immediately.
Like \ref begin, this method sets QPainter::NonCosmeticDefaultPen in Qt versions before Qt5.
*/
QCPPainter::QCPPainter(QPaintDevice *device) :
QPainter(device),
mModes(pmDefault),
mIsAntialiasing(false)
{
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) // before Qt5, default pens used to be cosmetic if NonCosmeticDefaultPen flag isn't set. So we set it to get consistency across Qt versions.
if (isActive())
setRenderHint(QPainter::NonCosmeticDefaultPen);
#endif
}
QCPPainter::~QCPPainter()
{
}
/*!
Sets the pen of the painter and applies certain fixes to it, depending on the mode of this
QCPPainter.
\note this function hides the non-virtual base class implementation.
*/
void QCPPainter::setPen(const QPen &pen)
{
QPainter::setPen(pen);
if (mModes.testFlag(pmNonCosmetic))
makeNonCosmetic();
}
/*! \overload
Sets the pen (by color) of the painter and applies certain fixes to it, depending on the mode of
this QCPPainter.
\note this function hides the non-virtual base class implementation.
*/
void QCPPainter::setPen(const QColor &color)
{
QPainter::setPen(color);
if (mModes.testFlag(pmNonCosmetic))
makeNonCosmetic();
}
/*! \overload
Sets the pen (by style) of the painter and applies certain fixes to it, depending on the mode of
this QCPPainter.
\note this function hides the non-virtual base class implementation.
*/
void QCPPainter::setPen(Qt::PenStyle penStyle)
{
QPainter::setPen(penStyle);
if (mModes.testFlag(pmNonCosmetic))
makeNonCosmetic();
}
/*! \overload
Works around a Qt bug introduced with Qt 4.8 which makes drawing QLineF unpredictable when
antialiasing is disabled. Thus when antialiasing is disabled, it rounds the \a line to
integer coordinates and then passes it to the original drawLine.
\note this function hides the non-virtual base class implementation.
*/
void QCPPainter::drawLine(const QLineF &line)
{
if (mIsAntialiasing || mModes.testFlag(pmVectorized))
QPainter::drawLine(line);
else
QPainter::drawLine(line.toLine());
}
/*!
Sets whether painting uses antialiasing or not. Use this method instead of using setRenderHint
with QPainter::Antialiasing directly, as it allows QCPPainter to regain pixel exactness between
antialiased and non-antialiased painting (Since Qt < 5.0 uses slightly different coordinate systems for
AA/Non-AA painting).
*/
void QCPPainter::setAntialiasing(bool enabled)
{
setRenderHint(QPainter::Antialiasing, enabled);
if (mIsAntialiasing != enabled)
{
mIsAntialiasing = enabled;
if (!mModes.testFlag(pmVectorized)) // antialiasing half-pixel shift only needed for rasterized outputs
{
if (mIsAntialiasing)
translate(0.5, 0.5);
else
translate(-0.5, -0.5);
}
}
}
/*!
Sets the mode of the painter. This controls whether the painter shall adjust its
fixes/workarounds optimized for certain output devices.
*/
void QCPPainter::setModes(QCPPainter::PainterModes modes)
{
mModes = modes;
}
/*!
Sets the QPainter::NonCosmeticDefaultPen in Qt versions before Qt5 after beginning painting on \a
device. This is necessary to get cosmetic pen consistency across Qt versions, because since Qt5,
all pens are non-cosmetic by default, and in Qt4 this render hint must be set to get that
behaviour.
The Constructor \ref QCPPainter(QPaintDevice *device) which directly starts painting also sets
the render hint as appropriate.
\note this function hides the non-virtual base class implementation.
*/
bool QCPPainter::begin(QPaintDevice *device)
{
bool result = QPainter::begin(device);
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) // before Qt5, default pens used to be cosmetic if NonCosmeticDefaultPen flag isn't set. So we set it to get consistency across Qt versions.
if (result)
setRenderHint(QPainter::NonCosmeticDefaultPen);
#endif
return result;
}
/*! \overload
Sets the mode of the painter. This controls whether the painter shall adjust its
fixes/workarounds optimized for certain output devices.
*/
void QCPPainter::setMode(QCPPainter::PainterMode mode, bool enabled)
{
if (!enabled && mModes.testFlag(mode))
mModes &= ~mode;
else if (enabled && !mModes.testFlag(mode))
mModes |= mode;
}
/*!
Saves the painter (see QPainter::save). Since QCPPainter adds some new internal state to
QPainter, the save/restore functions are reimplemented to also save/restore those members.
\note this function hides the non-virtual base class implementation.
\see restore
*/
void QCPPainter::save()
{
mAntialiasingStack.push(mIsAntialiasing);
QPainter::save();
}
/*!
Restores the painter (see QPainter::restore). Since QCPPainter adds some new int
没有合适的资源?快使用搜索试试~ 我知道了~
基于Qt和Opencv的图像处理软件.zip
共168个文件
png:53个
cpp:39个
h:39个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 199 浏览量
2023-07-08
13:48:00
上传
评论
收藏 1.31MB ZIP 举报
温馨提示
基于QT的系统 语言:C++/C
资源推荐
资源详情
资源评论
收起资源包目录
基于Qt和Opencv的图像处理软件.zip (168个子文件)
GraphicsProc.pro.user.54ce2fb 18KB
qcustomplot.cpp 748KB
Effect.cpp 39KB
spline.cpp 27KB
Picture.cpp 20KB
filter.cpp 19KB
mainwindow.cpp 19KB
ColorLevels.cpp 10KB
CurveEditor.cpp 9KB
graphicsview.cpp 8KB
LayerMerge.cpp 6KB
Commands.cpp 5KB
ColorBalance.cpp 4KB
TransRotateZoom.cpp 3KB
ColorCurve.cpp 3KB
Perspective.cpp 3KB
RecentOpened.cpp 3KB
ToolLayerManager.cpp 3KB
ToolLayerAttribute.cpp 3KB
toolhistogram.cpp 3KB
ColorHueSaturation.cpp 2KB
pixmapitem.cpp 2KB
StatusBar.cpp 2KB
FilterRadialBlur.cpp 2KB
FilterZoomBlur.cpp 2KB
Layer.cpp 2KB
FilterGaussianBlur.cpp 2KB
FilterMosaic.cpp 2KB
ColorThreshold.cpp 2KB
FilterEmboss.cpp 2KB
FilterUnsharpMask.cpp 2KB
utils.cpp 2KB
FilterMotionBlur.cpp 1KB
ColorColorize.cpp 1KB
ColorBrightnessContrast.cpp 1KB
FilterSurfaceBlur.cpp 1KB
FilterRedEyeRemoval.cpp 1KB
ColorPosterize.cpp 959B
UndoHistory.cpp 784B
main.cpp 172B
qcustomplot.h 135KB
Picture.h 4KB
mainwindow.h 3KB
effect.h 3KB
Commands.h 3KB
LayerMerge.h 2KB
Types.h 2KB
filter.h 2KB
ColorLevels.h 2KB
TransRotateZoom.h 1KB
graphicsview.h 1KB
ColorBalance.h 1KB
ColorHueSaturation.h 1KB
spline.h 1KB
curveeditor.h 1KB
utils.h 1KB
StatusBar.h 940B
FilterRadialBlur.h 940B
FilterZoomBlur.h 919B
ToolLayerManager.h 913B
ToolLayerAttribute.h 869B
Layer.h 847B
FilterEmboss.h 821B
pixmapitem.h 816B
ColorCurve.h 804B
FilterUnsharpMask.h 765B
FilterMotionBlur.h 744B
ColorThreshold.h 707B
ColorBrightnessContrast.h 705B
FilterGaussianBlur.h 703B
Perspective.h 702B
FilterSurfaceBlur.h 700B
ColorColorize.h 686B
FilterMosaic.h 654B
toolhistogram.h 638B
FilterRedEyeRemoval.h 613B
UndoHistory.h 529B
recentopened.h 471B
ColorPosterize.h 448B
Uuid.Lib 4.6MB
Gdi32.Lib 158KB
Ole32.Lib 87KB
OleAut32.Lib 83KB
Vfw32.Lib 31KB
ComCtl32.Lib 30KB
tex_canvas.png 14KB
undo-history-undo.png 2KB
undo-history-redo.png 2KB
layer-remove.png 2KB
layer-attribute.png 2KB
layer-down.png 2KB
layer-merge.png 2KB
layer-up.png 2KB
stock-start-save-as.png 2KB
stock-tool-browse.png 2KB
stock-start-exit.png 2KB
stock-start-open.png 1KB
stock-start-save.png 1KB
layer-copy.png 1KB
stock-edit-undo.png 1KB
共 168 条
- 1
- 2
资源评论
我慢慢地也过来了
- 粉丝: 5925
- 资源: 3787
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 青岛大学人工智能实验二 利用α-β搜索的博弈树算法编写一字棋游戏
- ### 1、项目介绍 本项目Scrapy进行数据爬取,并使用Django框架+PyEcharts实现可视化大屏 效果如下:
- # 微信小程序-健康菜谱 基于微信小程序的一个查找检索菜谱的应用 ### 效果 !动态图(./res/gif/demo
- zabbix-get命令包资源
- 289ssm-mysql-jsp 计算机课程实验管理系统.zip(可运行源码+数据库文件+文档)
- 毕业设计,基于PyQt5实现的可视化界面的Python车牌自动识别系统源码
- 20-天天果园项目.rar
- 26-朴素贝叶斯分类.rar
- 没有安Matlab 也可以 生成FIR抽头系数工具.py
- 自助购药小程序源代码含文档
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功