m_size = size;
}
-int ApiSurface::numChannels() const
-{
- return m_numChannels;
-}
-
-void ApiSurface::setNumChannels(int numChannels)
-{
- m_numChannels = numChannels;
-}
-
void ApiSurface::contentsFromBase64(const QByteArray &base64)
{
QByteArray dataArray = QByteArray::fromBase64(base64);
QSize size(image[QLatin1String("__width__")].toInt(),
image[QLatin1String("__height__")].toInt());
QString cls = image[QLatin1String("__class__")].toString();
- QString type = image[QLatin1String("__type__")].toString();
- bool normalized =
- image[QLatin1String("__normalized__")].toBool();
- int numChannels =
- image[QLatin1String("__channels__")].toInt();
int depth =
image[QLatin1String("__depth__")].toInt();
QString formatName =
image[QLatin1String("__format__")].toString();
- Q_ASSERT(type == QLatin1String("uint8"));
- Q_ASSERT(normalized == true);
- Q_UNUSED(normalized);
-
QByteArray dataArray =
image[QLatin1String("__data__")].toByteArray();
tex.setSize(size);
tex.setDepth(depth);
tex.setFormatName(formatName);
- tex.setNumChannels(numChannels);
tex.setLabel(itr.key());
tex.contentsFromBase64(dataArray);
QSize size(buffer[QLatin1String("__width__")].toInt(),
buffer[QLatin1String("__height__")].toInt());
QString cls = buffer[QLatin1String("__class__")].toString();
- QString type = buffer[QLatin1String("__type__")].toString();
- bool normalized = buffer[QLatin1String("__normalized__")].toBool();
- int numChannels = buffer[QLatin1String("__channels__")].toInt();
int depth = buffer[QLatin1String("__depth__")].toInt();
QString formatName = buffer[QLatin1String("__format__")].toString();
- Q_ASSERT(type == QLatin1String("uint8"));
- Q_ASSERT(normalized == true);
- Q_UNUSED(normalized);
-
QByteArray dataArray =
buffer[QLatin1String("__data__")].toByteArray();
fbo.setSize(size);
fbo.setDepth(depth);
fbo.setFormatName(formatName);
- fbo.setNumChannels(numChannels);
fbo.setType(itr.key());
fbo.contentsFromBase64(dataArray);
m_framebuffers.append(fbo);
json.writeStringMember("__format__", formatToString(desc.internalFormat));
- // Hardcoded for now, but we could chose types more adequate to the
- // texture internal format
- json.writeStringMember("__type__", "uint8");
- json.writeBoolMember("__normalized__", true);
- json.writeIntMember("__channels__", channels);
-
image::Image *image = new image::Image(desc.width, desc.height*desc.depth, channels, true);
context.resetPixelPackState();
json.writeStringMember("__format__", formatToString(internalFormat));
- // Hardcoded for now, but we could chose types more adequate to the
- // texture internal format
- json.writeStringMember("__type__", "uint8");
- json.writeBoolMember("__normalized__", true);
- json.writeIntMember("__channels__", channels);
-
GLenum type = GL_UNSIGNED_BYTE;
#if DEPTH_AS_RGBA