mirror of
https://git.mirrors.martin98.com/https://github.com/syoyo/tinygltf.git
synced 2025-08-02 06:40:40 +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
|
||||
|
||||
v2.2.0 release(Support loading 16bit PNG)
|
||||
v2.1.0 release(Draco support)
|
||||
v2.0.0 release(22 Aug, 2018)!
|
||||
|
||||
## Builds
|
||||
@ -38,14 +40,15 @@ v2.0.0 release(22 Aug, 2018)!
|
||||
* Image(Using stb_image)
|
||||
* [x] Parse BASE64 encoded embedded image data(DataURI).
|
||||
* [x] Load external image file.
|
||||
* [x] PNG(8bit only)
|
||||
* [x] JPEG(8bit only)
|
||||
* [x] BMP
|
||||
* [x] GIF
|
||||
* [x] Load PNG(8bit and 16bit)
|
||||
* [x] Load JPEG(8bit only)
|
||||
* [x] Load BMP
|
||||
* [x] Load GIF
|
||||
* [x] Custom Image decoder callback(e.g. for decoding OpenEXR image)
|
||||
* Load from memory
|
||||
* Custom callback handler
|
||||
* [x] Image load
|
||||
* [x] Image save
|
||||
* Extensions
|
||||
* [x] Draco mesh decoding
|
||||
|
||||
@ -69,9 +72,11 @@ v2.0.0 release(22 Aug, 2018)!
|
||||
* [ ] Mesh Compression/decompression(Open3DGC, etc)
|
||||
* [x] Load Draco compressed mesh
|
||||
* [x] Save Draco compressed mesh
|
||||
* [ ] Open3DGC?
|
||||
* [ ] Support `extensions` and `extras` property
|
||||
* [ ] HDR image?
|
||||
* [ ] OpenEXR extension through TinyEXR.
|
||||
* [ ] 16bit PNG support in Serialization
|
||||
* [ ] Write example and tests for `animation` and `skin`
|
||||
* [ ] Skinning
|
||||
* [ ] Morph targets
|
||||
|
@ -26,6 +26,7 @@
|
||||
// THE SOFTWARE.
|
||||
|
||||
// Version:
|
||||
// - v2.2.0 Add loading 16bit PNG support.
|
||||
// - v2.1.0 Add draco compression.
|
||||
// - v2.0.1 Add comparsion feature(Thanks to @Selmar).
|
||||
// - 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;
|
||||
|
||||
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,
|
||||
image->height, image->component,
|
||||
&image->image[0], 0)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user