1 2 /* 3 * Copyright 2010 The Android Open Source Project 4 * 5 * Use of this source code is governed by a BSD-style license that can be 6 * found in the LICENSE file. 7 */ 8 9 10 #ifndef SkFlate_DEFINED 11 #define SkFlate_DEFINED 12 13 #include "SkTypes.h" 14 15 class SkData; 16 class SkWStream; 17 class SkStream; 18 19 /** \class SkFlate 20 A class to provide access to the flate compression algorithm. 21 */ 22 class SkFlate { 23 public: 24 /** Indicates if the flate algorithm is available. 25 */ 26 static bool HaveFlate(); 27 28 /** 29 * Use the flate compression algorithm to compress the data in src, 30 * putting the result into dst. Returns false if an error occurs. 31 */ 32 static bool Deflate(SkStream* src, SkWStream* dst); 33 34 /** 35 * Use the flate compression algorithm to compress the data in src, 36 * putting the result into dst. Returns false if an error occurs. 37 */ 38 static bool Deflate(const void* src, size_t len, SkWStream* dst); 39 40 /** 41 * Use the flate compression algorithm to compress the data, 42 * putting the result into dst. Returns false if an error occurs. 43 */ 44 static bool Deflate(const SkData*, SkWStream* dst); 45 46 /** Use the flate compression algorithm to decompress the data in src, 47 putting the result into dst. Returns false if an error occurs. 48 */ 49 static bool Inflate(SkStream* src, SkWStream* dst); 50 }; 51 52 #endif 53