ReaderWriterBVH() { supportsExtension( "bvh", "Biovision motion hierarchical file" ); supportsOption( "contours","Show the skeleton with lines." ); supportsOption( "solids","Show the skeleton with solid boxes." ); }
ReaderWriterOBJ():_fixBlackMaterials(true) { supportsExtension("obj","Alias Wavefront OBJ format"); supportsOption("noRotation","Do not do the default rotate about X axis"); supportsOption("noTesselateLargePolygons","Do not do the default tesselation of large polygons"); supportsOption("noTriStripPolygons","Do not do the default tri stripping of polygons"); }
ReaderWriterOGR() { supportsExtension("ogr","OGR file reader"); supportsOption("useRandomColorByFeature", "Assign a random color to each feature."); supportsOption("addGroupPerFeature", "Places each feature in a separate group."); oldHandler = CPLSetErrorHandler(CPLOSGErrorHandler); }
ReaderWriterSTL() { supportsExtension("stl", "STL binary format"); supportsExtension("sta", "STL ASCII format"); supportsOption("smooth", "Run SmoothingVisitor"); supportsOption("separateFiles", "Save each geode in a different file. Can result in a huge amount of files!"); supportsOption("dontSaveNormals", "Set all normals to [0 0 0] when saving to a file."); }
ReaderWriterDirectX() { supportsExtension("x","DirectX scene format"); supportsOption("flipTexture", "flip texture upside-down"); // made hand switching an option - .x models from XSI's export are right-handed already supportsOption("rightHanded", "prevents reader from switching handedness for right handed files"); supportsOption("leftHanded", "reader switches handedness for left handed files"); }
ReaderWriterRestHttp() { supportsExtension("resthttp", "Virtual Device Integration via a HTTP-Server and a REST-interface"); supportsOption("documentRoot", "document root of asset files to server via the http-server"); supportsOption("serverAddress", "server address to listen for incoming requests"); supportsOption("serverPort", "server port to listen for incoming requests"); supportsOption("documentRegisteredHandlers", "dump a documentation of all registered REST-handler to the console"); }
ReaderWriterVNC() { supportsExtension("vnc","VNC plugin"); supportsOption("swap","Swaps the pixel format order, exchanging the red and blue channels."); supportsOption("swop","American spelling, same effect as swap."); supportsOption("RGB","Use RGBA pixel format for the vnc image"); supportsOption("RGBA","Use RGBA pixel format for the vnc image"); supportsOption("BGR","Use BGRA pixel format for the vnc image"); supportsOption("BGRA","Use BGRA pixel format for the vnc image"); }
ESRIShapeReaderWriter() { supportsExtension("shp","Geospatial Shape file format"); supportsOption("double","Read x,y,z data as double an stored as geometry in osg::Vec3dArray's."); }
ReaderWriterOBJ() { supportsExtension("obj","Alias Wavefront OBJ format"); supportsOption("noRotation","Do not do the default rotate about X axis"); supportsOption("noTesselateLargePolygons","Do not do the default tesselation of large polygons"); supportsOption("noTriStripPolygons","Do not do the default tri stripping of polygons"); supportsOption("generateFacetNormals","generate facet normals for verticies without normals"); supportsOption("DIFFUSE=<unit>", "Set texture unit for diffuse texture"); supportsOption("AMBIENT=<unit>", "Set texture unit for ambient texture"); supportsOption("SPECULAR=<unit>", "Set texture unit for specular texture"); supportsOption("SPECULAR_EXPONENT=<unit>", "Set texture unit for specular exponent texture"); supportsOption("OPACITY=<unit>", "Set texture unit for opacity/dissolve texture"); supportsOption("BUMP=<unit>", "Set texture unit for bumpmap texture"); supportsOption("DISPLACEMENT=<unit>", "Set texture unit for displacement texture"); supportsOption("REFLECTION=<unit>", "Set texture unit for reflection texture"); }
/*! \since 5.4 Returns the list of subtypes supported by an image. */ QList<QByteArray> QImageWriter::supportedSubTypes() const { if (!supportsOption(QImageIOHandler::SupportedSubTypes)) return QList<QByteArray>(); return d->handler->option(QImageIOHandler::SupportedSubTypes).value< QList<QByteArray> >(); }
bool QWebpHandler::write(const QImage &image) { if (image.isNull()) { qWarning() << "source image is null."; return false; } QImage srcImage = image; #if Q_BYTE_ORDER == Q_LITTLE_ENDIAN if (srcImage.format() != QImage::Format_ARGB32) srcImage = srcImage.convertToFormat(QImage::Format_ARGB32); #else /* Q_BIG_ENDIAN */ if (srcImage.format() != QImage::Format_RGBA8888) srcImage = srcImage.convertToFormat(QImage::Format_RGBA8888); #endif WebPPicture picture; WebPConfig config; if (!WebPPictureInit(&picture) || !WebPConfigInit(&config)) { qWarning() << "failed to init webp picture and config"; return false; } picture.width = srcImage.width(); picture.height = srcImage.height(); picture.use_argb = 1; #if Q_BYTE_ORDER == Q_LITTLE_ENDIAN if (!WebPPictureImportBGRA(&picture, srcImage.bits(), srcImage.bytesPerLine())) { #else /* Q_BIG_ENDIAN */ if (!WebPPictureImportRGBA(&picture, srcImage.bits(), srcImage.bytesPerLine())) { #endif qWarning() << "failed to import image data to webp picture."; WebPPictureFree(&picture); return false; } config.lossless = m_lossless; config.quality = m_quality; picture.writer = pictureWriter; picture.custom_ptr = device(); if (!WebPEncode(&config, &picture)) { qWarning() << "failed to encode webp picture, error code: " << picture.error_code; WebPPictureFree(&picture); return false; } WebPPictureFree(&picture); return true; } QVariant QWebpHandler::option(ImageOption option) const { if (!supportsOption(option) || !ensureScanned()) return QVariant(); switch (option) { case Quality: return m_quality; case Size: return QSize(m_width, m_height); case Animation: return (m_flags & ANIMATION_FLAG) == ANIMATION_FLAG; default: return QVariant(); } } void QWebpHandler::setOption(ImageOption option, const QVariant &value) { switch (option) { case Quality: m_quality = qBound(0, value.toInt(), 100); m_lossless = (m_quality >= 100); return; default: break; } return QImageIOHandler::setOption(option, value); } bool QWebpHandler::supportsOption(ImageOption option) const { return option == Quality || option == Size || option == Animation; } QByteArray QWebpHandler::name() const { return QByteArrayLiteral("webp"); } int QWebpHandler::imageCount() const { if (!ensureScanned()) return 0; if ((m_flags & ANIMATION_FLAG) == 0) return 1; return m_frameCount; } int QWebpHandler::currentImageNumber() const { if (!ensureScanned()) return 0; return m_iter.frame_num; } QRect QWebpHandler::currentImageRect() const { if (!ensureScanned()) return QRect(); return QRect(m_iter.x_offset, m_iter.y_offset, m_iter.width, m_iter.height); } bool QWebpHandler::jumpToImage(int imageNumber) { if (!ensureScanned()) return false; WebPDemuxReleaseIterator(&m_iter); return WebPDemuxGetFrame(m_demuxer, imageNumber, &m_iter); } bool QWebpHandler::jumpToNextImage() { if (!ensureScanned()) return false; return WebPDemuxNextFrame(&m_iter); } int QWebpHandler::loopCount() const { if (!ensureScanned() || (m_flags & ANIMATION_FLAG) == 0) return 0; return m_loop; } int QWebpHandler::nextImageDelay() const { if (!ensureScanned()) return 0; return m_iter.duration; }
ReaderWriterDirectX() { supportsExtension("x","DirectX scene format"); supportsOption("flipTexture", "flip texture upside-down"); }