summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2017-01-04 21:31:56 +0100
committerWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2017-01-04 22:09:26 +0100
commita57394a0be5e601c447a07786487bd4c34b0d899 (patch)
tree1fb85dda43d385a34a15bb345a503b761dc0bdf0 /packages
parent0fa5925b0a6ef96bdddee7328aa007fdb6c23b36 (diff)
downloadframeworks_base-a57394a0be5e601c447a07786487bd4c34b0d899.zip
frameworks_base-a57394a0be5e601c447a07786487bd4c34b0d899.tar.gz
frameworks_base-a57394a0be5e601c447a07786487bd4c34b0d899.tar.bz2
Camera: Working barcode scanning with software rendering
Barcode scanner apps expect YUV as preview format. However, the software renderer cannot handle YUV. Thus, RGB 565 is used. Barcode scanner apps only need the first plane Y which is basically greyscale. The solution is a conversion from RGB to greyscale of preview frames that are requested by apps for processing. Apps request preview frames via onPreviewFrame(). The conversion is done using native code for optimal speed. The conversion algorithm is based on the implementations in the RGBLuminanceSource class of ZXing[1] and the RGB565LuminanceSource class of FastBarcodeScanner[2]. Signed-off-by: Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de> [1] https://github.com/zxing/zxing/blob/cc16a72c85e4958ce406af9547764e5eee9adb6e/core/src/main/java/com/google/zxing/RGBLuminanceSource.java [2] https://github.com/tschaumburg/FastBarcodeScanner/blob/5a4c166a722730d0099d4c6a1c15d312b93547da/tracking-barcode-scanner/src/main/java/dk/schaumburgit/trackingbarcodescanner/RGB565LuminanceSource.java
Diffstat (limited to 'packages')
0 files changed, 0 insertions, 0 deletions