QImage官方文档翻译

QImage类学习

Qt provides four classes for handling image data: QImage, QPixmap, QBitmap and QPicture.

Qt提供了4个类来处理图像数据:QImage,QPixmap,QBitmap和

QPicture.

QImage is designed and optimized for I/O, and for direct pixel access and manipulation, while QPixmap is designed and optimized for showing images on screen.

QImage被设计和利用于I/O,用于直接进行像素获取和操作,而

QPixmap被设计和用于在屏幕上显示图片。

QBitmap is only a convenience class that inherits QPixmap, ensuring a depth of 1.

QBitmap只是一个继承了QPixmap的工具类,保证深度为1。

什么是图像的深度?

图像的深度 depth_图像深度_yleavesw的博客-CSDN博客

存储每个像素所用的位数。

图像深度是单个像素点的色彩详细度,如16位,32位等。

一幅彩色图像RGB 3个颜色的像素位数分别为4,4,2,

则最大颜色数目为2的(4+4+2)次方,即1024,像素深度为10位,

每个像素可以是1024种颜色中的一种。

Finally, the QPicture class is a paint device that records and replays QPainter commands.

最后,QPicture类是一个记录和重现QPainter命令的绘图设备。

Because QImage is a QPaintDevice subclass, QPainter can be used to draw directly onto images.

因为QImage是QPaintDevice的一个子类,QPainter能被直接用来进行绘画在图片(QImage对象)上。

When using QPainter on a QImage, the painting can be performed in another thread than the current GUI thread.

当使用QPainter在一个QImage上时,绘画会被执行在另一个线程而不是当前的GUI线程。

The QImage class supports several image formats described by the Format enum.

QImage类支持一些通过Format枚举描述的图像格式。

These include monochrome, 8-bit, 32-bit and alpha-blended images which are available in all versions of Qt 4.x.

这些包括黑白照片,8位,32位和透明混合处理图像,可以在所以Qt4版本中使用。

QImage provides a collection of functions that can be used to obtain a variety of information about the image.

QImage提供了一堆能用来获取一系列图像信息的函数。

There are also several functions that enables transformation of the image.

这里也有一些使图像的变化的函数。

QImage objects can be passed around by value since the QImage class uses implicit data sharing.

Qimage对象能通过值传递,因为QImage类使用隐式数据共享。

QImage objects can also be streamed and compared.

QImage对象也可以流式传输和比较。

Note: If you would like to load QImage objects in a static build of Qt, refer to the Plugin HowTo.

注意:如果你想用Qt的静态构建载入一个QImage对象,参考Plugin HowTo.

Warning: Painting on a QImage with the format QImage::Format_Indexed8 is not supported.

警告:用QImage::Format Indexed8 在QImage上绘画是不被支持的。

Reading and Writing Image Files

读和写图像文件

QImage provides several ways of loading an image file: The file can be loaded when constructing the QImage object, or by using the load() or loadFromData() functions later on.

QImage提供了一些加载一个图像文件的方法:

当构造QImage对象,或使用load()函数,或在之后使用loadFromData()时,文件被载入。

QImage also provides the static fromData() function, constructing a QImage from the given data.

QImage也提供了静态函数fromData()来构造一个QImage对象从被给予的数据中。

When loading an image, the file name can either refer to an actual file on disk or to one of the application's embedded resources.

当加载图像时,文件名要么指的是磁盘上的实际文件,要么指的是应用程序的被嵌入的资源之一。

See The Qt Resource System overview for details on how to embed images and other resource files in the application's executable.

看Qt资源系统综述来了解详情,关于如何嵌入图像和其他资源文件在应用程序的可执行文件中。

Simply call the save() function to save a QImage object.

简单调用save()函数来保存一个QImage对象。

The complete list of supported file formats are available through the QImageReader::supportedImageFormats() and QImageWriter::supportedImageFormats() functions.

完整的支持的文件格式列表可以通过

QImageReader::supportedImageFormats()

和QImageWriter::supportedImageFormats()函数来获取。

New file formats can be added as plugins. By default, Qt supports the following formats:

新文件格式可以被添加为插件。默认地,Qt支持下面的格式:

Format

Description

Qt's support

BMP

Windows Bitmap(位图)

Read/write

GIF

Graphic Interchange Format (optional)

(可选择的)

Read

JPG

Joint Photographic Experts Group

Read/write

JPEG

Joint Photographic Experts Group

Read/write

PNG

Portable Network Graphics

Read/write

PBM

Portable Bitmap

Read

PGM

Portable Graymap

Read

PPM

Portable Pixmap

Read/write

XBM

X11 Bitmap

Read/write

XPM

X11 Pixmap

Read/write

Image Information

图像信息

QImage provides a collection of functions that can be used to obtain a variety of information about the image:

QImage提供了一堆能用来获取大量关于图像信息的函数:

 未翻译完,太多了。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/12073.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

基于ssm+mysql+html道路养护管理系统

基于ssmmysqlhtml道路养护管理系统 一、系统介绍二、功能展示1.道路信息管理2.损害类型信息管理3.损害类型信息管理4.评定等级信息管理5.日常巡查信息管理6.定期检查信息管理 四、获取源码 一、系统介绍 系统主要功能:道路信息管理、损害类型信息管理、评定等级信息…

js常用的几种排序方式

在JavaScript中,有多种排序方式可供选择。以下是几种常见的排序方式以及对应的示例: 冒泡排序(Bubble Sort): 冒泡排序是一种比较简单的排序算法,它重复地比较相邻的两个元素并交换位置,直到整个…

一个月学通Python(二十五):使用缓存(Web开发)

专栏介绍 结合自身经验和内部资料总结的Python教程,每天3-5章,最短1个月就能全方位的完成Python的学习并进行实战开发,学完了定能成为大佬!加油吧!卷起来! 全部文章请访问专栏:《Python全栈教程(0基础)》 文章目录 专栏介绍使用缓存Django项目接入Redis为视图提供缓…

【网络原理】 (1) (应用层 传输层 UDP协议 TCP协议 TCP协议段格式 TCP内部工作机制 确认应答 超时重传 连接管理)

文章目录 应用层传输层UDP协议TCP协议TCP协议段格式TCP内部工作机制确认应答超时重传 网络原理部分我们主要学习TCP/IP协议栈这里的关键协议(TCP 和 IP),按照四层分别介绍.(物理层,我们不涉及). 应用层 我们需要学会自定义一个应用层协议. 自定义协议的原因? 当前的软件(应用…

【JAVASE】顺序和选择结构

⭐ 作者:小胡_不糊涂 🌱 作者主页:小胡_不糊涂的个人主页 📀 收录专栏:浅谈Java 💖 持续更文,关注博主少走弯路,谢谢大家支持 💖 顺序和选择 1. 顺序结构2. 分支结构2.1 …

Ubuntu18.04 下配置Clion

配置Clion 安装gcc、g、make Ubuntu中用到的编译工具是gcc©,g(C),make(连接)。因此只需安装对应的工具包即可。Ubuntu下使用命令安装这些包: (1)安装gcc sudo apt install gcc&am…

关于electron的问题汇总

1. electron-builder打包慢出错的问题 由于网络原因,在进行builder打包时,可能会等很长时间,直到最后还是以失败告终。 如果是第一次进行builder打包,会去下载winCodeSign、nsis、nsis-resources,往往都是第一个就卡住…

解决Cannot resolve plugin org.apache.maven.plugins:xxxxxxxx

解决Cannot resolve plugin org.apache.maven.plugins:xxxxxxxx 方法一、检查配置设置 下图中三个方框圈出来的地方设置为自己的下载的maven地址,配置文件地址,仓库地址。刷新maven。 我个人试过没用,不过网上有的朋友用这个方法解决了。 …

Day 69-70:矩阵分解

代码: package dl;import java.io.*; import java.util.Random;/** Matrix factorization for recommender systems.*/public class MatrixFactorization {/*** Used to generate random numbers.*/Random rand new Random();/*** Number of users.*/int numUsers…

FANUC机器人实现2个RO输出信号互锁关联(互补)的具体方法

FANUC机器人实现2个RO输出信号互锁关联(互补)的具体方法 一般情况下,为了方便用户控制工装夹具上的电磁阀等控制工具,FANUC机器人出厂时给我们提供了8个RO输出信号,如下图所示,这8个RO信号可以各自单独使用。 那么,如果为了安全控制,需要将2个RO信号成对的进行安全互锁…

linux服务器安装redis

一、安装下载 下载安装参考文章 下载安装包地址:https://download.redis.io/releases/ 亲测有效,但是启动的步骤有一些问题 安装完成!!! 二、启动 有三种启动方式 默认启动指定配置启动开机自启 说明&#xff1a…

下载JMeter的历史版本——个人推荐5.2.1版本

官网地址:https://archive.apache.org/dist/jmeter/binaries/

JVM-提问纯享版

一、内存区域 介绍下 Java 内存区域(运行时数据区)内存分配方式内存分配并发问题对象的访问定位的两种方式(句柄和直接指针两种方式) 二、垃圾回收 如何判断对象是否死亡(两种方法)。简单的介绍一下强引…

POI 导出 树形结构

参考文章:(327条消息) Excel树状数据绘制导出_excel导出树形结构_Deja-vu xxl的博客-CSDN博客https://blog.csdn.net/weixin_45873182/article/details/120132409?spm1001.2014.3001.5502 Overridepublic void exportPlus(String yearMonth, HttpServletRequest re…

Lua语法学习

Lua 文章目录 Lua变量数据类型nilbooleanstringtable 循环if函数运算符Table -- Events local StateEvents ReplicatedStorage:WaitForChild("StateEvents"); local AddMoneyEvent StateEvents:WaitForChild("AddMoneyEvent");AddMoneyEvent:FireServer(…

【C语言】从零开始学习数组

🍁 博客主页:江池俊的博客 💫收录专栏:C语言——探索高效编程的基石 💻 其他专栏:数据结构探索 💡代码仓库:江池俊的代码仓库 🎪 社区:C/C之家社区 🍁 如果觉…

【C++ 进阶】学习导论:C/C++ 进阶学习路线、大纲与目标

目录 一、C 学习路线 二、C 课程大纲与学习目标 (1)第一阶段:C 语言基础 (2)第二阶段:C 高级编程 (3)第三阶段:C 核心编程与桌面应用开发 (4&#xf…

tiny-cuda-nn安装踩坑记录

首先要把这个repo clone过来 git clone https://github.com/NVlabs/tiny-cuda-nn.git --recursive 一定别忘这个recursive 然后安装https://github.com/NVlabs/tiny-cuda-nn/时cmake说cuda版本不对。 – Obtained CUDA architectures automatically from installed GPUs CMake…

网络安全领域关键信息泄露事件引发关注

近日,一家知名网络安全公司发布了一份报告揭露了一起重大信息泄露事件。据称,该事件涉及大量敏感用户数据的泄露引发了全球网络安全领域的广泛关注。 根据报道,该事件发生在全球范围内涉及多个国家和组织。专家指出,此次泄露事件…

Go | context

Go | context ChatGPT辅助编写 1. 简介 Go语言的context包是用于在并发编程中传递请求作用域的工具。它解决了在多个goroutine之间传递请求相关数据、控制请求超时、取消请求等问题。 2. 核心接口 Go语言中context包的核心接口是context.Context。它定义了用于传递请求作用域…