xref: /aosp_15_r20/external/pdfium/core/fxcodec/bmp/bmp_progressive_decoder.h (revision 3ac0a46f773bac49fa9476ec2b1cf3f8da5ec3a4)
1 // Copyright 2020 The PDFium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 
7 #ifndef CORE_FXCODEC_BMP_BMP_PROGRESSIVE_DECODER_H_
8 #define CORE_FXCODEC_BMP_BMP_PROGRESSIVE_DECODER_H_
9 
10 #include "core/fxcodec/progressive_decoder_iface.h"
11 #include "third_party/base/no_destructor.h"
12 
13 #ifndef PDF_ENABLE_XFA_BMP
14 #error "BMP must be enabled"
15 #endif
16 
17 namespace fxcodec {
18 
19 class BmpProgressiveDecoder final : public ProgressiveDecoderIface {
20  public:
21   static BmpProgressiveDecoder* GetInstance();
22 
23   // ProgressiveDecoderIface:
24   FX_FILESIZE GetAvailInput(Context* context) const override;
25   bool Input(Context* context,
26              RetainPtr<CFX_CodecMemory> codec_memory) override;
27 
28  private:
29   friend pdfium::base::NoDestructor<BmpProgressiveDecoder>;
30 
31   BmpProgressiveDecoder();
32   ~BmpProgressiveDecoder() override;
33 };
34 
35 }  // namespace fxcodec
36 
37 using BmpProgressiveDecoder = fxcodec::BmpProgressiveDecoder;
38 
39 #endif  // CORE_FXCODEC_BMP_BMP_PROGRESSIVE_DECODER_H_
40