Skip to content

Commit

Permalink
fixup! BasisImporter
Browse files Browse the repository at this point in the history
  • Loading branch information
Squareys committed Aug 28, 2019
1 parent 3232773 commit 5b22504
Showing 1 changed file with 73 additions and 11 deletions.
84 changes: 73 additions & 11 deletions src/MagnumPlugins/BasisImporter/BasisImporter.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,71 @@ namespace Magnum { namespace Trade {
@brief Type to transcode to
*/
enum class BasisTranscodingType : Int {
Etc1 = 0, /**< ETC1. Loaded as ETC2, prefer ETC2 for better quality. */
Etc2 = 1, /**< ETC2 */
Bc1 = 2, /**< BC1 */
Bc3 = 3, /**< BC3 */
Bc4 = 4, /**< BC4 */
Bc5 = 5, /**< BC5 */
Bc7M6OpaqueOnly = 6, /**< BC7 M4 opaque only */
Pvrtc1_4OpaqueOnly = 7 /**< PVRTC1 4 opaque only */
/**
* ETC1
*
* Loaded as @ref CompressedPixelFormat::Etc2RGB8Unorm or
* @ref CompressedPixelFormat::Etc2RGBA8Unorm if the image contains an
* alpha channel.
*
* This format is loaded like @ref Etc2, prefer it for potentially better quality.
*/
Etc1 = 0,

/**
* ETC2
*
* Loaded as @ref CompressedPixelFormat::Etc2RGB8Unorm or
* @ref CompressedPixelFormat::Etc2RGBA8Unorm if the image contains an
* alpha channel.
*/
Etc2 = 1,

/**
* BC1
*
* Loaded as @ref CompressedPixelFormat::Bc1RGBAUnorm or @ref CompressedPixelFormat::Bc1RGBUnorm
* if the image contains an alpha channel.
*/
Bc1 = 2,

/**
* BC2
*
* Loaded as @ref CompressedPixelFormat::Bc3RGBAUnorm. If the image does
* not contain an alpha channel, alpha will be set to opaque.
*/
Bc3 = 3,

/**
* BC4
*
* Loaded as @ref CompressedPixelFormat::Bc4RUnorm.
*/
Bc4 = 4,

/**
* BC5
*
* Loaded as @ref CompressedPixelFormat::Bc5RGUnorm.
*/
Bc5 = 5,

/**
* BC7 mode 4 (opaque only)
*
* Loaded as @ref CompressedPixelFormat::Bc7RGBAUnorm, but with alpha
* values set to opaque.
*/
Bc7M6OpaqueOnly = 6,

/**
* PVRTC1 4 bpp (opaque only)
*
* Loaded as @ref CompressedPixelFormat::PvrtcRGB4bppUnorm. If the image
* contains an alpha channel, it will be dropped.
*/
Pvrtc1_4OpaqueOnly = 7
};

/**
Expand All @@ -75,7 +132,8 @@ enum class BasisTranscodingType : Int {
@m_keywords{BasisImporterBc4 BasisImporterBc5 BasisImporterBc7M6OpaqueOnly}
@m_keywords{BasisImporterPvrtc1_4OpaqueOnly}
Supports Basis Universal (`*.basis`) compressed images.
Supports Basis Universal (`*.basis`) compressed images by parsing and transcoding
files into an explicitly specified GPU format (see @ref Trade-BasisImporter-target-format).
This plugin depends on the @ref Trade and [basis_universal](https://github.com/binomialLLC/basis_universal)
libraries and is built if `WITH_BASISIMPORTER` is enabled when building Magnum
Expand All @@ -89,14 +147,14 @@ This plugin provides `BasisImporterEct1`, `BasisImporterEtc1`, `BasisImporterEtc
`BasisImporterBc1`, `BasisImporterBc3`, `BasisImporterBc4`, `BasisImporterBc5`,
`BasisImporterBc7M6OpaqueOnly`, `BasisImporterPvrtc1_4OpaqueOnly`.
@section Trade-BasisImporterImporter-configuration Plugin-specific configuration
@section Trade-BasisImporter-configuration Plugin-specific configuration
Basis allows configuration of the format of loaded compressed data.
The full form of the configuration is shown below:
@snippet MagnumPlugins/BasisImporter/BasisImporter.conf configuration
@subsection Trade-BasisImporterImporter-target-format Target format
@subsection Trade-BasisImporter-target-format Target format
Basis is a compressed format that is *transcoded* into a compressed GPU format. With
BasisImporter, this format can be chosen in different ways:
Expand All @@ -112,6 +170,10 @@ set the "format" configuration of the plugin:
If you link to the plugin you may also use @ref BasisImporter::setTargetFormat().
@thirdparty This plugin makes use of the [Basis Universal GPU Texture Codec](https://github.com/BinomialLLC/basis_universal)
library, licensed under @m_class{m-label m-info} **Apache-2.0**
([license text](https://opensource.org/licenses/Apache-2.0),
[choosealicense.com](https://choosealicense.com/licenses/apache-2.0/)).
*/
class MAGNUM_BASISIMPORTER_EXPORT BasisImporter: public AbstractImporter {
public:
Expand Down

0 comments on commit 5b22504

Please sign in to comment.