News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

QR-Code

Started by Biterider, November 21, 2022, 07:52:12 AM

Previous topic - Next topic

Biterider

Hi
Has anyone coded something to generate and read QR codes?
Is there an interface to an existing library that can be used in asm?  :rolleyes:

Biterider

jj2007

https://github.com/nayuki/QR-Code-generator

https://www.nayuki.io/page/qr-code-generator-library#compared-to-competitors (half a dozen libraries described)


jack

some one posted the dll's and QT5 gui front  end for zint https://www.planetsquires.com/protect/forum/index.php?topic=4675.0

jj2007

Quote from: jack on November 21, 2022, 08:40:58 AM
some one posted the dll's and QT5 gui front  end for zint https://www.planetsquires.com/protect/forum/index.php?topic=4675.0

libzint.dll at 760kBytes. Ridiculously bloated for such a simple task :cool:

About 40 years ago I wrote a barcode generator in 68000 Assembly, but I've lost the source :sad:

LiaoMi

A fast and compact QR Code encoding library - https://github.com/fukuchi/libqrencode or https://github.com/fukuchi/libqrencode/archive/refs/tags/v4.1.1.zip

jj2007

Quote from: LiaoMi on November 22, 2022, 08:39:15 AM
A fast and compact QR Code encoding library - https://github.com/fukuchi/libqrencode or https://github.com/fukuchi/libqrencode/archive/refs/tags/v4.1.1.zip

Can you make a DLL out of that? My C/C++ installation is broken :sad:

jack

here's the 64-bit dll
but there were a number of warnings while compiling

jj2007

Thanks, Jack. In the meantime, I found a 32-bit version here, and it works:

include \masm32\MasmBasic\MasmBasic.inc
  Init
  Dll "libqrencode.dll"
  Declare QRcode_APIVersionString
  PrintLine QRcode_APIVersionString()
EndOfCode


Output: 3.9.0

Yours is version 4.1.1 (tests attached)

jack


jj2007

Thanks a lot, Jack :thumbsup:

There is documentation here, e.g. for QRcode_encodeString

Usage example here :cool:

Biterider

Hi
I've been experimenting a bit with the Nayuki project. Very straight forward API and easy to translate.  :thumbsup:
I had to do a bit of tweaking replacing CRT functions to build the static libraries, but in the end everything works as expected.

Biterider

jj2007

Quote from: Biterider on November 22, 2022, 11:13:48 PM
I've been experimenting a bit with the Nayuki project. Very straight forward API and easy to translate.  :thumbsup:

Great. I am playing with libqrencode.dll, QRcode_encodeString does return a bitmap handle (?), but I can't get it to display anything :sad:

P.S.: This doc says it's not a bitmap handle but rather a pointer to a structure :rolleyes:

QRCODE STRUCT
  qrcVersion dd ?
  qrcWidth dd ?
  qrcData dd ?
QRCODE ENDS


qrcData points to an array of chars; only bit 0 is relevant, it's black or white (not surprisingly).

TimoVJL

One C example parsing data
https://gist.github.com/syohex/b1aa695dc6ac5dced139
May the source be with you

jj2007

Yep, that's it, thanks Timo :thumbsup:

int v = (*data & 1) ? 1 : 0;

Quote from: Biterider on November 22, 2022, 11:13:48 PM
I've been experimenting a bit with the Nayuki project.

How big is the dll?

Biterider

Hi JJ
I compiled the source code to create static libraries.
The 64-bit .lib file is 48 KB.

Biterider