OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 // Original code is licensed as follows: | 6 // Original code is licensed as follows: |
7 /* | 7 /* |
8 * Copyright 2009 ZXing authors | 8 * Copyright 2009 ZXing authors |
9 * | 9 * |
10 * Licensed under the Apache License, Version 2.0 (the "License"); | 10 * Licensed under the Apache License, Version 2.0 (the "License"); |
(...skipping 12 matching lines...) Expand all Loading... |
23 #include <memory> | 23 #include <memory> |
24 | 24 |
25 #include "core/fxcodec/codec/include/ccodec_progressivedecoder.h" | 25 #include "core/fxcodec/codec/include/ccodec_progressivedecoder.h" |
26 #include "core/fxcodec/include/fx_codec.h" | 26 #include "core/fxcodec/include/fx_codec.h" |
27 #include "xfa/fxbarcode/BC_BufferedImageLuminanceSource.h" | 27 #include "xfa/fxbarcode/BC_BufferedImageLuminanceSource.h" |
28 #include "xfa/fxbarcode/BC_LuminanceSource.h" | 28 #include "xfa/fxbarcode/BC_LuminanceSource.h" |
29 #include "xfa/fxbarcode/utils.h" | 29 #include "xfa/fxbarcode/utils.h" |
30 | 30 |
31 class CBC_Pause : public IFX_Pause { | 31 class CBC_Pause : public IFX_Pause { |
32 public: | 32 public: |
33 virtual FX_BOOL NeedToPauseNow() { return TRUE; } | 33 // IFX_Pause |
| 34 FX_BOOL NeedToPauseNow() override; |
34 }; | 35 }; |
35 | 36 |
36 static CFX_DIBitmap* CreateDIBSource(IFX_FileRead* fileread) { | 37 static CFX_DIBitmap* CreateDIBSource(IFX_FileRead* fileread) { |
37 std::unique_ptr<CCodec_ModuleMgr> pCodecMgr(new CCodec_ModuleMgr()); | 38 std::unique_ptr<CCodec_ModuleMgr> pCodecMgr(new CCodec_ModuleMgr()); |
38 std::unique_ptr<CCodec_ProgressiveDecoder> pImageCodec( | 39 std::unique_ptr<CCodec_ProgressiveDecoder> pImageCodec( |
39 pCodecMgr->CreateProgressiveDecoder()); | 40 pCodecMgr->CreateProgressiveDecoder()); |
40 FXCODEC_STATUS status = FXCODEC_STATUS_DECODE_FINISH; | 41 FXCODEC_STATUS status = FXCODEC_STATUS_DECODE_FINISH; |
41 status = pImageCodec->LoadImageInfo(fileread, FXCODEC_IMAGE_UNKNOWN, nullptr, | 42 status = pImageCodec->LoadImageInfo(fileread, FXCODEC_IMAGE_UNKNOWN, nullptr, |
42 false); | 43 false); |
43 if (status != FXCODEC_STATUS_FRAME_READY) | 44 if (status != FXCODEC_STATUS_FRAME_READY) |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 int32_t pixel = rgb[offset + x]; | 148 int32_t pixel = rgb[offset + x]; |
148 int32_t luminance = | 149 int32_t luminance = |
149 (306 * ((pixel >> 16) & 0xFF) + 601 * ((pixel >> 8) & 0xFF) + | 150 (306 * ((pixel >> 16) & 0xFF) + 601 * ((pixel >> 8) & 0xFF) + |
150 117 * (pixel & 0xFF)) >> | 151 117 * (pixel & 0xFF)) >> |
151 10; | 152 10; |
152 (*matrix)[offset + x] = (uint8_t)luminance; | 153 (*matrix)[offset + x] = (uint8_t)luminance; |
153 } | 154 } |
154 } | 155 } |
155 return matrix; | 156 return matrix; |
156 } | 157 } |
| 158 |
| 159 FX_BOOL CBC_Pause::NeedToPauseNow() { |
| 160 return TRUE; |
| 161 } |
OLD | NEW |