Conscience Core
Classes | Typedefs | Enumerations | Functions
tinygltf Namespace Reference

Classes

struct  Accessor
 
struct  Animation
 
struct  AnimationChannel
 
struct  AnimationSampler
 
struct  Asset
 
struct  AudioEmitter
 
struct  AudioSource
 
struct  Buffer
 
struct  BufferView
 
struct  Camera
 
struct  FsCallbacks
 
struct  Image
 
struct  Light
 
struct  Material
 
struct  Mesh
 
class  Model
 
class  Node
 
struct  NormalTextureInfo
 
struct  OcclusionTextureInfo
 
struct  OrthographicCamera
 
struct  Parameter
 
struct  PbrMetallicRoughness
 
struct  PerspectiveCamera
 
struct  PositionalEmitter
 
struct  Primitive
 
struct  Sampler
 
struct  Scene
 
struct  Skin
 
struct  SpotLight
 
struct  Texture
 
struct  TextureInfo
 
class  TinyGLTF
 
struct  URICallbacks
 
class  Value
 

Typedefs

using ColorValue = std::array< double, 4 >
 Aggregate object for representing a color. More...
 
typedef std::map< std::string, ParameterParameterMap
 
typedef std::map< std::string, ValueExtensionMap
 
typedef bool(* URIEncodeFunction) (const std::string &in_uri, const std::string &object_type, std::string *out_uri, void *user_data)
 
typedef bool(* URIDecodeFunction) (const std::string &in_uri, std::string *out_uri, void *user_data)
 
typedef bool(* LoadImageDataFunction) (Image *, const int, std::string *, std::string *, int, int, const unsigned char *, int, void *user_pointer)
 
typedef bool(* WriteImageDataFunction) (const std::string *basepath, const std::string *filename, const Image *image, bool embedImages, const URICallbacks *uri_cb, std::string *out_uri, void *user_pointer)
 
typedef bool(* FileExistsFunction) (const std::string &abs_filename, void *)
 
typedef std::string(* ExpandFilePathFunction) (const std::string &, void *)
 
typedef bool(* ReadWholeFileFunction) (std::vector< unsigned char > *, std::string *, const std::string &, void *)
 
typedef bool(* WriteWholeFileFunction) (std::string *, const std::string &, const std::vector< unsigned char > &, void *)
 
typedef bool(* GetFileSizeFunction) (size_t *filesize_out, std::string *err, const std::string &abs_filename, void *userdata)
 

Enumerations

enum  Type {
  NULL_TYPE, REAL_TYPE, INT_TYPE, BOOL_TYPE,
  STRING_TYPE, ARRAY_TYPE, BINARY_TYPE, OBJECT_TYPE
}
 
enum  ParseStrictness { Permissive, Strict }
 
enum  SectionCheck {
  NO_REQUIRE = 0x00, REQUIRE_VERSION = 0x01, REQUIRE_SCENE = 0x02, REQUIRE_SCENES = 0x04,
  REQUIRE_NODES = 0x08, REQUIRE_ACCESSORS = 0x10, REQUIRE_BUFFERS = 0x20, REQUIRE_BUFFER_VIEWS = 0x40,
  REQUIRE_ALL = 0x7f
}
 

Functions

static int32_t GetComponentSizeInBytes (uint32_t componentType)
 
static int32_t GetNumComponentsInType (uint32_t ty)
 
bool IsDataURI (const std::string &in)
 
bool DecodeDataURI (std::vector< unsigned char > *out, std::string &mime_type, const std::string &in, size_t reqBytes, bool checkSize)
 
bool URIDecode (const std::string &in_uri, std::string *out_uri, void *user_data)
 
bool LoadImageData (Image *image, const int image_idx, std::string *err, std::string *warn, int req_width, int req_height, const unsigned char *bytes, int size, void *)
 
bool WriteImageData (const std::string *basepath, const std::string *filename, const Image *image, bool embedImages, const URICallbacks *uri_cb, std::string *out_uri, void *)
 
bool FileExists (const std::string &abs_filename, void *)
 
std::string ExpandFilePath (const std::string &filepath, void *userdata)
 
bool ReadWholeFile (std::vector< unsigned char > *out, std::string *err, const std::string &filepath, void *)
 
bool WriteWholeFile (std::string *err, const std::string &filepath, const std::vector< unsigned char > &contents, void *)
 
bool GetFileSizeInBytes (size_t *filesize_out, std::string *err, const std::string &filepath, void *)
 

Typedef Documentation

◆ ColorValue

using tinygltf::ColorValue = typedef std::array<double, 4>

Aggregate object for representing a color.

◆ ExpandFilePathFunction

typedef std::string(* tinygltf::ExpandFilePathFunction) (const std::string &, void *)

ExpandFilePathFunction type. Signature for custom filesystem callbacks.

◆ ExtensionMap

typedef std::map<std::string, Value> tinygltf::ExtensionMap

◆ FileExistsFunction

typedef bool(* tinygltf::FileExistsFunction) (const std::string &abs_filename, void *)

FilExistsFunction type. Signature for custom filesystem callbacks.

◆ GetFileSizeFunction

typedef bool(* tinygltf::GetFileSizeFunction) (size_t *filesize_out, std::string *err, const std::string &abs_filename, void *userdata)

GetFileSizeFunction type. Signature for custom filesystem callbacks.

◆ LoadImageDataFunction

typedef bool(* tinygltf::LoadImageDataFunction) (Image *, const int, std::string *, std::string *, int, int, const unsigned char *, int, void *user_pointer)

LoadImageDataFunction type. Signature for custom image loading callbacks.

◆ ParameterMap

typedef std::map<std::string, Parameter> tinygltf::ParameterMap

◆ ReadWholeFileFunction

typedef bool(* tinygltf::ReadWholeFileFunction) (std::vector< unsigned char > *, std::string *, const std::string &, void *)

ReadWholeFileFunction type. Signature for custom filesystem callbacks.

◆ URIDecodeFunction

typedef bool(* tinygltf::URIDecodeFunction) (const std::string &in_uri, std::string *out_uri, void *user_data)

URIDecodeFunction type. Signature for custom URI decoding of external resources such as .bin and image files. Used by tinygltf when computing filenames to write resources.

◆ URIEncodeFunction

typedef bool(* tinygltf::URIEncodeFunction) (const std::string &in_uri, const std::string &object_type, std::string *out_uri, void *user_data)

URIEncodeFunction type. Signature for custom URI encoding of external resources such as .bin and image files. Used by tinygltf to re-encode the final location of saved files. object_type may be used to encode buffer and image URIs differently, for example. See https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#uris

◆ WriteImageDataFunction

typedef bool(* tinygltf::WriteImageDataFunction) (const std::string *basepath, const std::string *filename, const Image *image, bool embedImages, const URICallbacks *uri_cb, std::string *out_uri, void *user_pointer)

WriteImageDataFunction type. Signature for custom image writing callbacks. The out_uri parameter becomes the URI written to the gltf and may reference a file or contain a data URI.

◆ WriteWholeFileFunction

typedef bool(* tinygltf::WriteWholeFileFunction) (std::string *, const std::string &, const std::vector< unsigned char > &, void *)

WriteWholeFileFunction type. Signature for custom filesystem callbacks.

Enumeration Type Documentation

◆ ParseStrictness

Enumerator
Permissive 
Strict 

◆ SectionCheck

Enumerator
NO_REQUIRE 
REQUIRE_VERSION 
REQUIRE_SCENE 
REQUIRE_SCENES 
REQUIRE_NODES 
REQUIRE_ACCESSORS 
REQUIRE_BUFFERS 
REQUIRE_BUFFER_VIEWS 
REQUIRE_ALL 

◆ Type

Enumerator
NULL_TYPE 
REAL_TYPE 
INT_TYPE 
BOOL_TYPE 
STRING_TYPE 
ARRAY_TYPE 
BINARY_TYPE 
OBJECT_TYPE 

Function Documentation

◆ DecodeDataURI()

bool tinygltf::DecodeDataURI ( std::vector< unsigned char > *  out,
std::string &  mime_type,
const std::string &  in,
size_t  reqBytes,
bool  checkSize 
)

◆ ExpandFilePath()

std::string tinygltf::ExpandFilePath ( const std::string &  filepath,
void *  userdata 
)

Expand file path(e.g. ~ to home directory on posix, APPDATA% to C:\\Users\\tinygltf\\AppData)

Parameters
[in]filepathFile path string. Assume UTF-8
[in]userdataUser data. Set to nullptr if you don't need it.

◆ FileExists()

bool tinygltf::FileExists ( const std::string &  abs_filename,
void *   
)

◆ GetComponentSizeInBytes()

static int32_t tinygltf::GetComponentSizeInBytes ( uint32_t  componentType)
inlinestatic

◆ GetFileSizeInBytes()

bool tinygltf::GetFileSizeInBytes ( size_t *  filesize_out,
std::string *  err,
const std::string &  filepath,
void *   
)

◆ GetNumComponentsInType()

static int32_t tinygltf::GetNumComponentsInType ( uint32_t  ty)
inlinestatic

◆ IsDataURI()

bool tinygltf::IsDataURI ( const std::string &  in)

◆ LoadImageData()

bool tinygltf::LoadImageData ( Image image,
const int  image_idx,
std::string *  err,
std::string *  warn,
int  req_width,
int  req_height,
const unsigned char *  bytes,
int  size,
void *   
)

◆ ReadWholeFile()

bool tinygltf::ReadWholeFile ( std::vector< unsigned char > *  out,
std::string *  err,
const std::string &  filepath,
void *   
)

◆ URIDecode()

bool tinygltf::URIDecode ( const std::string &  in_uri,
std::string *  out_uri,
void *  user_data 
)

◆ WriteImageData()

bool tinygltf::WriteImageData ( const std::string *  basepath,
const std::string *  filename,
const Image image,
bool  embedImages,
const URICallbacks uri_cb,
std::string *  out_uri,
void *   
)

◆ WriteWholeFile()

bool tinygltf::WriteWholeFile ( std::string *  err,
const std::string &  filepath,
const std::vector< unsigned char > &  contents,
void *   
)