| 1 | /* |
| 2 | Copyright 2021 - 2026 Esri |
| 3 | |
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | |
| 16 | A local copy of the license and additional notices are located with the |
| 17 | source distribution at: |
| 18 | |
| 19 | http://github.com/Esri/lerc/ |
| 20 | |
| 21 | Analytical Raster Compression. |
| 22 | Original coding 2021 Yuriy Yakimenko |
| 23 | */ |
| 24 | |
| 25 | #ifndef FPL_COMPRESSION_H |
| 26 | #define FPL_COMPRESSION_H |
| 27 | |
| 28 | #include <cstddef> |
| 29 | #include "Defines.h" |
| 30 | |
| 31 | NAMESPACE_LERC_START |
| 32 | |
| 33 | #define PRIME_MULT 7 |
| 34 | |
| 35 | class fpl_Compression |
| 36 | { |
| 37 | public: |
| 38 | static size_t compress_buffer(const char* data, size_t size, char** output, bool fast = false); |
| 39 | static size_t extract_buffer(const char* data, const size_t size, size_t uncompressed_size, char** output = 0); |
| 40 | |
| 41 | private: |
| 42 | static long getEntropySize(const unsigned char* ptr, const size_t size); |
| 43 | }; |
| 44 | |
| 45 | NAMESPACE_LERC_END |
| 46 | #endif |