From 39dbbe2e885a38e8fe18f8b74deafd17d76a61a4 Mon Sep 17 00:00:00 2001 From: Syoyo Fujita Date: Sun, 2 Sep 2018 16:58:43 +0900 Subject: [PATCH] Add as-is flag to Image. Tentative solution for issue #82 --- tiny_gltf.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tiny_gltf.h b/tiny_gltf.h index 6f2855c..05d7097 100644 --- a/tiny_gltf.h +++ b/tiny_gltf.h @@ -458,7 +458,14 @@ struct Image { Value extras; ExtensionMap extensions; - Image() { bufferView = -1; } + // When this flag is true, data is stored to `image` in as-is format(e.g. jpeg compressed for "image/jpeg" mime) + // This feature is good if you use custom image loader function. + // (e.g. delayed decoding of images for faster glTF parsing) + // Default parser for Image does not provide as-is loading feature at the moment. + // (You can manipulate this by providing your own LoadImageData function) + bool as_is; + + Image() : as_is(false) { bufferView = -1; } }; struct Texture {