1 // Copyright 2018 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //     https://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef ASTC_CODEC_DECODER_CODEC_H_
16 #define ASTC_CODEC_DECODER_CODEC_H_
17 
18 #include "src/decoder/astc_file.h"
19 #include "src/decoder/footprint.h"
20 
21 #include <string>
22 
23 namespace astc_codec {
24 
25 // Decompresses ASTC blocks to an image buffer.
26 // Returns true if the decompression succeeded and the out buffer has been
27 // filled.
28 bool DecompressToImage(const uint8_t* astc_data, size_t astc_data_size,
29                        size_t width, size_t height, Footprint footprint,
30                        uint8_t* out_buffer, size_t out_buffer_size,
31                        size_t out_buffer_stride);
32 
33 // Decompresses an ASTC file to an image buffer.
34 // Returns true if the decompression succeeded and the out buffer has been
35 // filled.
36 bool DecompressToImage(const ASTCFile& file, uint8_t* out_buffer,
37                        size_t out_buffer_size, size_t out_buffer_stride);
38 
39 }  // namespace astc_codec
40 
41 #endif  // ASTC_CODEC_DECODER_CODEC_H_
42