Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(371)

Side by Side Diff: xfa/fxbarcode/BC_BufferedImageLuminanceSource.cpp

Issue 1882043004: Remove implicit cast from CFX_WideString to (const wchar_t*) (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: win error #2 Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « xfa/fwl/theme/cfwl_widgettp.cpp ('k') | xfa/fxfa/app/xfa_ffdoc.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 const CFX_WideString& filename) 92 const CFX_WideString& filename)
93 : CBC_LuminanceSource(0, 0), m_filename(filename) { 93 : CBC_LuminanceSource(0, 0), m_filename(filename) {
94 m_height = 0; 94 m_height = 0;
95 m_width = 0; 95 m_width = 0;
96 m_bytesPerLine = 0; 96 m_bytesPerLine = 0;
97 m_top = 0; 97 m_top = 0;
98 m_left = 0; 98 m_left = 0;
99 } 99 }
100 100
101 void CBC_BufferedImageLuminanceSource::Init(int32_t& e) { 101 void CBC_BufferedImageLuminanceSource::Init(int32_t& e) {
102 IFX_FileRead* fileread = FX_CreateFileRead(m_filename); 102 IFX_FileRead* fileread = FX_CreateFileRead(m_filename.c_str());
103 m_pBitmap = CreateDIBSource(fileread); 103 m_pBitmap = CreateDIBSource(fileread);
104 if (!m_pBitmap) { 104 if (!m_pBitmap) {
105 e = BCExceptionLoadFile; 105 e = BCExceptionLoadFile;
106 return; 106 return;
107 } 107 }
108 m_pBitmap->ConvertFormat(FXDIB_Argb); 108 m_pBitmap->ConvertFormat(FXDIB_Argb);
109 m_height = m_pBitmap->GetHeight(); 109 m_height = m_pBitmap->GetHeight();
110 m_width = m_pBitmap->GetWidth(); 110 m_width = m_pBitmap->GetWidth();
111 m_rgbData.SetSize(m_height * m_width); 111 m_rgbData.SetSize(m_height * m_width);
112 m_bytesPerLine = m_width * 4; 112 m_bytesPerLine = m_width * 4;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 int32_t pixel = rgb[offset + x]; 169 int32_t pixel = rgb[offset + x];
170 int32_t luminance = 170 int32_t luminance =
171 (306 * ((pixel >> 16) & 0xFF) + 601 * ((pixel >> 8) & 0xFF) + 171 (306 * ((pixel >> 16) & 0xFF) + 601 * ((pixel >> 8) & 0xFF) +
172 117 * (pixel & 0xFF)) >> 172 117 * (pixel & 0xFF)) >>
173 10; 173 10;
174 (*matirx)[offset + x] = (uint8_t)luminance; 174 (*matirx)[offset + x] = (uint8_t)luminance;
175 } 175 }
176 } 176 }
177 return matirx; 177 return matirx;
178 } 178 }
OLDNEW
« no previous file with comments | « xfa/fwl/theme/cfwl_widgettp.cpp ('k') | xfa/fxfa/app/xfa_ffdoc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698