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

VolumeTexture class represents a 3D dimentional image. More...

Public Member Functions

 VolumeTexture () Q_DECL_NOEXCEPT
 Constructs a null texture. More...
 
 VolumeTexture (const VolumeTexture &)
 Constructs a shallow copy of the given other texture.
 
 VolumeTexture (VolumeTexture &&) Q_DECL_NOEXCEPT
 Move-constructs a VolumeTexture instance, making it point at the same object that other was pointing to.
 
 VolumeTexture (int width, int height, int depth=1, QImage::Format format=QImage::Format_ARGB32)
 Constructs a texture with the given width, height, depth and format. More...
 
 VolumeTexture (const QVector< QImage > &slices)
 Constructs a texture from the given slices array of images. More...
 
 ~VolumeTexture () Q_DECL_NOEXCEPT
 Destroys the texture.
 
VolumeTextureoperator= (const VolumeTexture &)
 Assigns a shallow copy of the given other texture to this texture and returns a reference to this texture.
 
VolumeTextureoperator= (VolumeTexture &&) Q_DECL_NOEXCEPT
 Move-assigns other to this texture.
 
bool isNull () const Q_DECL_NOEXCEPT
 Returns true if it is a null texture, otherwise returns false. More...
 
int width () const Q_DECL_NOEXCEPT
 Returns the width of the texture.
 
int height () const Q_DECL_NOEXCEPT
 Returns the height of the texture.
 
int depth () const Q_DECL_NOEXCEPT
 Returns the depth of the texture.
 
QImage::Format format () const Q_DECL_NOEXCEPT
 Returns the format of the texture.
 
QRgb pixel (int x, int y, int z)
 Returns the color of the pixel at coordinates (x, y, z). More...
 
void setPixel (int x, int y, int z, uint index_or_rgb)
 Sets the pixel index or color at (x, y, x) to index_or_rgb.
 
void fill (uint value)
 Fills the entire image with the given value.
 
void fill (const QColor &color)
 Fills the entire texture with the given color.
 
void fill (Qt::GlobalColor color)
 Fills the texture with the given color, described as a standard global color.
 
QImage slice (int slice) const
 Returns the image containing data at the given index z coordinate.
 
void setSlice (int index, const QImage &image)
 Fills the data at the given index z coordinate from the image. More...
 
VolumeTexture convertToFormat (QImage::Format format, Qt::ImageConversionFlags flags=Qt::AutoColor) const
 Returns a copy of the texture in the given format. More...
 
VolumeTexture convertToFormat (QImage::Format format, const QVector< QRgb > &colorTable, Qt::ImageConversionFlags flags=Qt::AutoColor) const
 Returns a copy of the texture converted to the given format, using the specified colorTable.
 

Friends

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

Detailed Description

VolumeTexture class represents a 3D dimentional image.

Constructor & Destructor Documentation

◆ VolumeTexture() [1/3]

VolumeTexture::VolumeTexture ( )

Constructs a null texture.

See also
VolumeTexture::isNull()

◆ VolumeTexture() [2/3]

VolumeTexture::VolumeTexture ( int  width,
int  height,
int  depth = 1,
QImage::Format  format = QImage::Format_ARGB32 
)

Constructs a texture with the given width, height, depth and format.

A null texture will be created if parameters are not valid.

◆ VolumeTexture() [3/3]

VolumeTexture::VolumeTexture ( const QVector< QImage > &  slices)
explicit

Constructs a texture from the given slices array of images.

All images in the aray must have the same size and format, otherwise null texture is constructed. The width, height and format of the texture will be equal to the width and heigth of the images in the array. The depth of the texture will be equal to the size of the array.

Member Function Documentation

◆ convertToFormat()

VolumeTexture VolumeTexture::convertToFormat ( QImage::Format  format,
Qt::ImageConversionFlags  flags = Qt::AutoColor 
) const

Returns a copy of the texture in the given format.

The specified image conversion flags control how the texture data is handled during the conversion process.

◆ isNull()

bool VolumeTexture::isNull ( ) const

Returns true if it is a null texture, otherwise returns false.

A null texture has all parameters set to zero and no allocated data.

◆ pixel()

QRgb VolumeTexture::pixel ( int  x,
int  y,
int  z 
)

Returns the color of the pixel at coordinates (x, y, z).

See also
VolumeTexture::setPixel();

◆ setSlice()

void VolumeTexture::setSlice ( int  index,
const QImage &  image 
)

Fills the data at the given index z coordinate from the image.

Image must have same format, width and heigth as this texture.