importerdesc.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. /*
  2. ---------------------------------------------------------------------------
  3. Open Asset Import Library (assimp)
  4. ---------------------------------------------------------------------------
  5. Copyright (c) 2006-2025, assimp team
  6. All rights reserved.
  7. Redistribution and use of this software in source and binary forms,
  8. with or without modification, are permitted provided that the following
  9. conditions are met:
  10. * Redistributions of source code must retain the above
  11. copyright notice, this list of conditions and the
  12. following disclaimer.
  13. * Redistributions in binary form must reproduce the above
  14. copyright notice, this list of conditions and the
  15. following disclaimer in the documentation and/or other
  16. materials provided with the distribution.
  17. * Neither the name of the assimp team, nor the names of its
  18. contributors may be used to endorse or promote products
  19. derived from this software without specific prior
  20. written permission of the assimp team.
  21. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  24. A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  25. OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  26. SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  27. LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  28. DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  29. THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  30. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  31. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32. ---------------------------------------------------------------------------
  33. */
  34. /** @file importerdesc.h
  35. * @brief #aiImporterFlags, aiImporterDesc implementation.
  36. */
  37. #pragma once
  38. #ifndef AI_IMPORTER_DESC_H_INC
  39. #define AI_IMPORTER_DESC_H_INC
  40. #ifdef __GNUC__
  41. # pragma GCC system_header
  42. #endif
  43. #include <assimp/types.h>
  44. #ifdef __cplusplus
  45. extern "C" {
  46. #endif
  47. /** Mixed set of flags for #aiImporterDesc, indicating some features
  48. * common to many importers*/
  49. enum aiImporterFlags {
  50. /** Indicates that there is a textual encoding of the
  51. * file format; and that it is supported.*/
  52. aiImporterFlags_SupportTextFlavour = 0x1,
  53. /** Indicates that there is a binary encoding of the
  54. * file format; and that it is supported.*/
  55. aiImporterFlags_SupportBinaryFlavour = 0x2,
  56. /** Indicates that there is a compressed encoding of the
  57. * file format; and that it is supported.*/
  58. aiImporterFlags_SupportCompressedFlavour = 0x4,
  59. /** Indicates that the importer reads only a very particular
  60. * subset of the file format. This happens commonly for
  61. * declarative or procedural formats which cannot easily
  62. * be mapped to #aiScene */
  63. aiImporterFlags_LimitedSupport = 0x8,
  64. /** Indicates that the importer is highly experimental and
  65. * should be used with care. This only happens for trunk
  66. * (i.e. SVN) versions, experimental code is not included
  67. * in releases. */
  68. aiImporterFlags_Experimental = 0x10
  69. };
  70. /** Meta information about a particular importer. Importers need to fill
  71. * this structure, but they can freely decide how talkative they are.
  72. * A common use case for loader meta info is a user interface
  73. * in which the user can choose between various import/export file
  74. * formats. Building such an UI by hand means a lot of maintenance
  75. * as importers/exporters are added to Assimp, so it might be useful
  76. * to have a common mechanism to query some rough importer
  77. * characteristics. */
  78. struct aiImporterDesc {
  79. /** Full name of the importer (i.e. Blender3D importer)*/
  80. const char *mName;
  81. /** Original author (left blank if unknown or whole assimp team) */
  82. const char *mAuthor;
  83. /** Current maintainer, left blank if the author maintains */
  84. const char *mMaintainer;
  85. /** Implementation comments, i.e. unimplemented features*/
  86. const char *mComments;
  87. /** These flags indicate some characteristics common to many
  88. importers. */
  89. unsigned int mFlags;
  90. /** Minimum format version that can be loaded im major.minor format,
  91. both are set to 0 if there is either no version scheme
  92. or if the loader doesn't care. */
  93. unsigned int mMinMajor;
  94. unsigned int mMinMinor;
  95. /** Maximum format version that can be loaded im major.minor format,
  96. both are set to 0 if there is either no version scheme
  97. or if the loader doesn't care. Loaders that expect to be
  98. forward-compatible to potential future format versions should
  99. indicate zero, otherwise they should specify the current
  100. maximum version.*/
  101. unsigned int mMaxMajor;
  102. unsigned int mMaxMinor;
  103. /** List of file extensions this importer can handle.
  104. List entries are separated by space characters.
  105. All entries are lower case without a leading dot (i.e.
  106. "xml dae" would be a valid value. Note that multiple
  107. importers may respond to the same file extension -
  108. assimp calls all importers in the order in which they
  109. are registered and each importer gets the opportunity
  110. to load the file until one importer "claims" the file. Apart
  111. from file extension checks, importers typically use
  112. other methods to quickly reject files (i.e. magic
  113. words) so this does not mean that common or generic
  114. file extensions such as XML would be tediously slow. */
  115. const char *mFileExtensions;
  116. };
  117. /** \brief Returns the Importer description for a given extension.
  118. Will return a nullptr if no assigned importer desc. was found for the given extension
  119. \param extension [in] The extension to look for
  120. \return A pointer showing to the ImporterDesc, \see aiImporterDesc.
  121. */
  122. ASSIMP_API const C_STRUCT aiImporterDesc *aiGetImporterDesc(const char *extension);
  123. #ifdef __cplusplus
  124. } // end of extern "C"
  125. #endif
  126. #endif // AI_IMPORTER_DESC_H_INC