Browse Source

Trade: doc++

Huh, so much copypaste bullshit.
pull/481/head
Vladimír Vondruš 6 years ago
parent
commit
78f38b89ad
  1. 4
      src/Magnum/Trade/AbstractImageConverter.cpp
  2. 35
      src/Magnum/Trade/AbstractImageConverter.h
  3. 4
      src/Magnum/Trade/AbstractImporter.h
  4. 1
      src/Magnum/Trade/AbstractSceneConverter.cpp
  5. 24
      src/Magnum/Trade/AbstractSceneConverter.h
  6. 8
      src/Magnum/Trade/MaterialData.h

4
src/Magnum/Trade/AbstractImageConverter.cpp

@ -152,9 +152,9 @@ bool AbstractImageConverter::doExportToFile(const ImageView2D& image, const std:
CORRADE_ASSERT(features() >= ImageConverterFeature::ConvertData, "Trade::AbstractImageConverter::exportToFile(): feature advertised but not implemented", false); CORRADE_ASSERT(features() >= ImageConverterFeature::ConvertData, "Trade::AbstractImageConverter::exportToFile(): feature advertised but not implemented", false);
const auto data = doExportToData(image); const auto data = doExportToData(image);
/* No deleter checks as it doesn't matter here */
if(!data) return false; if(!data) return false;
/* Open file */
if(!Utility::Directory::write(filename, data)) { if(!Utility::Directory::write(filename, data)) {
Error() << "Trade::AbstractImageConverter::exportToFile(): cannot write to file" << filename; Error() << "Trade::AbstractImageConverter::exportToFile(): cannot write to file" << filename;
return false; return false;
@ -174,9 +174,9 @@ bool AbstractImageConverter::doExportToFile(const CompressedImageView2D& image,
CORRADE_ASSERT(features() >= ImageConverterFeature::ConvertCompressedData, "Trade::AbstractImageConverter::exportToFile(): feature advertised but not implemented", false); CORRADE_ASSERT(features() >= ImageConverterFeature::ConvertCompressedData, "Trade::AbstractImageConverter::exportToFile(): feature advertised but not implemented", false);
const auto data = doExportToData(image); const auto data = doExportToData(image);
/* No deleter checks as it doesn't matter here */
if(!data) return false; if(!data) return false;
/* Open file */
if(!Utility::Directory::write(filename, data)) { if(!Utility::Directory::write(filename, data)) {
Error() << "Trade::AbstractImageConverter::exportToFile(): cannot write to file" << filename; Error() << "Trade::AbstractImageConverter::exportToFile(): cannot write to file" << filename;
return false; return false;

35
src/Magnum/Trade/AbstractImageConverter.h

@ -107,9 +107,9 @@ MAGNUM_TRADE_EXPORT Debug& operator<<(Debug& debug, ImageConverterFeatures value
*/ */
enum class ImageConverterFlag: UnsignedByte { enum class ImageConverterFlag: UnsignedByte {
/** /**
* Print verbose diagnostic during import. By default the importer only * Print verbose diagnostic during conversion. By default the converter
* prints messages on error or when some operation might cause unexpected * only prints messages on error or when some operation might cause
* data modification or loss. * unexpected data modification or loss.
*/ */
Verbose = 1 << 0 Verbose = 1 << 0
@ -120,7 +120,7 @@ enum class ImageConverterFlag: UnsignedByte {
@brief Image converter flags @brief Image converter flags
@m_since{2020,06} @m_since{2020,06}
@see @ref AbstractImporter::setFlags() @see @ref AbstractImageConverter::setFlags()
*/ */
typedef Containers::EnumSet<ImageConverterFlag> ImageConverterFlags; typedef Containers::EnumSet<ImageConverterFlag> ImageConverterFlags;
@ -148,13 +148,14 @@ classes in @ref Trade namespace for available image converter plugins.
@section Trade-AbstractImageConverter-data-dependency Data dependency @section Trade-AbstractImageConverter-data-dependency Data dependency
The instances returned from various functions *by design* have no dependency on The instances returned from various functions *by design* have no dependency on
the importer instance and neither on the dynamic plugin module. In other words, the converter instance and neither on the dynamic plugin module. In other
you don't need to keep the importer instance (or the plugin manager instance) words, you don't need to keep the converter instance (or the plugin manager
around in order to have the `*Data` instances valid. Moreover, all instance) around in order to have the `*Data` instances valid. Moreover, all
@ref Corrade::Containers::Array instances returned through @ref Image, @ref Corrade::Containers::Array instances returned through @ref Image,
@ref CompressedImage and others are only allowed to have default deleters --- @ref CompressedImage, @ref MeshData, @ref MaterialData, @ref AnimationData and
this is to avoid potential dangling function pointer calls when destructing others are only allowed to have default deleters --- this is to avoid potential
such instances after the plugin module has been unloaded. dangling function pointer calls when destructing such instances after the
plugin module has been unloaded.
@section Trade-AbstractImageConverter-subclassing Subclassing @section Trade-AbstractImageConverter-subclassing Subclassing
@ -338,7 +339,7 @@ class MAGNUM_TRADE_EXPORT AbstractImageConverter: public PluginManager::Abstract
bool exportToFile(const ImageData2D& image, const std::string& filename); bool exportToFile(const ImageData2D& image, const std::string& filename);
private: private:
/** @brief Implementation of @ref features() */ /** @brief Implementation for @ref features() */
virtual ImageConverterFeatures doFeatures() const = 0; virtual ImageConverterFeatures doFeatures() const = 0;
/** /**
@ -356,20 +357,20 @@ class MAGNUM_TRADE_EXPORT AbstractImageConverter: public PluginManager::Abstract
*/ */
virtual void doSetFlags(ImageConverterFlags flags); virtual void doSetFlags(ImageConverterFlags flags);
/** @brief Implementation of @ref exportToImage() */ /** @brief Implementation for @ref exportToImage() */
virtual Containers::Optional<Image2D> doExportToImage(const ImageView2D& image); virtual Containers::Optional<Image2D> doExportToImage(const ImageView2D& image);
/** @brief Implementation of @ref exportToCompressedImage() */ /** @brief Implementation for @ref exportToCompressedImage() */
virtual Containers::Optional<CompressedImage2D> doExportToCompressedImage(const ImageView2D& image); virtual Containers::Optional<CompressedImage2D> doExportToCompressedImage(const ImageView2D& image);
/** @brief Implementation of @ref exportToData(const ImageView2D&) */ /** @brief Implementation for @ref exportToData(const ImageView2D&) */
virtual Containers::Array<char> doExportToData(const ImageView2D& image); virtual Containers::Array<char> doExportToData(const ImageView2D& image);
/** @brief Implementation of @ref exportToData(const CompressedImageView2D&) */ /** @brief Implementation for @ref exportToData(const CompressedImageView2D&) */
virtual Containers::Array<char> doExportToData(const CompressedImageView2D& image); virtual Containers::Array<char> doExportToData(const CompressedImageView2D& image);
/** /**
* @brief Implementation of @ref exportToFile(const ImageView2D&, const std::string&) * @brief Implementation for @ref exportToFile(const ImageView2D&, const std::string&)
* *
* If @ref ImageConverterFeature::ConvertData is supported, default * If @ref ImageConverterFeature::ConvertData is supported, default
* implementation calls @ref doExportToData(const ImageView2D&) and * implementation calls @ref doExportToData(const ImageView2D&) and
@ -378,7 +379,7 @@ class MAGNUM_TRADE_EXPORT AbstractImageConverter: public PluginManager::Abstract
virtual bool doExportToFile(const ImageView2D& image, const std::string& filename); virtual bool doExportToFile(const ImageView2D& image, const std::string& filename);
/** /**
* @brief Implementation of @ref exportToFile(const CompressedImageView2D&, const std::string&) * @brief Implementation for @ref exportToFile(const CompressedImageView2D&, const std::string&)
* *
* If @ref ImageConverterFeature::ConvertCompressedData is supported, * If @ref ImageConverterFeature::ConvertCompressedData is supported,
* default implementation calls @ref doExportToData(const CompressedImageView2D&) * default implementation calls @ref doExportToData(const CompressedImageView2D&)

4
src/Magnum/Trade/AbstractImporter.h

@ -58,7 +58,7 @@ enum class ImporterFeature: UnsignedByte {
/** /**
* Specifying callbacks for loading additional files referenced * Specifying callbacks for loading additional files referenced
* from the main file using @ref AbstractImporter::setFileCallback(). If * from the main file using @ref AbstractImporter::setFileCallback(). If
* the importer * doesn't expose this feature, the format is either * the importer doesn't expose this feature, the format is either
* single-file or loading via callbacks is not supported. * single-file or loading via callbacks is not supported.
* *
* See @ref Trade-AbstractImporter-usage-callbacks and particular importer * See @ref Trade-AbstractImporter-usage-callbacks and particular importer
@ -162,7 +162,7 @@ See @ref plugins for more information about general plugin usage and
Besides loading data directly from the filesystem using @ref openFile() like Besides loading data directly from the filesystem using @ref openFile() like
shown above, it's possible to use @ref openData() to import data from memory. shown above, it's possible to use @ref openData() to import data from memory.
Note that the particular importer implementation must support Note that the particular importer implementation has to support
@ref ImporterFeature::OpenData for this method to work. @ref ImporterFeature::OpenData for this method to work.
Complex scene files often reference other files such as images and in that case Complex scene files often reference other files such as images and in that case

1
src/Magnum/Trade/AbstractSceneConverter.cpp

@ -145,7 +145,6 @@ bool AbstractSceneConverter::doConvertToFile(const std::string& filename, const
/* No deleter checks as it doesn't matter here */ /* No deleter checks as it doesn't matter here */
if(!data) return false; if(!data) return false;
/* Open file */
if(!Utility::Directory::write(filename, data)) { if(!Utility::Directory::write(filename, data)) {
Error() << "Trade::AbstractSceneConverter::convertToFile(): cannot write to file" << filename; Error() << "Trade::AbstractSceneConverter::convertToFile(): cannot write to file" << filename;
return false; return false;

24
src/Magnum/Trade/AbstractSceneConverter.h

@ -95,9 +95,9 @@ MAGNUM_TRADE_EXPORT Debug& operator<<(Debug& debug, SceneConverterFeatures value
*/ */
enum class SceneConverterFlag: UnsignedByte { enum class SceneConverterFlag: UnsignedByte {
/** /**
* Print verbose diagnostic during import. By default the importer only * Print verbose diagnostic during conversion. By default the converter
* prints messages on error or when some operation might cause unexpected * only prints messages on error or when some operation might cause
* data modification or loss. * unexpected data modification or loss.
*/ */
Verbose = 1 << 0 Verbose = 1 << 0
@ -108,7 +108,7 @@ enum class SceneConverterFlag: UnsignedByte {
@brief Scene converter flags @brief Scene converter flags
@m_since{2020,06} @m_since{2020,06}
@see @ref AbstractImporter::setFlags() @see @ref AbstractSceneConverter::setFlags()
*/ */
typedef Containers::EnumSet<SceneConverterFlag> SceneConverterFlags; typedef Containers::EnumSet<SceneConverterFlag> SceneConverterFlags;
@ -138,9 +138,9 @@ various formats or performing optimizations and other operations on them. See
@section Trade-AbstractSceneConverter-data-dependency Data dependency @section Trade-AbstractSceneConverter-data-dependency Data dependency
The instances returned from various functions *by design* have no dependency on The instances returned from various functions *by design* have no dependency on
the importer instance and neither on the dynamic plugin module. In other words, the converter instance and neither on the dynamic plugin module. In other
you don't need to keep the importer instance (or the plugin manager instance) words, you don't need to keep the converter instance (or the plugin manager
around in order to have the `*Data` instances valid. Moreover, all instance) around in order to have the `*Data` instances valid. Moreover, all
@ref Corrade::Containers::Array instances returned through @ref MeshData and @ref Corrade::Containers::Array instances returned through @ref MeshData and
others are only allowed to have default deleters --- this is to avoid potential others are only allowed to have default deleters --- this is to avoid potential
dangling function pointer calls when destructing such instances after the dangling function pointer calls when destructing such instances after the
@ -274,7 +274,7 @@ class MAGNUM_TRADE_EXPORT AbstractSceneConverter: public PluginManager::Abstract
private: private:
/** /**
* @brief Implementation of @ref features() * @brief Implementation for @ref features()
* *
* The implementation is expected to support at least one feature. * The implementation is expected to support at least one feature.
*/ */
@ -295,17 +295,17 @@ class MAGNUM_TRADE_EXPORT AbstractSceneConverter: public PluginManager::Abstract
*/ */
virtual void doSetFlags(SceneConverterFlags flags); virtual void doSetFlags(SceneConverterFlags flags);
/** @brief Implementation of @ref convert(const MeshData&) */ /** @brief Implementation for @ref convert(const MeshData&) */
virtual Containers::Optional<MeshData> doConvert(const MeshData& mesh); virtual Containers::Optional<MeshData> doConvert(const MeshData& mesh);
/** @brief Implementation of @ref convertInPlace(MeshData&) */ /** @brief Implementation for @ref convertInPlace(MeshData&) */
virtual bool doConvertInPlace(MeshData& mesh); virtual bool doConvertInPlace(MeshData& mesh);
/** @brief Implementation of @ref convertToData(const MeshData&) */ /** @brief Implementation for @ref convertToData(const MeshData&) */
virtual Containers::Array<char> doConvertToData(const MeshData& mesh); virtual Containers::Array<char> doConvertToData(const MeshData& mesh);
/** /**
* @brief Implementation of @ref convertToFile(const std::string&, const MeshData&) * @brief Implementation for @ref convertToFile(const std::string&, const MeshData&)
* *
* If @ref SceneConverterFeature::ConvertMeshToData is supported, * If @ref SceneConverterFeature::ConvertMeshToData is supported,
* default implementation calls @ref doConvertToData(const MeshData&) * default implementation calls @ref doConvertToData(const MeshData&)

8
src/Magnum/Trade/MaterialData.h

@ -1487,10 +1487,10 @@ APIs, see the documentation of of a particular enum value for more information.
@subsection Trade-MaterialData-usage-texture-complexity Texture packing, coordinate transformation and coordinate sets @subsection Trade-MaterialData-usage-texture-complexity Texture packing, coordinate transformation and coordinate sets
The material APIs allow for a lot of flexibility regarding --- texture maps may The material APIs allow for a lot of flexibility --- texture maps may be
be arbitrarily packed together to efficiently use all four channels, each arbitrarily packed together to efficiently use all four channels, each texture
texture can use a different set of texture coordinates and there can be a can use a different set of texture coordinates and there can be a different
different coordinate transformation for each texture. coordinate transformation for each texture.
In most cases, however, real-world textures fit into a few well-known packing In most cases, however, real-world textures fit into a few well-known packing
schemes and usually have a common transformation and coordinate sets for all. schemes and usually have a common transformation and coordinate sets for all.

Loading…
Cancel
Save