Image Formats NG
|
CubeTexture class represents a 6 sided cubic texture. More...
Public Types | |
enum | Side { Side::PositiveX, Side::NegativeX, Side::PositiveY, Side::NegativeY, Side::PositiveZ, Side::NegativeZ } |
This enum describes possible sides of the cube. More... | |
enum | Projection { Projection::HorizonalCross, Projection::VerticalCross } |
This enum describes possible projections. More... | |
Public Member Functions | |
CubeTexture () Q_DECL_NOEXCEPT | |
Constructs a null texture. More... | |
CubeTexture (const CubeTexture &other) | |
Constructs a shallow copy of the given other texture. | |
CubeTexture (CubeTexture &&other) | |
Move-constructs a CubeTexture instance, making it point at the same object that other was pointing to. | |
CubeTexture (int extent, QImage::Format format=QImage::Format_ARGB32) | |
Constructs a texture with the given extent and format. More... | |
~CubeTexture () | |
Destroys the texture. | |
CubeTexture & | operator= (const CubeTexture &other) |
Assigns a shallow copy of the given other texture to this texture and returns a reference to this texture. | |
CubeTexture & | operator= (CubeTexture &&other) |
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. | |
QImage | side (Side side) const |
Returns the image containing data of the given side of the cube. | |
void | setSide (Side side, const QImage &image) |
Fills the data of the given side of the cube from the image. More... | |
CubeTexture | scaled (int width) |
Returns a copy of the texture scaled to a given extent. | |
QImage | toProjection (Projection projection) const |
Converts this texture to a plain image with all sides placed on it. More... | |
Friends | |
bool IMAGEFORMATSNG_EXPORT | operator== (const CubeTexture &lhs, const CubeTexture &rhs) |
Returns true if the lhs texture and the rhs texture have the same contents; otherwise returns false. | |
bool IMAGEFORMATSNG_EXPORT | operator!= (const CubeTexture &lhs, const CubeTexture &rhs) |
Returns true if the lhs texture and the rhs texture have different contents; otherwise returns false. | |
CubeTexture class represents a 6 sided cubic texture.
|
strong |
|
strong |
CubeTexture::CubeTexture | ( | ) |
Constructs a null texture.
CubeTexture::CubeTexture | ( | int | extent, |
QImage::Format | format = QImage::Format_ARGB32 |
||
) |
Constructs a texture with the given extent and format.
Extent is the legth of the side of the cube, i.e. is width = height = depth = extent. A null texture is created if parameters are not valid.
bool CubeTexture::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.
void CubeTexture::setSide | ( | CubeTexture::Side | side, |
const QImage & | image | ||
) |
Fills the data of the given side of the cube from the image.
Image must have same format, width and heigth as this texture.
QImage CubeTexture::toProjection | ( | CubeTexture::Projection | projection | ) | const |
Converts this texture to a plain image with all sides placed on it.
How side are placed is determined by projection parameter.