Coverage Report

Created: 2025-08-11 08:01

/src/libheif/libheif/image-items/avif.h
Line
Count
Source (jump to first uncovered line)
1
/*
2
 * HEIF codec.
3
 * Copyright (c) 2017 Dirk Farin <dirk.farin@gmail.com>
4
 *
5
 * This file is part of libheif.
6
 *
7
 * libheif is free software: you can redistribute it and/or modify
8
 * it under the terms of the GNU Lesser General Public License as
9
 * published by the Free Software Foundation, either version 3 of
10
 * the License, or (at your option) any later version.
11
 *
12
 * libheif is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 * GNU Lesser General Public License for more details.
16
 *
17
 * You should have received a copy of the GNU Lesser General Public License
18
 * along with libheif.  If not, see <http://www.gnu.org/licenses/>.
19
 */
20
21
#ifndef HEIF_AVIF_H
22
#define HEIF_AVIF_H
23
24
#include <cassert>
25
#include <cmath>
26
#include <memory>
27
#include <string>
28
#include <vector>
29
30
#include "libheif/heif.h"
31
#include "box.h"
32
#include "error.h"
33
#include "image_item.h"
34
35
36
class ImageItem_AVIF : public ImageItem
37
{
38
public:
39
  ImageItem_AVIF(HeifContext* ctx, heif_item_id id);
40
41
  ImageItem_AVIF(HeifContext* ctx);
42
43
0
  uint32_t get_infe_type() const override { return fourcc("av01"); }
44
45
0
  const char* get_auxC_alpha_channel_type() const override { return "urn:mpeg:mpegB:cicp:systems:auxiliary:alpha"; }
46
47
0
  heif_compression_format get_compression_format() const override { return heif_compression_AV1; }
48
49
0
  heif_brand2 get_compatible_brand() const override { return heif_brand2_avif; }
50
51
  Error initialize_decoder() override;
52
53
  void set_decoder_input_data() override;
54
55
protected:
56
  Result<std::vector<uint8_t>> read_bitstream_configuration_data() const override;
57
58
  Result<std::shared_ptr<class Decoder>> get_decoder() const override;
59
60
  std::shared_ptr<class Encoder> get_encoder() const override;
61
62
private:
63
  std::shared_ptr<class Decoder_AVIF> m_decoder;
64
65
  std::shared_ptr<class Encoder_AVIF> m_encoder;
66
};
67
68
#endif