// //------------------ DOK FILE -------------------------------------------------- +Header core.2d.qrcode =pkg core.2d.qrcode =title core.2d.qrcode =short generate QR-codes =desc This library lets you create QR-codes qrcodeEcho (qrcode ("https://minimacy.net", ECL_LOW));; // // //------------------ PROTO ----------------------------------------------------- qrcodeWithBorder +Proto qrcodeWithBorder =type fun Str Int Int -> Bitmap =mode function =pkg core.2d.qrcode =impl mcy =link =desc This function creates a QR-code and draws it in a new bitmap, adding a border all around. - The QR-code is black on white. - The QR-code encodes the message msg with a correction level to be choosen in [[ECL_HIGH]], [[ECL_QUARTILE]], [[ECL_MEDIUM]], [[ECL_LOW]]. - The higher the correction level, the thinnest the QR-code is. // +arg msg =type Str =desc A string // +arg ecl =type Int =desc An error correction level // +arg border =type Int =desc An integer // +arg result =type Bitmap =desc A bitmap with a QR-code // // //------------------ PROTO ----------------------------------------------------- qrcode +Proto qrcode =type fun Str Int -> Bitmap =mode function =pkg core.2d.qrcode =impl mcy =link =desc This function creates a QR-code and draws it in a new bitmap. - The QR-code is black on white. - The QR-code encodes the message msg with a correction level to be choosen in [[ECL_HIGH]], [[ECL_QUARTILE]], [[ECL_MEDIUM]], [[ECL_LOW]]. - The higher the correction level, the thinnest the QR-code is. // +arg msg =type Str =desc A string // +arg ecl =type Int =desc An error correction level // +arg result =type Bitmap =desc A bitmap with a QR-code // // //------------------ PROTO ----------------------------------------------------- qrcodeEcho +Proto qrcodeEcho =type fun Bitmap -> Bitmap =mode function =pkg core.2d.qrcode =impl mcy =link =desc This function displays the QR-code in text mode in the console. - Back color is displayed with "\\219\\219". - Front color is displayed with " " (two spaces). // +arg bmp =type Bitmap =desc A bitmap computed by [[qrcode]] or [[qrcodeWithBorder]] // +arg result =type Bitmap =desc The same bitmap // // //------------------ PROTO ----------------------------------------------------- ECL_HIGH +Proto ECL_HIGH =type Int =mode constant =pkg core.2d.qrcode =impl mcy =link =desc Correction level constant for QR-codes // // //------------------ PROTO ----------------------------------------------------- ECL_QUARTILE +Proto ECL_QUARTILE =type Int =mode constant =pkg core.2d.qrcode =impl mcy =link =desc Correction level constant for QR-codes // // //------------------ PROTO ----------------------------------------------------- ECL_MEDIUM +Proto ECL_MEDIUM =type Int =mode constant =pkg core.2d.qrcode =impl mcy =link =desc Correction level constant for QR-codes // // //------------------ PROTO ----------------------------------------------------- ECL_LOW +Proto ECL_LOW =type Int =mode constant =pkg core.2d.qrcode =impl mcy =link =desc Correction level constant for QR-codes // // //------------------ PROTO ----------------------------------------------------- MODE_BYTE +Proto MODE_BYTE =type Int =mode constant =pkg core.2d.qrcode =impl mcy =link =desc Byte mode // // //------------------ PROTO ----------------------------------------------------- MODE_ALPHANUMERIC +Proto MODE_ALPHANUMERIC =type Int =mode constant =pkg core.2d.qrcode =impl mcy =link =desc Alphanumeric mode (not yet supported) // // //------------------ PROTO ----------------------------------------------------- MODE_NUMERIC +Proto MODE_NUMERIC =type Int =mode constant =pkg core.2d.qrcode =impl mcy =link =desc Numeric mode (not yet supported)