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

ImageHeader class contains common properties for all images. More...

Public Member Functions

 ImageHeader ()
 Constructs a null header.
 
 ImageHeader (const ImageHeader &)
 Constructs a shallow copy of the given other header.
 
 ImageHeader (ImageHeader &&)
 Move-constructs a ImageHeader instance, making it point at the same object that other was pointing to.
 
 ~ImageHeader ()
 Destroys the ImageHeader object.
 
ImageHeaderoperator= (const ImageHeader &)
 Assigns a shallow copy of the other header to this header and returns a reference to this header.
 
ImageHeaderoperator= (ImageHeader &&)
 Move-assigns other to this ImageHeader instance.
 
bool validate (QString *error=nullptr) const
 This method checks that parameters passed to the header are valid. More...
 

Properties

bool isNull
 Returns true if all fields have default values.
 
ImageResource::Type type
 This property holds the type of an image. More...
 
QImage::Format imageFormat
 This property holds the format of an image.
 
QSize size
 This property holds the size of an image. More...
 
int width
 This property holds the width of an image. More...
 
int height
 This property holds the width of an image. More...
 
int depth
 This property holds the width of an image. More...
 
QString name
 This property holds the name of an image. More...
 
int imageCount
 This property holds the count of images in the ImageContents object. More...
 
bool hasMipmaps
 This property holds whether ImageContents object has mipmaps or not. More...
 
int mipmapCount
 This property holds the number of mipmaps in the ImageContents object. More...
 
int frameDelay
 This property holds the delay (in milliseconds) between frames of the animation.
 
int loopCount
 This property holds the animation's loop count or -1 in case of infinite loop count.
 

Friends

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

Detailed Description

ImageHeader class contains common properties for all images.

Member Function Documentation

◆ validate()

bool ImageHeader::validate ( QString *  error = nullptr) const

This method checks that parameters passed to the header are valid.

The message describing what's wrong is written to the given error variable.

Property Documentation

◆ depth

int ImageHeader::depth
readwrite

This property holds the width of an image.

See also
ImageHeader::width, ImageHeader::height, ImageHeader::size

◆ hasMipmaps

bool ImageHeader::hasMipmaps
readwrite

This property holds whether ImageContents object has mipmaps or not.

Mipmaps are the series of images, each image 2 times smaller than the previous. For example: 8x8, 4x4, 2x2, 1x1.

See also
ImageHeader::mipmapCount

◆ height

int ImageHeader::height
readwrite

This property holds the width of an image.

See also
ImageHeader::width, ImageHeader::depth, ImageHeader::size

◆ imageCount

int ImageHeader::imageCount
readwrite

This property holds the count of images in the ImageContents object.

This property is used to represent number of frames or elements in image array.

◆ mipmapCount

int ImageHeader::mipmapCount
read

This property holds the number of mipmaps in the ImageContents object.

If ImageHeader::hasMipmaps property is true, this property holds 1, otherwise it hols the number calculated as log2(max(width, height, depth)) + 1.

◆ name

QString ImageHeader::name
readwrite

This property holds the name of an image.

In case if image format does not support name, name will be lost when saving ImageContents.

◆ size

QSize ImageHeader::size
readwrite

This property holds the size of an image.

Note
Depth property is ignored when returning image size.
See also
ImageHeader::width, ImageHeader::depth, ImageHeader::depth

◆ type

ImageResource::Type ImageHeader::type
readwrite

This property holds the type of an image.

Possible types are image, cube texture or volume texture.

◆ width

int ImageHeader::width
readwrite

This property holds the width of an image.

See also
ImageHeader::height, ImageHeader::depth, ImageHeader::size