| 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 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "core/fxge/include/fx_ge.h" | 9 #include "core/fxge/include/fx_ge.h" |
| 10 #include "third_party/base/numerics/safe_math.h" | 10 #include "third_party/base/numerics/safe_math.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 rect.AppendRect((FX_FLOAT)leftPos + x, (FX_FLOAT)topPos + y, | 47 rect.AppendRect((FX_FLOAT)leftPos + x, (FX_FLOAT)topPos + y, |
| 48 (FX_FLOAT)(leftPos + x + 1), (FX_FLOAT)(topPos + y + 1)); | 48 (FX_FLOAT)(leftPos + x + 1), (FX_FLOAT)(topPos + y + 1)); |
| 49 if (m_output->Get(x, y)) { | 49 if (m_output->Get(x, y)) { |
| 50 CFX_GraphStateData data; | 50 CFX_GraphStateData data; |
| 51 device->DrawPath(&rect, &matri, &data, m_barColor, 0, FXFILL_WINDING); | 51 device->DrawPath(&rect, &matri, &data, m_barColor, 0, FXFILL_WINDING); |
| 52 } | 52 } |
| 53 } | 53 } |
| 54 } | 54 } |
| 55 } | 55 } |
| 56 | 56 |
| 57 int32_t CBC_TwoDimWriter::GetErrorCorrectionLevel() { |
| 58 return m_iCorrectLevel; |
| 59 } |
| 60 |
| 57 void CBC_TwoDimWriter::RenderBitmapResult(CFX_DIBitmap*& pOutBitmap, | 61 void CBC_TwoDimWriter::RenderBitmapResult(CFX_DIBitmap*& pOutBitmap, |
| 58 int32_t& e) { | 62 int32_t& e) { |
| 59 if (m_bFixedSize) { | 63 if (m_bFixedSize) { |
| 60 pOutBitmap = CreateDIBitmap(m_Width, m_Height); | 64 pOutBitmap = CreateDIBitmap(m_Width, m_Height); |
| 61 } else { | 65 } else { |
| 62 pOutBitmap = CreateDIBitmap(m_output->GetWidth(), m_output->GetHeight()); | 66 pOutBitmap = CreateDIBitmap(m_output->GetWidth(), m_output->GetHeight()); |
| 63 } | 67 } |
| 64 if (!pOutBitmap) { | 68 if (!pOutBitmap) { |
| 65 e = BCExceptionFailToCreateBitmap; | 69 e = BCExceptionFailToCreateBitmap; |
| 66 return; | 70 return; |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 for (int32_t inputX = 0, outputX = leftPadding; | 143 for (int32_t inputX = 0, outputX = leftPadding; |
| 140 (inputX < inputWidth) && (outputX < outputWidth - multiX); | 144 (inputX < inputWidth) && (outputX < outputWidth - multiX); |
| 141 inputX++, outputX += multiX) { | 145 inputX++, outputX += multiX) { |
| 142 if (code[inputX + inputY * inputWidth] == 1) { | 146 if (code[inputX + inputY * inputWidth] == 1) { |
| 143 m_output->SetRegion(outputX, outputY, multiX, multiY, e); | 147 m_output->SetRegion(outputX, outputY, multiX, multiY, e); |
| 144 BC_EXCEPTION_CHECK_ReturnVoid(e); | 148 BC_EXCEPTION_CHECK_ReturnVoid(e); |
| 145 } | 149 } |
| 146 } | 150 } |
| 147 } | 151 } |
| 148 } | 152 } |
| OLD | NEW |