mirror of
https://git.mirrors.martin98.com/https://github.com/syoyo/tinygltf.git
synced 2025-08-02 23:00:42 +08:00
Update README.
Check bit depth when saving image as PNG.
This commit is contained in:
parent
8fd91aea04
commit
e8a46c4e1d
13
README.md
13
README.md
@ -7,6 +7,8 @@ If you are looking for old, C++03 version, please use `devel-picojson` branch.
|
|||||||
|
|
||||||
## Status
|
## Status
|
||||||
|
|
||||||
|
v2.2.0 release(Support loading 16bit PNG)
|
||||||
|
v2.1.0 release(Draco support)
|
||||||
v2.0.0 release(22 Aug, 2018)!
|
v2.0.0 release(22 Aug, 2018)!
|
||||||
|
|
||||||
## Builds
|
## Builds
|
||||||
@ -38,14 +40,15 @@ v2.0.0 release(22 Aug, 2018)!
|
|||||||
* Image(Using stb_image)
|
* Image(Using stb_image)
|
||||||
* [x] Parse BASE64 encoded embedded image data(DataURI).
|
* [x] Parse BASE64 encoded embedded image data(DataURI).
|
||||||
* [x] Load external image file.
|
* [x] Load external image file.
|
||||||
* [x] PNG(8bit only)
|
* [x] Load PNG(8bit and 16bit)
|
||||||
* [x] JPEG(8bit only)
|
* [x] Load JPEG(8bit only)
|
||||||
* [x] BMP
|
* [x] Load BMP
|
||||||
* [x] GIF
|
* [x] Load GIF
|
||||||
* [x] Custom Image decoder callback(e.g. for decoding OpenEXR image)
|
* [x] Custom Image decoder callback(e.g. for decoding OpenEXR image)
|
||||||
* Load from memory
|
* Load from memory
|
||||||
* Custom callback handler
|
* Custom callback handler
|
||||||
* [x] Image load
|
* [x] Image load
|
||||||
|
* [x] Image save
|
||||||
* Extensions
|
* Extensions
|
||||||
* [x] Draco mesh decoding
|
* [x] Draco mesh decoding
|
||||||
|
|
||||||
@ -69,9 +72,11 @@ v2.0.0 release(22 Aug, 2018)!
|
|||||||
* [ ] Mesh Compression/decompression(Open3DGC, etc)
|
* [ ] Mesh Compression/decompression(Open3DGC, etc)
|
||||||
* [x] Load Draco compressed mesh
|
* [x] Load Draco compressed mesh
|
||||||
* [x] Save Draco compressed mesh
|
* [x] Save Draco compressed mesh
|
||||||
|
* [ ] Open3DGC?
|
||||||
* [ ] Support `extensions` and `extras` property
|
* [ ] Support `extensions` and `extras` property
|
||||||
* [ ] HDR image?
|
* [ ] HDR image?
|
||||||
* [ ] OpenEXR extension through TinyEXR.
|
* [ ] OpenEXR extension through TinyEXR.
|
||||||
|
* [ ] 16bit PNG support in Serialization
|
||||||
* [ ] Write example and tests for `animation` and `skin`
|
* [ ] Write example and tests for `animation` and `skin`
|
||||||
* [ ] Skinning
|
* [ ] Skinning
|
||||||
* [ ] Morph targets
|
* [ ] Morph targets
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
// THE SOFTWARE.
|
// THE SOFTWARE.
|
||||||
|
|
||||||
// Version:
|
// Version:
|
||||||
|
// - v2.2.0 Add loading 16bit PNG support.
|
||||||
// - v2.1.0 Add draco compression.
|
// - v2.1.0 Add draco compression.
|
||||||
// - v2.0.1 Add comparsion feature(Thanks to @Selmar).
|
// - v2.0.1 Add comparsion feature(Thanks to @Selmar).
|
||||||
// - v2.0.0 glTF 2.0!.
|
// - v2.0.0 glTF 2.0!.
|
||||||
@ -1772,6 +1773,11 @@ bool WriteImageData(const std::string *basepath, const std::string *filename,
|
|||||||
std::vector<unsigned char> data;
|
std::vector<unsigned char> data;
|
||||||
|
|
||||||
if (ext == "png") {
|
if (ext == "png") {
|
||||||
|
if ((image->bits != 8) || (image->pixel_type != TINYGLTF_COMPONENT_TYPE_UNSIGNED_BYTE)) {
|
||||||
|
// Unsupported pixel format
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (!stbi_write_png_to_func(WriteToMemory_stbi, &data, image->width,
|
if (!stbi_write_png_to_func(WriteToMemory_stbi, &data, image->width,
|
||||||
image->height, image->component,
|
image->height, image->component,
|
||||||
&image->image[0], 0)) {
|
&image->image[0], 0)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user