#include <tiny_gltf.h>
Public Member Functions | |
| TinyGLTF () | |
| ~TinyGLTF ()=default | |
| bool | LoadASCIIFromFile (Model *model, std::string *err, std::string *warn, const std::string &filename, unsigned int check_sections=REQUIRE_VERSION) |
| bool | LoadASCIIFromString (Model *model, std::string *err, std::string *warn, const char *str, const unsigned int length, const std::string &base_dir, unsigned int check_sections=REQUIRE_VERSION) |
| bool | LoadBinaryFromFile (Model *model, std::string *err, std::string *warn, const std::string &filename, unsigned int check_sections=REQUIRE_VERSION) |
| bool | LoadBinaryFromMemory (Model *model, std::string *err, std::string *warn, const unsigned char *bytes, const unsigned int length, const std::string &base_dir="", unsigned int check_sections=REQUIRE_VERSION) |
| bool | WriteGltfSceneToStream (const Model *model, std::ostream &stream, bool prettyPrint, bool writeBinary) |
| bool | WriteGltfSceneToFile (const Model *model, const std::string &filename, bool embedImages, bool embedBuffers, bool prettyPrint, bool writeBinary) |
| void | SetParseStrictness (ParseStrictness strictness) |
| void | SetImageLoader (LoadImageDataFunction LoadImageData, void *user_data) |
| void | RemoveImageLoader () |
| void | SetImageWriter (WriteImageDataFunction WriteImageData, void *user_data) |
| void | SetURICallbacks (URICallbacks callbacks) |
| void | SetFsCallbacks (FsCallbacks callbacks) |
| void | SetSerializeDefaultValues (const bool enabled) |
| bool | GetSerializeDefaultValues () const |
| void | SetStoreOriginalJSONForExtrasAndExtensions (const bool enabled) |
| bool | GetStoreOriginalJSONForExtrasAndExtensions () const |
| void | SetPreserveImageChannels (bool onoff) |
| void | SetMaxExternalFileSize (size_t max_bytes) |
| size_t | GetMaxExternalFileSize () const |
| bool | GetPreserveImageChannels () const |
glTF Parser/Serializer context.
| tinygltf::TinyGLTF::TinyGLTF | ( | ) |
|
default |
|
inline |
|
inline |
|
inline |
|
inline |
| bool tinygltf::TinyGLTF::LoadASCIIFromFile | ( | Model * | model, |
| std::string * | err, | ||
| std::string * | warn, | ||
| const std::string & | filename, | ||
| unsigned int | check_sections = REQUIRE_VERSION |
||
| ) |
Loads glTF ASCII asset from a file. Set warning message to warn for example it fails to load asserts. Returns false and set error string to err if there's an error.
| bool tinygltf::TinyGLTF::LoadASCIIFromString | ( | Model * | model, |
| std::string * | err, | ||
| std::string * | warn, | ||
| const char * | str, | ||
| const unsigned int | length, | ||
| const std::string & | base_dir, | ||
| unsigned int | check_sections = REQUIRE_VERSION |
||
| ) |
Loads glTF ASCII asset from string(memory). length = strlen(str); base_dir is a search path of glTF asset(e.g. images). Path Must be an expanded path (e.g. no tilde(~), no environment variables). Set warning message to warn for example it fails to load asserts. Returns false and set error string to err if there's an error.
| bool tinygltf::TinyGLTF::LoadBinaryFromFile | ( | Model * | model, |
| std::string * | err, | ||
| std::string * | warn, | ||
| const std::string & | filename, | ||
| unsigned int | check_sections = REQUIRE_VERSION |
||
| ) |
Loads glTF binary asset from a file. Set warning message to warn for example it fails to load asserts. Returns false and set error string to err if there's an error.
| bool tinygltf::TinyGLTF::LoadBinaryFromMemory | ( | Model * | model, |
| std::string * | err, | ||
| std::string * | warn, | ||
| const unsigned char * | bytes, | ||
| const unsigned int | length, | ||
| const std::string & | base_dir = "", |
||
| unsigned int | check_sections = REQUIRE_VERSION |
||
| ) |
Loads glTF binary asset from memory. length = strlen(str); base_dir is a search path of glTF asset(e.g. images). Path Must be an expanded path (e.g. no tilde(~), no environment variables). Set warning message to warn for example it fails to load asserts. Returns false and set error string to err if there's an error.
| void tinygltf::TinyGLTF::RemoveImageLoader | ( | ) |
Unset(remove) callback of loading image data
| void tinygltf::TinyGLTF::SetFsCallbacks | ( | FsCallbacks | callbacks | ) |
Set callbacks to use for filesystem (fs) access and their user data
| void tinygltf::TinyGLTF::SetImageLoader | ( | LoadImageDataFunction | LoadImageData, |
| void * | user_data | ||
| ) |
Set callback to use for loading image data
| void tinygltf::TinyGLTF::SetImageWriter | ( | WriteImageDataFunction | WriteImageData, |
| void * | user_data | ||
| ) |
Set callback to use for writing image data
|
inline |
Set maximum allowed external file size in bytes. Default: 2GB Only effective for built-in ReadWholeFileFunction FS function.
| void tinygltf::TinyGLTF::SetParseStrictness | ( | ParseStrictness | strictness | ) |
Sets the parsing strictness.
|
inline |
Specify whether preserve image channels when loading images or not. (Not effective when the user supplies their own LoadImageData callbacks)
|
inline |
Set serializing default values(default = false). When true, default values are force serialized to .glTF. This may be helpful if you want to serialize a full description of glTF data.
TODO(LTE): Supply parsing option as function arguments to LoadASCIIFromFile() and others, not by a class method
|
inline |
Store original JSON string for extras and extensions. This feature will be useful when the user want to reconstruct custom data structure from JSON string.
| void tinygltf::TinyGLTF::SetURICallbacks | ( | URICallbacks | callbacks | ) |
Set callbacks to use for URI encoding and decoding and their user data
| bool tinygltf::TinyGLTF::WriteGltfSceneToFile | ( | const Model * | model, |
| const std::string & | filename, | ||
| bool | embedImages, | ||
| bool | embedBuffers, | ||
| bool | prettyPrint, | ||
| bool | writeBinary | ||
| ) |
Write glTF to file.
| bool tinygltf::TinyGLTF::WriteGltfSceneToStream | ( | const Model * | model, |
| std::ostream & | stream, | ||
| bool | prettyPrint, | ||
| bool | writeBinary | ||
| ) |
Write glTF to stream, buffers and images will be embedded