Image Formats NG
Public Member Functions | Friends | List of all members
ImageContents Class Reference

This class represents data contained in an image file. More...

Public Member Functions

 ImageContents () Q_DECL_NOEXCEPT
 Constructs a null ImageContents.
 
 ImageContents (const QImage &image)
 Constructs an ImageContents from the given image. More...
 
 ImageContents (const QVector< CubeTexture > &frames)
 Constructs an ImageContents from the given frames array of CubeTextures. More...
 
 ImageContents (const QVector< VolumeTexture > &frames)
 Constructs an ImageContents from the given frames array of VolumeTextures. More...
 
 ImageContents (const ImageHeader &header)
 Constructs an ImageContents with the given header.
 
 ImageContents (const ImageContents &other)
 Constructs a shallow copy of the given other contents.
 
 ImageContents (ImageContents &&other) Q_DECL_NOEXCEPT
 Move-constructs an ImageContents instance, making it point at the same object that other was pointing to.
 
 ~ImageContents ()
 Destroys the ImageContents object.
 
ImageContentsoperator= (const ImageContents &other)
 Assigns a shallow copy of the other contents to this contents and returns a reference to this contents.
 
ImageContentsoperator= (ImageContents &&other) Q_DECL_NOEXCEPT
 Move-assigns other to this ImageContents instance.
 
bool isNull () const Q_DECL_NOEXCEPT
 Returns true if it is a null contents, otherwise returns false.
 
ImageHeader header () const
 This property holds the header of the contents.
 
ImageResource resource (int index=0, int level=0) const
 Returns the resource located at the given index and level.
 
void setResource (const ImageResource &resource, int index=0, int level=0)
 Assigns the resource located at the given index and level to the given resource.
 
ImageExifMeta exifMeta () const
 This property holds exif meta information.
 
void clear ()
 Makes this contents null.
 

Friends

bool IMAGEFORMATSNG_EXPORT operator== (const ImageContents &lhs, const ImageContents &rhs)
 Returns true if lhs contents and the given rhs contents have the same data; otherwise returns false.
 
bool IMAGEFORMATSNG_EXPORT operator!= (const ImageContents &lhs, const ImageContents &rhs)
 Returns true if lhs contents and the given rhs contents have different data; otherwise returns false.
 

Detailed Description

This class represents data contained in an image file.

It consists of the ImageContents::header, 2D array of ImageResources and ImageContents::exifMeta.

Constructor & Destructor Documentation

◆ ImageContents() [1/3]

ImageContents::ImageContents ( const QImage &  image)
explicit

Constructs an ImageContents from the given image.

Fills the header and the data with the image.

◆ ImageContents() [2/3]

ImageContents::ImageContents ( const QVector< CubeTexture > &  frames)
explicit

Constructs an ImageContents from the given frames array of CubeTextures.

The header is filled with the data from the array. Each element in the array must have the same size and format, otherwise an invalid contents is contructed.

◆ ImageContents() [3/3]

ImageContents::ImageContents ( const QVector< VolumeTexture > &  frames)
explicit

Constructs an ImageContents from the given frames array of VolumeTextures.

The header is filled with the data from the array. Each element in the array must have the same width, heigth, depth and format, otherwise an invalid contents is contructed.