• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2014 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_FX_CODEC_H_
8 #define CORE_FXCODEC_FX_CODEC_H_
9 
10 #include <stdint.h>
11 
12 #include "core/fxcrt/span.h"
13 
14 namespace fxcodec {
15 
16 #ifdef PDF_ENABLE_XFA
17 class CFX_DIBAttribute {
18  public:
19   // Not an enum class yet because we still blindly cast integer results
20   // from third-party libraries to this type.
21   enum ResUnit : uint16_t {
22     kResUnitNone = 0,
23     kResUnitInch,
24     kResUnitCentimeter,
25     kResUnitMeter
26   };
27 
28   CFX_DIBAttribute();
29   ~CFX_DIBAttribute();
30 
31   int32_t m_nXDPI = -1;
32   int32_t m_nYDPI = -1;
33   ResUnit m_wDPIUnit = kResUnitNone;
34 };
35 #endif  // PDF_ENABLE_XFA
36 
37 void ReverseRGB(pdfium::span<uint8_t> pDestBuf,
38                 pdfium::span<const uint8_t> pSrcBuf,
39                 int pixels);
40 
41 }  // namespace fxcodec
42 
43 #ifdef PDF_ENABLE_XFA
44 using CFX_DIBAttribute = fxcodec::CFX_DIBAttribute;
45 #endif
46 
47 #endif  // CORE_FXCODEC_FX_CODEC_H_
48