| 49 | } |
| 50 | |
| 51 | bool NewBitmap::saveAsPNG(const char *filePath) { |
| 52 | // TODO: Support more formats? stb_write supports at least RGB and RGBA |
| 53 | ASSERT(_format == PixelDataFormat::RGBA32); |
| 54 | |
| 55 | stbi_flip_vertically_on_write(_flippedY); |
| 56 | return stbi_write_png(filePath, _w, _h, getNumComponents(), _data.get(), getStride()) == 0; |
| 57 | } |