返回介绍

QImageFormatType Class

发布于 2019-10-04 15:00:48 字数 2491 浏览 1002 评论 0 收藏 0

The QImageFormatType class is a factory that makes QImageFormat objects. More...

#include <qasyncimageio.h>

List of all member functions.

Public Members

  • virtual ~QImageFormatType ()
  • virtual QImageFormat * decoderFor ( constuchar*buffer, intlength ) = 0
  • virtual const char * formatName () const = 0

Protected Members

  • QImageFormatType ()

Detailed Description

The QImageFormatType class is a factory that makes QImageFormat objects.

Whereas the QImageIO class allows for complete loading of images, QImageFormatType allows for incremental loading of images.

New image file formats are installed by creating objects of derived classes of QImageFormatType. They must implement decoderFor() and formatName().

QImageFormatType is a very simple class. Its only task is to recognize image data in some format and make a new object, subclassed from QImageFormat, which can decode that format.

The factories for formats built into Qt are automatically defined before any other factory is initialized. If two factories would recognize an image format, the factory created last will override the earlier one; you can thus override current and future built-in formats.

See also Graphics Classes, Image Processing Classes and Multimedia Classes.


Member Function Documentation

QImageFormatType::QImageFormatType () [protected]

Constructs a factory. It automatically registers itself with QImageDecoder.

QImageFormatType::~QImageFormatType () [virtual]

Destroys a factory. It automatically unregisters itself from QImageDecoder.

QImageFormat* QImageFormatType::decoderFor ( constuchar*buffer, intlength ) [pure virtual]

Returns a decoder for decoding an image that starts with the bytes in buffer. The length of the data is given in length. This function should only return a decoder if it is certain that the decoder applies to data with the given header. Returns 0 if there is insufficient data in the header to make a positive identification or if the data is not recognized.

const char * QImageFormatType::formatName () const [pure virtual]

Returns the name of the format supported by decoders from this factory. The string is statically allocated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文