summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorColin Ogilvie <colin.ogilvie@kdab.com>2016-05-23 14:26:11 +0100
committerSean Harmer <sean.harmer@kdab.com>2016-05-24 07:55:44 +0000
commitc5e245c7171745f6716d2125375d11d9bea15d25 (patch)
treecf767975146cad3f64c2906607f627ab72d85705 /src
parent490881b50c249f1055812730d3ed2c92b3173c8e (diff)
doc for qtextureimagedata
Task-number: QTBUG-46037 Change-Id: I5dd5616cd6ef3a01326cbc312a5d1809e60b74d2 Reviewed-by: Mike Krus <mike.krus@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/render/texture/qtextureimagedata.cpp59
1 files changed, 59 insertions, 0 deletions
diff --git a/src/render/texture/qtextureimagedata.cpp b/src/render/texture/qtextureimagedata.cpp
index ee080ee9f..36a2a3029 100644
--- a/src/render/texture/qtextureimagedata.cpp
+++ b/src/render/texture/qtextureimagedata.cpp
@@ -116,16 +116,28 @@ int QTextureImageDataPrivate::mipmapLevelSize(int level) const
return w * h * m_blockSize * d;
}
+/*!
+ \class Qt3DRender::QTextureImageData
+ \inmodule Qt3DRender
+ \since 5.5
+ \brief QTextureImageData stores data representing a texture.
+ */
+
+/*!
+ Constructs a new Qt3DRender::QTextureImageData.
+*/
QTextureImageData::QTextureImageData()
: d_ptr(new QTextureImageDataPrivate())
{
}
+/*! \internal */
QTextureImageData::QTextureImageData(QTextureImageDataPrivate &dd)
: d_ptr(&dd)
{
}
+/*! \internal */
QTextureImageData::~QTextureImageData()
{
cleanup();
@@ -139,6 +151,9 @@ QTextureImageData &QTextureImageData::operator=(const QTextureImageData &other)
return *this;
}
+/*!
+ Remove stored texture data and return the object to its initial state
+ */
void QTextureImageData::cleanup() Q_DECL_NOTHROW
{
Q_D(QTextureImageData);
@@ -153,42 +168,63 @@ void QTextureImageData::cleanup() Q_DECL_NOTHROW
d->m_data.clear();
}
+/*!
+ Returns true if the stored texture is in a compressed format
+ */
bool QTextureImageData::isCompressed() const Q_DECL_NOTHROW
{
Q_D(const QTextureImageData);
return d->m_isCompressed;
}
+/*!
+ Returns the width of the stored texture
+*/
int QTextureImageData::width() const Q_DECL_NOTHROW
{
Q_D(const QTextureImageData);
return d->m_width;
}
+/*!
+ Returns the height of the stored texture
+ */
int QTextureImageData::height() const Q_DECL_NOTHROW
{
Q_D(const QTextureImageData);
return d->m_height;
}
+/*!
+ Returns the depth of the stored texture
+ */
int QTextureImageData::depth() const Q_DECL_NOTHROW
{
Q_D(const QTextureImageData);
return d->m_depth;
}
+/*!
+ Returns the number of layers in the stored texture
+ */
int QTextureImageData::layers() const Q_DECL_NOTHROW
{
Q_D(const QTextureImageData);
return d->m_layers;
}
+/*!
+ Returns the number of mip levels in the stored texture
+ */
int QTextureImageData::mipLevels() const Q_DECL_NOTHROW
{
Q_D(const QTextureImageData);
return d->m_mipLevels;
}
+/*!
+ Returns the number of faces in the stored texture
+ */
int QTextureImageData::faces() const Q_DECL_NOTHROW
{
Q_D(const QTextureImageData);
@@ -231,12 +267,19 @@ void QTextureImageData::setFaces(int faces) Q_DECL_NOTHROW
d->m_faces = faces;
}
+
+/*!
+ Returns the target for the stored texture
+ */
QOpenGLTexture::Target QTextureImageData::target() const Q_DECL_NOTHROW
{
Q_D(const QTextureImageData);
return d->m_target;
}
+/*!
+ Returns the format of the stored texture
+ */
QOpenGLTexture::TextureFormat QTextureImageData::format() const Q_DECL_NOTHROW
{
Q_D(const QTextureImageData);
@@ -267,6 +310,10 @@ void QTextureImageData::setPixelType(QOpenGLTexture::PixelType pixelType) Q_DECL
d->m_pixelType = pixelType;
}
+
+/*!
+ Copies the image /a image as raw data within this object
+ */
void QTextureImageData::setImage(const QImage &image)
{
Q_D(QTextureImageData);
@@ -288,24 +335,36 @@ void QTextureImageData::setImage(const QImage &image)
d->m_target = QOpenGLTexture::Target2D;
}
+/*!
+ Store the data /a data with blocksize /a blocksize and if the data to be stored is compressed /a isCompressed
+ */
void QTextureImageData::setData(const QByteArray &data, int blockSize, bool isCompressed)
{
Q_D(QTextureImageData);
d->setData(data, blockSize, isCompressed);
}
+/*!
+ Returns the raw image data for the texture at layer /a layer, face /a face and mipmapLevel /a mipmapLevel
+ */
QByteArray QTextureImageData::data(int layer, int face, int mipmapLevel) const
{
Q_D(const QTextureImageData);
return d->data(layer, face, mipmapLevel);
}
+/*!
+ Returns the pixel format of the stored texture
+ */
QOpenGLTexture::PixelFormat QTextureImageData::pixelFormat() const Q_DECL_NOTHROW
{
Q_D(const QTextureImageData);
return d->m_pixelFormat;
}
+/*!
+ Returns the pixel type of the stored texture
+ */
QOpenGLTexture::PixelType QTextureImageData::pixelType() const Q_DECL_NOTHROW
{
Q_D(const QTextureImageData);