summaryrefslogtreecommitdiff
path: root/fxbarcode/pdf417
AgeCommit message (Collapse)Author
2018-10-24Use ASSERT() consistently. Replace assert() usage.Lei Zhang
ASSERT() is PDFium's wrapper for cross-platform wrapper for assert(). Change-Id: Ie2a98a8e1de101f93aa9bf667d6f125d11d129cd Reviewed-on: https://pdfium-review.googlesource.com/c/44539 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-08-27The final game: mark everything final.Tom Sepez
Then revert the ones that break compilation. Fix one IWYU noticed during presubmit. Change-Id: I881a8a72818e55dbc4816247e35ff5e3015194e7 Reviewed-on: https://pdfium-review.googlesource.com/41470 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-08-23Remove CBC_BarcodeMatrix::m_matrixOut and just return the bit array.Henrique Nakashima
Change-Id: I12893784321f92e5cac2b80653897007b6e63c7e Reviewed-on: https://pdfium-review.googlesource.com/41111 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-08-23Swap width and height params in CBC_BarcodeMatrix constructor.Henrique Nakashima
Change-Id: I74f3a147914c6483e7d443cff70e09115c424ca5 Reviewed-on: https://pdfium-review.googlesource.com/41091 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-08-23Remove m_bTruncated flag from CBC_PDF417Writer.Henrique Nakashima
The flag is unused. Change-Id: I15eb3e20e6a632ae2aa2afc19cb09d2402e607e0 Reviewed-on: https://pdfium-review.googlesource.com/41031 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-08-22Remove m_currentRow from the state of CBC_BarcodeMatrix.Henrique Nakashima
Change-Id: I2003d32f3f6972c0102b37ad545316a76b09fd1f Reviewed-on: https://pdfium-review.googlesource.com/41030 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-08-22Simplify internal state of CBC_BarcodeMatrix.Henrique Nakashima
Change-Id: Icd66f42c240984df6821c2bae640bbfacfa62ad2 Reviewed-on: https://pdfium-review.googlesource.com/41010 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-08-22Remove unused barcode matrix scaling code.Henrique Nakashima
Change-Id: Id15088a40fd308ba91317e95a6fa8075e7306608 Reviewed-on: https://pdfium-review.googlesource.com/40992 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2018-08-22Change in/out params in CBC_PDF417Writer::Encode to only out.Henrique Nakashima
The value passed was always 0. This also prevented the scaling from being executed, so that can be removed. Change-Id: I143a9ed31b231d3b9fa297b0bf9dcc0fa6072889 Reviewed-on: https://pdfium-review.googlesource.com/40990 Reviewed-by: Lei Zhang <thestig@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2018-08-22Remove unused setters in CBC_BarcodeMatrix and CBC_BarcodeRow.Henrique Nakashima
Change-Id: I01c83d96f07eac776e8269b7d1e06b2b07ca75ea Reviewed-on: https://pdfium-review.googlesource.com/40932 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2018-08-21Remove excessive padding above and below PDF417 barcodes.Henrique Nakashima
Bug: pdfium:1135 Change-Id: Iea16a65a5eebcb914192eb49de17a2c4eda83320 Reviewed-on: https://pdfium-review.googlesource.com/40690 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-08-16Allow PDF417 barcodes to reduce modules by shaving off padding.Henrique Nakashima
The way it was working before is: Look at the width and height provided for the barcode. If the maximum number of codewords to fit in that space was within the spec limits (1 <= cols <= 30 and 3 <= rows <= 90), cram as many codewords as possible. The unused space was filled with padding. With this CL, instead look at the amount of content that needs to fit into the barcode and favor fewer codewords rather than as many as possible. Bug: pdfium:1135 Change-Id: Ia96be82ec7c5f4f920cff58def1a44000bf04761 Reviewed-on: https://pdfium-review.googlesource.com/40350 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2018-08-16If rows need to overflow in a PDF417 barcode, keep it to a minimum.Henrique Nakashima
By using mincols as fallback, the exact opposite is done. Maxcols should be used instead to minimize the size. This is important so the next fix (https://pdfium-review.googlesource.com/c/pdfium/+/40350) does not break a test that was working well by coincidence. Bug: pdfium:1135 Change-Id: I95ddc547654966f655e2556c1796503a5456fb8f Reviewed-on: https://pdfium-review.googlesource.com/40330 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-08-16Optimize rendering of two dimensional barcodes: deduplicate regions.Henrique Nakashima
Reduce the logical size of the barcode by removing unnecessary region duplication. As far as I can tell, the line thickness is useless and the aspect ratio causes arbitrary changes in rounding, but ultimately the dimensions of a barcode are defined by its width and height, rather than by this ratio. The improvement with this CL is from ~580ms to ~390ms per barcode, so about 1.5x. Combined with https://pdfium-review.googlesource.com/c/pdfium/+/40010 the improvement is to ~15ms, which is about 39x. This also fixes the rendering of the barcode in the pixel and corpus tests. You can verify this pointing a barcode reader app at the screen. It does not however fix every case, as the unit test is still unreadable. Bug: 872907, pdfium:1135 Change-Id: Ic28e60f54719552cfe69ace7ebc3f730c338a129 Reviewed-on: https://pdfium-review.googlesource.com/40030 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-04-12Tidy up types in CBC_PDF417HighLevelEncoderRyan Harrison
Follow up to request in https://pdfium-review.googlesource.com/c/pdfium/+/30190 BUG=chromium:802242 Change-Id: I8fddd78d235a195c9782c3f6ced428de965e85eb Reviewed-on: https://pdfium-review.googlesource.com/30250 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-04-11Reserve space to reduce memory operations while encoding barcodeRyan Harrison
In the test case from the bug, the majority of the time is being spent resizing Widestring internal buffers, since += is being called in a tight loop. Since the size of the input being mutated and stored is known, this CL reserves the space before hand to lower thrashing. This substantially improves runtime of this test case locally. BUG=chromium:802242 Change-Id: I5176dabc94634b4d6bc3e9425fe6469a5bf35a41 Reviewed-on: https://pdfium-review.googlesource.com/30190 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-02-26Add some more missing consts.chromium/3356Tom Sepez
Get things out of the .data section. Change-Id: I375cf00186a3d5d8d10f5d147bd4b692f5db3683 Reviewed-on: https://pdfium-review.googlesource.com/27130 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-12-01Get rid of else after break/continue/return.chromium/3284chromium/3283Lei Zhang
Change-Id: I3efc57cd7325d16e3ca8ebdeeaec06012b2c56e3 Reviewed-on: https://pdfium-review.googlesource.com/20110 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-09-19IWYU: Explicitly include <stdint.h> in some headers.Raphael Kubo da Costa
While Chromium's clang and libc++ implicitly end up including that header, the build can break with other toolchains (e.g. GCC 7 and its libstdc++) because some headers reference types such as int32_t without including the header that defines them. Change-Id: Ibb2aa3d3b432f4b47f1b8635d0196d4f69cb09a0 Reviewed-on: https://pdfium-review.googlesource.com/14270 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-09-18Convert string class namesRyan Harrison
Automated using git grep & sed. Replace StringC classes with StringView classes. Remove the CFX_ prefix and put string classes in fxcrt namespace. Change AsStringC() to AsStringView(). Rename tests from TEST(fxcrt, *String*Foo) to TEST(*String*, Foo). Couple of tests needed to have their names regularlized. BUG=pdfium:894 Change-Id: I7ca038685c8d803795f3ed02545124f7a224c83d Reviewed-on: https://pdfium-review.googlesource.com/14151 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2017-08-31Remove fx_basic.hDan Sinclair
This CL removes the fx_basic.h header and fixes up includes as needed. Change-Id: I49af32a8327bdbcda40c50a61ffbd75d06609040 Reviewed-on: https://pdfium-review.googlesource.com/12670 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-08-15Remove GetAt from string classesRyan Harrison
This method duplicates the behaviour of the const [] operator and doesn't offer any additional safety. Folding them into one implementation. SetAt is retained, since implementing the non-const [] operator to replace SetAt has potential performance concerns. Specifically many non-obvious cases of reading an element using [] will cause a realloc & copy. BUG=pdfium:860 Change-Id: I3ef5e5e5a15376f040256b646eb0d90636e24b67 Reviewed-on: https://pdfium-review.googlesource.com/10870 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-06-23Cleaning up fx_string_testhelpers.Henrique Nakashima
This is unused except for being a pathway for indirect deps. Change-Id: I717290235ccbc59429ad24231033382958e2a086 Reviewed-on: https://pdfium-review.googlesource.com/6910 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2017-05-02Remove more |new|s, part 7Tom Sepez
Remove some dead code along the way. Move some getters to headers and make const. Change-Id: I14280c247b0cfeff8ad7f606302bc8bba1960f1e Reviewed-on: https://pdfium-review.googlesource.com/4730 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-04-28Remove dead dimensions code in fxbarcode.chromium/3084Lei Zhang
Remove more exceptions. Change-Id: I3b8b8b9837b0010b1e0060ddd56e93c78f9f0fb5 Reviewed-on: https://pdfium-review.googlesource.com/4410 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-04-21Change more fxbarcode to use return values.Lei Zhang
Change-Id: Idcc05fb8c5a1448f552b4db5ae131ad82aef4d59 Reviewed-on: https://pdfium-review.googlesource.com/4258 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-04-18Use Byte/WideString iteratorsTom Sepez
Change-Id: I85c8423c177fd7ecd5da90ef89419efc0f9cf44b Reviewed-on: https://pdfium-review.googlesource.com/4262 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-04-03Drop FXSYS_ from mem methodsDan Sinclair
This Cl drops the FXSYS_ from mem methods which are the same on all platforms. Bug: pdfium:694 Change-Id: I9d5ae905997dbaaec5aa0b2ae4c07358ed9c6236 Reviewed-on: https://pdfium-review.googlesource.com/3613 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-29Move xfa/fxbarcode fxbarcode/Dan Sinclair
Nothing in fxbarcode/ depends on XFA code. This CL moves xfa/fxbarcode to be fxbarcode/ and creates a static_library for fxbarcode which is depend on by the xfa library. Change-Id: I0b708737b07efb94b769a5238d92af92bc62880d Reviewed-on: https://pdfium-review.googlesource.com/3291 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>