michael@0: michael@0: /* michael@0: * Copyright 2010 The Android Open Source Project michael@0: * michael@0: * Use of this source code is governed by a BSD-style license that can be michael@0: * found in the LICENSE file. michael@0: */ michael@0: michael@0: michael@0: #ifndef SkFlate_DEFINED michael@0: #define SkFlate_DEFINED michael@0: michael@0: #include "SkTypes.h" michael@0: michael@0: class SkData; michael@0: class SkWStream; michael@0: class SkStream; michael@0: michael@0: /** \class SkFlate michael@0: A class to provide access to the flate compression algorithm. michael@0: */ michael@0: class SkFlate { michael@0: public: michael@0: /** Indicates if the flate algorithm is available. michael@0: */ michael@0: static bool HaveFlate(); michael@0: michael@0: /** michael@0: * Use the flate compression algorithm to compress the data in src, michael@0: * putting the result into dst. Returns false if an error occurs. michael@0: */ michael@0: static bool Deflate(SkStream* src, SkWStream* dst); michael@0: michael@0: /** michael@0: * Use the flate compression algorithm to compress the data in src, michael@0: * putting the result into dst. Returns false if an error occurs. michael@0: */ michael@0: static bool Deflate(const void* src, size_t len, SkWStream* dst); michael@0: michael@0: /** michael@0: * Use the flate compression algorithm to compress the data, michael@0: * putting the result into dst. Returns false if an error occurs. michael@0: */ michael@0: static bool Deflate(const SkData*, SkWStream* dst); michael@0: michael@0: /** Use the flate compression algorithm to decompress the data in src, michael@0: putting the result into dst. Returns false if an error occurs. michael@0: */ michael@0: static bool Inflate(SkStream* src, SkWStream* dst); michael@0: }; michael@0: michael@0: #endif