Skip to content

Commit

Permalink
Cleanup backends
Browse files Browse the repository at this point in the history
  • Loading branch information
emericg committed Feb 28, 2024
1 parent 4b51126 commit 42709b6
Show file tree
Hide file tree
Showing 17 changed files with 374 additions and 303 deletions.
4 changes: 3 additions & 1 deletion assets/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ android {
exclude 'lib/*/*_Controls_Fusion_*'
exclude 'lib/*/*_Controls_Imagine_*'
exclude 'lib/*/*_Controls_Universal_*'

// image formats
exclude 'lib/*/*_imageformats_qgif_*'
exclude 'lib/*/*_imageformats_qico_*'
Expand All @@ -107,8 +108,9 @@ android {
exclude 'lib/*/*_imageformats_qtiff_*'
exclude 'lib/*/*_imageformats_qwbmp_*'
//exclude 'lib/*/*_imageformats_qwebp_*'

// multimedia backend
//exclude 'lib/*/*_multimedia_androidmediaplugin_*'
exclude 'lib/*/*_multimedia_ffmpegmediaplugin_*'
//exclude 'lib/*/*_multimedia_ffmpegmediaplugin_*'
}
}
2 changes: 1 addition & 1 deletion qml/MobileHeader.qml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Rectangle {

property int headerHeight: 52

property int headerPosition: 64
property int headerPosition: 60

property string headerTitle: utilsApp.appName()

Expand Down
8 changes: 4 additions & 4 deletions qml/Reader_QZXing.qml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ import ThemeEngine
QZXingFilter {
id: barcodeReader

property real timePerFrameDecode: 0
property int framesDecodedTotal: 0
property var framesDecodedTable: []

videoSink: videoOutput.videoSink
captureRect: settingsManager.scan_fullscreen ?
Qt.rect(videoOutput.sourceRect.x, videoOutput.sourceRect.y,
Expand All @@ -17,10 +21,6 @@ QZXingFilter {
videoOutput.sourceRect.width * videoOutput.captureRectFactorWidth,
videoOutput.sourceRect.height * videoOutput.captureRectFactorHeight)

property real timePerFrameDecode: 0
property int framesDecodedTotal: 0
property var framesDecodedTable: []

decoder {
tryHarder: settingsManager.scan_tryHarder
enabledDecoders: settingsManager.formatsEnabled
Expand Down
18 changes: 9 additions & 9 deletions qml/Reader_ZXingCpp.qml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ import ThemeEngine
ZXingCppVideoFilter {
id: barcodeReader

property real timePerFrameDecode: 0
property int framesDecodedTotal: 0
property var framesDecodedTable: []

videoSink: videoOutput.videoSink
captureRect: settingsManager.scan_fullscreen ?
Qt.rect(videoOutput.sourceRect.x, videoOutput.sourceRect.y,
Expand All @@ -17,6 +21,11 @@ ZXingCppVideoFilter {
videoOutput.sourceRect.width * videoOutput.captureRectFactorWidth,
videoOutput.sourceRect.height * videoOutput.captureRectFactorHeight)

tryHarder: settingsManager.scan_tryHarder
tryRotate: settingsManager.scan_tryRotate
tryInvert: settingsManager.scan_tryInvert
tryDownscale: settingsManager.scan_tryDownscale

formats: settingsManager.formatsEnabled
/*
formats: ZXingCpp.LinearCodes | ZXingCpp.MatrixCodes
Expand All @@ -32,15 +41,6 @@ ZXingCppVideoFilter {
ZXingCpp.PDF417 |
ZXingCpp.QRCode | ZXingCpp.MicroQRCode
*/
tryHarder: settingsManager.scan_tryHarder
tryRotate: settingsManager.scan_tryRotate
tryInvert: settingsManager.scan_tryInvert
tryDownscale: settingsManager.scan_tryDownscale

property real timePerFrameDecode: 0
property int framesDecodedTotal: 0
property var framesDecodedTable: []

function mapPointToItem(point) {
//console.log("mapPointToItem(" + point + ")")

Expand Down
42 changes: 23 additions & 19 deletions qml/ScreenBarcodeReader.qml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Loader {
appContent.state = "ScreenBarcodeReader"

mobileUI.setScreenAlwaysOn(true)

screenBarcodeReader.active = true

if (screenBarcodeReader.status === Loader.Ready)
Expand Down Expand Up @@ -144,7 +145,6 @@ Loader {

onCameraDeviceChanged: {
console.log("CaptureSession::onCameraDeviceChanged()")
//cameraFormat = utilsCamera.selectCameraFormat(mediaDevices.selectedDevice)
}
onErrorOccurred: (errorString) => {
console.log("CaptureSession::onErrorOccurred() " + errorString)
Expand All @@ -170,8 +170,8 @@ Loader {

orientation: 0

// Stretch / PreserveAspectFit / PreserveAspectCrop
fillMode: VideoOutput.PreserveAspectCrop
//fillMode: VideoOutput.PreserveAspectFit

// Capture rectangle
property double captureRectStartFactorX: 0.05
Expand All @@ -182,7 +182,8 @@ Loader {
////

function printInfos() {
console.log("> Camera > " + mediaDevices.selectedDevice.description)
console.log("> Camera > " + mediaDevices.videoInputs[mediaDevices.selectedDevice].description)

console.log("- videoOutput sz: " + videoOutput.x + "," + videoOutput.y + " - " + videoOutput.width + "x" + videoOutput.height)
console.log("- videoOutput2sz: (SCALED) " + videoOutput.x*utilsScreen.screenPar + "," + videoOutput.y*utilsScreen.screenPar + " - " +
videoOutput.width*utilsScreen.screenPar + "x" + videoOutput.height*utilsScreen.screenPar)
Expand Down Expand Up @@ -365,8 +366,8 @@ Loader {
visible: false
source: ""

// Stretch / PreserveAspectFit / PreserveAspectCrop
fillMode: VideoOutput.PreserveAspectFit
//fillMode: VideoOutput.PreserveAspectCrop

////

Expand Down Expand Up @@ -416,9 +417,20 @@ Loader {
id: overlays
anchors.fill: parent

MouseArea {
anchors.fill: parent
enabled: (menuDebug.visible || menuFormats.visible || menuCamera.visible || menuScreens.visible)
onClicked: {
menuDebug.visible = false
menuFormats.visible = false
menuCamera.visible = false
menuScreens.visible = false
}
}

////////

Item { // debug infos
Item { // debug infos (top/left)
anchors.top: parent.top
anchors.topMargin: Theme.componentMargin + Math.max(screenPaddingTop, screenPaddingStatusbar)
anchors.left: parent.left
Expand Down Expand Up @@ -448,18 +460,8 @@ Loader {

////////

MouseArea {
anchors.fill: parent
enabled: (menuDebug.visible || menuFormats.visible || menuCamera.visible || menuScreens.visible)
onClicked: {
menuDebug.visible = false
menuFormats.visible = false
menuCamera.visible = false
menuScreens.visible = false
}
}
Row { // top/right menu
id: toprightmenu
Row { // menus (top/right)
id: toprightmenus
anchors.top: parent.top
anchors.topMargin: Theme.componentMargin + Math.max(screenPaddingStatusbar, screenPaddingTop)
anchors.right: parent.right
Expand Down Expand Up @@ -667,6 +669,8 @@ Loader {
////
}

////////

MenuDebug {
id: menuDebug
}
Expand All @@ -683,8 +687,8 @@ Loader {

////////

Column { // bottom menu
id: bottomemnu
Column { // bottom menus
id: bottomemnus
anchors.left: parent.left
anchors.leftMargin: Theme.componentMarginXL
anchors.right: parent.right
Expand Down
32 changes: 16 additions & 16 deletions qml/ScreenBarcodeWriter.qml
Original file line number Diff line number Diff line change
Expand Up @@ -371,24 +371,24 @@ Loader {
id: lmSelectorBarcodes_zintqml

// matrix
ListElement { idx: 0; type: "2d"; txt: "QrCode"; format: "qrcode"; maxnum: 0; maxchar: 4296; maxbytes: 2953; ecc: 4; }
ListElement { idx: 1; type: "2d"; txt: "µQrCode"; format: "microqrcode"; maxnum: 0; maxchar: 21; maxbytes: 256; ecc: 4; }
ListElement { idx: 2; type: "2d"; txt: "rect. µQrCode"; format: "rmqr"; maxnum: 0; maxchar: 21; maxbytes: 256; ecc: 4; }
ListElement { idx: 3; type: "2d"; txt: "Aztec"; format: "aztec"; maxnum: 0; maxchar: 3067; maxbytes: 3067; ecc: 8; }
ListElement { idx: 4; type: "2d"; txt: "DataMatrix"; format: "datamatrix"; maxnum: 0; maxchar: 2335; maxbytes: 1556; ecc: 0; }
ListElement { idx: 5; type: "2d"; txt: "PDF417"; format: "pdf417"; maxnum: 0; maxchar: 1850; maxbytes: 1108; ecc: 8; }
ListElement { idx: 6; type: "2d"; txt: "µPDF417"; format: "micropdf417"; maxnum: 0; maxchar: 256; maxbytes: 1108; ecc: 8; }
ListElement { idx: 7; type: "2d"; txt: "GridMatrix"; format: "gridmatrix"; maxnum: 0; maxchar: 2335; maxbytes: 1556; ecc: 0; }
ListElement { idx: 0; type: "2d"; txt: "QrCode"; format: "qrcode"; maxnum: 0; maxchar: 4296; maxbytes: 2953; ecc: 4; }
ListElement { idx: 1; type: "2d"; txt: "µQrCode"; format: "microqrcode"; maxnum: 0; maxchar: 21; maxbytes: 256; ecc: 4; }
ListElement { idx: 2; type: "2d"; txt: "rect. µQrCode"; format: "rmqr"; maxnum: 0; maxchar: 21; maxbytes: 256; ecc: 4; }
ListElement { idx: 3; type: "2d"; txt: "Aztec"; format: "aztec"; maxnum: 0; maxchar: 3067; maxbytes: 3067; ecc: 8; }
ListElement { idx: 4; type: "2d"; txt: "DataMatrix"; format: "datamatrix"; maxnum: 0; maxchar: 2335; maxbytes: 1556; ecc: 0; }
ListElement { idx: 5; type: "2d"; txt: "PDF417"; format: "pdf417"; maxnum: 0; maxchar: 1850; maxbytes: 1108; ecc: 8; }
ListElement { idx: 6; type: "2d"; txt: "µPDF417"; format: "micropdf417"; maxnum: 0; maxchar: 256; maxbytes: 1108; ecc: 8; }
ListElement { idx: 7; type: "2d"; txt: "GridMatrix"; format: "gridmatrix"; maxnum: 0; maxchar: 2335; maxbytes: 1556; ecc: 0; }
// esoteric (but fun)
ListElement { idx: 8; type: "2d"; txt: "DotCode"; format: "dotcode"; maxnum: 0; maxchar: 2335; maxbytes: 1556; ecc: 0; }
ListElement { idx: 9; type: "2d"; txt: "MaxiCode"; format: "maxicode"; maxnum: 0; maxchar: 2335; maxbytes: 1556; ecc: 0; }
ListElement { idx: 10; type: "2d"; txt: "UltraCode"; format: "ultracode"; maxnum: 0; maxchar: 2335; maxbytes: 1556; ecc: 0; }
ListElement { idx: 11; type: "2d"; txt: "Code One"; format: "codeone"; maxnum: 0; maxchar: 2335; maxbytes: 1556; ecc: 0; }
ListElement { idx: 8; type: "2d"; txt: "DotCode"; format: "dotcode"; maxnum: 0; maxchar: 2335; maxbytes: 1556; ecc: 0; }
ListElement { idx: 9; type: "2d"; txt: "MaxiCode"; format: "maxicode"; maxnum: 0; maxchar: 2335; maxbytes: 1556; ecc: 0; }
ListElement { idx: 10; type: "2d"; txt: "UltraCode"; format: "ultracode"; maxnum: 0; maxchar: 2335; maxbytes: 1556; ecc: 0; }
ListElement { idx: 11; type: "2d"; txt: "Code One"; format: "codeone"; maxnum: 0; maxchar: 2335; maxbytes: 1556; ecc: 0; }
// esoteric (but not particularly fun)
//ListElement { idx: 8; type: "2d"; txt: "HanXin"; format: "hanxin"; maxnum: 0; maxchar: 2335; maxbytes: 1556; ecc: 0; }
//ListElement { idx: 9; type: "2d"; txt: "Code 49"; format: "code49"; maxnum: 0; maxchar: 2335; maxbytes: 1556; ecc: 0; }
//ListElement { idx: 10; type: "2d"; txt: "Code 16k"; format: "code16k"; maxnum: 0; maxchar: 2335; maxbytes: 1556; ecc: 0; }
//ListElement { idx: 11; type: "2d"; txt: "Codablock F"; format: "codablockf"; maxnum: 0; maxchar: 2335; maxbytes: 1556; ecc: 0; }
//ListElement { idx: 8; type: "2d"; txt: "HanXin"; format: "hanxin"; maxnum: 0; maxchar: 2335; maxbytes: 1556; ecc: 0; }
//ListElement { idx: 9; type: "2d"; txt: "Code 49"; format: "code49"; maxnum: 0; maxchar: 2335; maxbytes: 1556; ecc: 0; }
//ListElement { idx: 10; type: "2d"; txt: "Code 16k"; format: "code16k"; maxnum: 0; maxchar: 2335; maxbytes: 1556; ecc: 0; }
//ListElement { idx: 11; type: "2d"; txt: "Codablock F"; format: "codablockf"; maxnum: 0; maxchar: 2335; maxbytes: 1556; ecc: 0; }
}
ListModel {
id: lmSelectorBarcodes_zxingcpp
Expand Down
8 changes: 5 additions & 3 deletions qml/components/MenuCamera.qml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import ThemeEngine 1.0

Column {
id: cameraCol
anchors.top: toprightmenu.bottom
anchors.top: toprightmenus.bottom
anchors.topMargin: Theme.componentMargin
anchors.right: toprightmenu.right
anchors.right: toprightmenus.right

width: singleColumn ? screenBarcodeReader.width - Theme.componentMargin*2 : 320
spacing: Theme.componentMargin
Expand All @@ -16,10 +16,12 @@ Column {
Repeater {
model: mediaDevices.videoInputs

Item {
delegate: Item {
width: parent.width
height: 40

//required property var modelData

Rectangle {
anchors.fill: parent
radius: 24
Expand Down
4 changes: 2 additions & 2 deletions qml/components/MenuDebug.qml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import ThemeEngine 1.0

Column {
id: debugCol
anchors.top: toprightmenu.bottom
anchors.top: toprightmenus.bottom
anchors.topMargin: Theme.componentMargin
anchors.right: toprightmenu.right
anchors.right: toprightmenus.right

width: singleColumn ? screenBarcodeReader.width - Theme.componentMargin*2 : 300
spacing: Theme.componentMargin / 2
Expand Down
38 changes: 19 additions & 19 deletions qml/components/MenuFormats.qml
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,42 @@ import ThemeEngine 1.0

Column {
id: formatsCol
anchors.top: toprightmenu.bottom
anchors.top: toprightmenus.bottom
anchors.topMargin: Theme.componentMargin
anchors.right: toprightmenu.right
anchors.right: toprightmenus.right

width: singleColumn ? screenBarcodeReader.width - Theme.componentMargin*2 : 300
spacing: Theme.componentMargin /2
visible: false

ListModel {
id: formatsAvailable_zxingcpp
ListElement { text: "Linear codes"; value: 51070; }
ListElement { text: "Aztec"; value: 1; }
ListElement { text: "DataMatrix"; value: 128; }
ListElement { text: "MaxiCode"; value: 2048; }
ListElement { text: "PDF417"; value: 4096; }
ListElement { text: "QRCode"; value: 8192; }
ListElement { text: "µQRCode"; value: 65536; }
ListElement { txt: "Linear codes"; value: 51070; }
ListElement { txt: "Aztec"; value: 1; }
ListElement { txt: "DataMatrix"; value: 128; }
ListElement { txt: "MaxiCode"; value: 2048; }
ListElement { txt: "PDF417"; value: 4096; }
ListElement { txt: "QRCode"; value: 8192; }
ListElement { txt: "µQRCode"; value: 65536; }
}
ListModel {
id: formatsAvailable_qzxing
ListElement { text: "Linear codes"; value: 517052; }
ListElement { text: "Aztec"; value: 2; }
ListElement { text: "DataMatrix"; value: 64; }
ListElement { text: "MaxiCode"; value: 1024; }
ListElement { text: "PDF417"; value: 2048; }
ListElement { text: "QRCode"; value: 4096; }
ListElement { txt: "Linear codes"; value: 517052; }
ListElement { txt: "Aztec"; value: 2; }
ListElement { txt: "DataMatrix"; value: 64; }
ListElement { txt: "MaxiCode"; value: 1024; }
ListElement { txt: "PDF417"; value: 2048; }
ListElement { txt: "QRCode"; value: 4096; }
}

Repeater {
model: (settingsManager.backend_reader === "zxingcpp") ? formatsAvailable_zxingcpp : formatsAvailable_qzxing

Item {
delegate: Item {
width: parent.width
height: 40

required property var modelData
//required property var modelData

Rectangle {
anchors.fill: parent
Expand All @@ -54,10 +54,10 @@ Column {
width: parent.width - 16
LayoutMirroring.enabled: true

text: modelData.text
text: txt
colorText: "white"
colorSubText: "grey"
checked: (settingsManager.formatsEnabled & modelData.value)
checked: (settingsManager.formatsEnabled & value)
onClicked: {
if (settingsManager.formatsEnabled & modelData.value)
settingsManager.formatsEnabled -= modelData.value
Expand Down
6 changes: 3 additions & 3 deletions qml/components/MenuScreens.qml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import ThemeEngine 1.0

Column {
id: screensCol
anchors.bottom: bottomemnu.top
anchors.bottom: bottomemnus.top
anchors.bottomMargin: Theme.componentMarginXL
anchors.right: bottomemnu.right
anchors.right: bottomemnus.right

width: singleColumn ? screenBarcodeReader.width - Theme.componentMarginXL*2 : 320
spacing: Theme.componentMargin
Expand All @@ -22,7 +22,7 @@ Column {
ListElement { idx: 5; txt: "About"; src: "qrc:/assets/icons_material/outline-info-24px.svg"; }
}

Item {
delegate: Item {
width: parent.width
height: 40

Expand Down
Loading

0 comments on commit 42709b6

Please sign in to comment.