Skip to content

hayajo/p5-Data-Petitcom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NAME

Data::Petitcom - Data converter for プチコンmkII / Petit Computer

SYNOPSIS

use Data::Petitcom;

my $prg = <<'EOP';
PRINT "Hello World"
EOP
my $qrcodes = QRCode($prg, type => 'term', version => 5);
my $qr_num = @$qrcodes;
for my $i ( 1 .. $qr_num ) {
    printf(
        "QR: %d / %d\n%s\n",
        $i,
        $qr_num,
        $qrcodes->[ $i - 1 ],
    );
}


use Path::Class;
use GD::Tiler;
my $bmp = '8b_256x192.bmp';
my $raw_bmp = file($bmp)->slurp;
my $qrcodes = QRCode($raw_bmp, resource => 'GRP', name => 'TEST_GRP', type => 'img');
my $tiled = GD::Tiler->tile(
    Images       => $qrcodes,
    Background   => 'white',
    ImagesPerRow => 3,
);
file('qrcodes.png')->open('>')->print($tiled);

DESCRIPTION

Data::Petitcom is data converter for プチコンmkII / Petit Computer.

following resources supported.

PRG: Program
GRP: Graphics (256x192 pixels 8bit-color bitmap)
CHR: User character (256x64 pixels 8bit-color bitmap)
COL: Color (8bit-color bitmap)

FUNCTIONS

Exported Functions

Save($raw_data, %opts)

Turn raw data into PTC.

Load($raw_ptc, %opts)

Turn PTC into raw data.

QRCode(($raw_ptc|$raw_data|$obj_ptc), %opts)

Returns barcode for the data (or object) specified.

Exportable Functions

SaveFile($ptc_file, $raw_data, %opts)

Writes the PTC to a file.

LoadFile($ptc_file, %opts)

Reads the PTC from a file.

AUTHOR

hayajo <hayajo@cpan.org>

SEE ALSO

プチコンmkII

Petit Computer

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages