SHOGUN  v2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Compressor.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * Written (W) 2009 Soeren Sonnenburg
8  * Copyright (C) 2009 Berlin Institute of Technology
9  */
10 #ifndef __COMPRESSOR_H__
11 #define __COMPRESSOR_H__
12 
13 #include <shogun/lib/config.h>
14 #include <shogun/lib/common.h>
15 #include <shogun/base/SGObject.h>
16 #include <shogun/io/SGIO.h>
17 
18 #ifdef USE_LZO
19 #include <lzo/lzoconf.h>
20 #include <lzo/lzo1x.h>
21 #endif
22 
23 namespace shogun
24 {
27  {
29  LZO,
34  };
35 
36 
49  class CCompressor : public CSGObject
50  {
51  public:
53  CCompressor();
54 
60  {
61  }
62 
64  virtual ~CCompressor()
65  {
66  }
67 
79  void compress(uint8_t* uncompressed, uint64_t uncompressed_size,
80  uint8_t* &compressed, uint64_t &compressed_size, int32_t level=1);
81 
94  void decompress(uint8_t* compressed, uint64_t compressed_size,
95  uint8_t* uncompressed, uint64_t& uncompressed_size);
96 
98  inline virtual const char* get_name() const { return "Compressor"; }
99 
100  protected:
103  };
104 }
105 #endif //__COMPRESSOR_H__

SHOGUN Machine Learning Toolbox - Documentation