]> git.cworth.org Git - apitrace/blobdiff - common/image_png.cpp
Relocate tracing (dis/en)enablement.
[apitrace] / common / image_png.cpp
index fd222135becd3af52f0da6006152b8f8d16c0e05..cc6d3f2cc4d7ff6e476db9df609a5148e27a6546 100644 (file)
 #include "image.hpp"
 
 
-namespace Image {
+namespace image {
+
+
+static const int png_compression_level = Z_BEST_SPEED;
 
 
 bool
@@ -89,7 +92,7 @@ Image::writePNG(const char *filename) const {
     png_set_IHDR(png_ptr, info_ptr, width, height, 8, color_type,
         PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
 
-    png_set_compression_level(png_ptr, Z_DEFAULT_COMPRESSION);
+    png_set_compression_level(png_ptr, png_compression_level);
 
     png_write_info(png_ptr, info_ptr);
 
@@ -275,7 +278,7 @@ bool writePixelsToBuffer(unsigned char *pixels,
                  type, PNG_INTERLACE_NONE,
                  PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
 
-    png_set_compression_level(png_ptr, Z_DEFAULT_COMPRESSION);
+    png_set_compression_level(png_ptr, png_compression_level);
 
     png_write_info(png_ptr, info_ptr);
 
@@ -309,4 +312,4 @@ no_png:
     return false;
 }
 
-} /* namespace Image */
+} /* namespace image */