2011-07-28 14:26:00 +00:00
|
|
|
|
2010-12-01 22:17:20 +00:00
|
|
|
/*
|
2011-07-28 14:26:00 +00:00
|
|
|
* Copyright 2010 The Android Open Source Project
|
2010-12-01 22:17:20 +00:00
|
|
|
*
|
2011-07-28 14:26:00 +00:00
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
2010-12-01 22:17:20 +00:00
|
|
|
*/
|
|
|
|
|
2011-07-28 14:26:00 +00:00
|
|
|
|
2010-12-01 22:17:20 +00:00
|
|
|
#ifndef SkFlate_DEFINED
|
|
|
|
#define SkFlate_DEFINED
|
|
|
|
|
|
|
|
#include "SkTypes.h"
|
|
|
|
|
2011-06-27 17:41:22 +00:00
|
|
|
class SkData;
|
2011-06-24 20:45:40 +00:00
|
|
|
class SkWStream;
|
2010-12-01 22:17:20 +00:00
|
|
|
class SkStream;
|
|
|
|
|
|
|
|
/** \class SkFlate
|
|
|
|
A class to provide access to the flate compression algorithm.
|
|
|
|
*/
|
|
|
|
class SkFlate {
|
|
|
|
public:
|
|
|
|
/** Indicates if the flate algorithm is available.
|
|
|
|
*/
|
|
|
|
static bool HaveFlate();
|
|
|
|
|
2011-06-27 17:41:22 +00:00
|
|
|
/**
|
|
|
|
* Use the flate compression algorithm to compress the data in src,
|
|
|
|
* putting the result into dst. Returns false if an error occurs.
|
2010-12-01 22:17:20 +00:00
|
|
|
*/
|
2011-06-24 20:45:40 +00:00
|
|
|
static bool Deflate(SkStream* src, SkWStream* dst);
|
2012-08-23 18:09:54 +00:00
|
|
|
|
2011-06-27 17:41:22 +00:00
|
|
|
/**
|
|
|
|
* Use the flate compression algorithm to compress the data in src,
|
|
|
|
* putting the result into dst. Returns false if an error occurs.
|
|
|
|
*/
|
|
|
|
static bool Deflate(const void* src, size_t len, SkWStream* dst);
|
2012-08-23 18:09:54 +00:00
|
|
|
|
2011-06-27 17:41:22 +00:00
|
|
|
/**
|
|
|
|
* Use the flate compression algorithm to compress the data,
|
|
|
|
* putting the result into dst. Returns false if an error occurs.
|
|
|
|
*/
|
|
|
|
static bool Deflate(const SkData*, SkWStream* dst);
|
2012-08-23 18:09:54 +00:00
|
|
|
|
2010-12-01 22:17:20 +00:00
|
|
|
/** Use the flate compression algorithm to decompress the data in src,
|
|
|
|
putting the result into dst. Returns false if an error occurs.
|
|
|
|
*/
|
2011-06-24 20:45:40 +00:00
|
|
|
static bool Inflate(SkStream* src, SkWStream* dst);
|
2010-12-01 22:17:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|