My pride for Image::DecodeQR::WeChat
I have just submitted on CPAN inspired
this blitz-style QR japh. Lame as it may be, enjoy.
Said module is my first to use XS and a significant milestone for
me as I have managed finally to port OpenCV API into Perl.
It's been adjusted for PM's rendering particularities and
hopefully copy+pasting
the text from the Download link will
produce the correct output.
Tested on a Linux unicode-enabled
terminal. If there is no download link for below code
then click on Download code below
https://perlmonks.org/?node_id=11142119;displaytype=displaycode
If anyone has suggestions on how to fix this monstrosity
between code tags let me know
(edit: pre tags shows the unicode but breaks other things).
Apropos the QR-code below: ideally I would just use the black brick
and a white space but unfortunately whatever i do the space gets shrinked
i tried various unicode spaces but nothing worked, they all got shrinked
below I am using a thin horizontal line as space which will most likely
confuse the decoder.
██████████████▁▁▁▁▁▁██▁▁▁▁▁▁██████▁▁██████████████
██▁▁▁▁▁▁▁▁▁▁██▁▁██████▁▁▁▁▁▁▁▁████▁▁██▁▁▁▁▁▁▁▁▁▁██
██▁▁██████▁▁██▁▁██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██▁▁██████▁▁██
██▁▁██████▁▁██▁▁▁▁██▁▁▁▁██▁▁██▁▁▁▁▁▁██▁▁██████▁▁██
██▁▁██████▁▁██▁▁██████▁▁██▁▁██████▁▁██▁▁██████▁▁██
██▁▁▁▁▁▁▁▁▁▁██▁▁██▁▁██▁▁████████▁▁▁▁██▁▁▁▁▁▁▁▁▁▁██
██████████████▁▁██▁▁██▁▁██▁▁██▁▁██▁▁██████████████
▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██▁▁████▁▁▁▁▁▁▁▁██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
████▁▁██▁▁▁▁████▁▁▁▁▁▁████████▁▁▁▁▁▁██████▁▁████▁▁
████▁▁██████▁▁██████▁▁██████▁▁▁▁██████▁▁▁▁██▁▁▁▁██
▁▁▁▁▁▁▁▁▁▁▁▁██████▁▁▁▁████████▁▁██▁▁▁▁████████████
▁▁▁▁▁▁▁▁██▁▁▁▁██████████████▁▁████▁▁▁▁▁▁██▁▁▁▁██▁▁
▁▁▁▁████▁▁████████▁▁████▁▁██▁▁▁▁████████▁▁██▁▁████
▁▁▁▁████████▁▁██▁▁██▁▁██▁▁▁▁▁▁▁▁▁▁██████▁▁▁▁██▁▁██
██▁▁██▁▁██▁▁██▁▁████▁▁██▁▁██▁▁▁▁██▁▁██████▁▁██▁▁██
▁▁██▁▁▁▁▁▁▁▁▁▁▁▁▁▁██████▁▁██████▁▁▁▁▁▁▁▁████▁▁████
████▁▁██▁▁████▁▁██▁▁██▁▁██▁▁▁▁▁▁██████████▁▁██▁▁▁▁
▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██████▁▁██▁▁██▁▁██▁▁▁▁▁▁████▁▁▁▁▁▁
██████████████▁▁████▁▁████████▁▁██▁▁██▁▁██▁▁██████
██▁▁▁▁▁▁▁▁▁▁██▁▁▁▁████▁▁██▁▁██▁▁██▁▁▁▁▁▁██▁▁████▁▁
██▁▁██████▁▁██▁▁▁▁████▁▁██████▁▁██████████▁▁▁▁██▁▁
██▁▁██████▁▁██▁▁██▁▁▁▁██▁▁██▁▁██▁▁▁▁▁▁██████▁▁▁▁▁▁
██▁▁██████▁▁██▁▁▁▁▁▁▁▁▁▁████▁▁▁▁▁▁██▁▁▁▁████▁▁▁▁██
██▁▁▁▁▁▁▁▁▁▁██▁▁██▁▁▁▁██▁▁██▁▁████▁▁▁▁██▁▁▁▁▁▁▁▁▁▁
██████████████▁▁████▁▁▁▁▁▁██▁▁▁▁██▁▁▁▁██▁▁▁▁▁▁████
use utf8; eval join'', map{ $_->[0]=~s/[\x{2588}\n]//gr =~s/█//gr =~s/&/&/gr =~s/</</gr =~s/>/>/gr =~s/[/[/gr =~s/]/]/gr } ([<<'EOP']); ███████use█ █Tex +█t:█:█QRC█o█de█;█ us█e███████ █ utf8█;█ bi█n███m█od██e█(█ +;██ST█D█O█UT█, ':e█ █n███c█od█ing██(█ +;█utf8)'██)███; ██m█y █@███a█ █ ███=█ ██m█ap █ +███{████ ██& +;#91;spl█i█t██/█/███, +█ █$███_█&#93; } █split("█ +█████ ",████ "& +#9608;██a█n███o█ █phele█s██ █cog██, t█r +ue█ █a█rcho█n of█ junk█ ███████"█)█;` +08; █ █p█r█i█n█t█ █j█o█ +;i█n█ ███████ "\n", map██ █{ █ y█/* ██/██\█x█ +;{2█588}\x{25 █████9█████ +;█1}/; ████████ +█$_ ██} map█ █{█ █j oi██n '', █ma█p█ █{ $█_π +8;.█$█_█████ ██ +█} █@███ ██$_█ █}█ @{Te█xt::Q██ +R██C██ode█████& +#9608;-██&gt;█n█e w(██)-&gt;plo█t( ██ j█oin █████π +8;█""██,███ ███ +███ ███ma██p {█ █ ████j█o█i█n(" +"█,█@█$_)█ =~ m██ (&#91;███^^███&gt;&gt; +&#93;*█(.)(█.█)(.)&#91;&lt;█π +8;█&lt;█^^██&#93;?(oO█(█ i███████ou█uu█&# +9608;u)████)█?█)██ &# +9608;an████d █ j██o i███n "██"███,█ +m███ap █{██ █($1█` +08;+█$██████3= █=█████4-█$██	 +608;██2███)████ + ? " "█ █:█ ██(42%11 -$██2█==█$1+$3) █? uc : l█c █ +;██} ($███a█&#91;█$2	 +608; █&#93;█-&gt;&#91;███$3&# +93;█) ███ }██ ██m█a█ +;█p {██ &#91;m██$█&#91;&# +9608;9 █50█618371████&gt;&gt;` +08;█!█42!&lt;█&lt;1██7█38 +6█1█059███&#93;█ █$█████████ +;g&#93;█ }███████ +██ "450█222█5████` +08;08██ 5████201█0█350█0101█&# +9608;302██3█2████07█& +#9608;331█051█ 31███2█2█06██03██ +;█1██2█3████2315π +8;████0█6█4█00 5██3█370█07███1██ +;03██531██2████3π +8;█33█1" █████ █=█████████ +;~█ m$x██?██████ +;.y?██.z?.&#91;█████wro +n ██g█&#93;█?$████g& +#9608; █)} EOP
here is the more readable japh (Above I am "shaping" perl script as a QR code):
use Text::QRCode; use utf8; binmode(STDOUT, ':encoding(utf8)'); binmode(STDERR, ':encoding(utf8)'); my @a = map { [split//,$_] } split(" ", "anopheles cog, true archon of + junk"); print join "\n", map { y/* /\x{2588}\x{2591}/; $_ } map { join undef, map { $_.$_ } @$_ } @{Text::QRCode->new()->plo +t( join "", map { join("",@$_) =~ m([^^>>]*(.)(.)(.)[<<^^]?(oO(iouuuu))?) and join "", map { ($1+$3==4-$2) ? " " : (42%11-$2==$1+$3) ? uc : +lc } ($a[$2]->[$3]) } map { [m$[950618371>>!42!<<173861059]$g] } "45022250852010350010130232073310513122060312323150640053370 +0710353123331" =~ m$x?.y?.z?.[wrong]?$g )} ;
bw, bliako
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Shameless plug and QR japh
by cavac (Prior) on Apr 08, 2022 at 11:18 UTC | |
by ambrus (Abbot) on Apr 08, 2022 at 13:04 UTC | |
by hippo (Archbishop) on Apr 08, 2022 at 13:35 UTC | |
by choroba (Cardinal) on Apr 08, 2022 at 20:21 UTC | |
by jdporter (Paladin) on Oct 20, 2023 at 13:18 UTC | |
by cavac (Prior) on Apr 08, 2022 at 12:04 UTC | |
by cavac (Prior) on Apr 08, 2022 at 13:19 UTC | |
Re: Shameless plug and QR japh
by etj (Priest) on Mar 23, 2022 at 14:36 UTC | |
by bliako (Abbot) on Mar 24, 2022 at 10:26 UTC | |
by etj (Priest) on Mar 24, 2022 at 15:09 UTC | |
by etj (Priest) on Aug 06, 2024 at 15:26 UTC | |
by bliako (Abbot) on Aug 07, 2024 at 07:24 UTC |