-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from estrabd/RT-113716-signature_as_char_string…
…-possible-not-correct-at-all Replaced unsigned int unpack template to used signed (per puzzle.h).
- Loading branch information
Showing
10 changed files
with
186 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Makefile.old | ||
Makefile | ||
MYMETA.json | ||
MYMETA.yml | ||
Libpuzzle.bs | ||
Libpuzzle.c | ||
Libpuzzle.o | ||
blib/ | ||
pm_to_blib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/usr/bin/env perl | ||
|
||
use strict; | ||
use warnings; | ||
|
||
use Image::Libpuzzle (); | ||
|
||
my $p1 = Image::Libpuzzle->new; | ||
my $p2 = Image::Libpuzzle->new; | ||
|
||
my $sig1 = $p1->fill_cvec_from_file($ARGV[0]); | ||
my $sig2 = $p2->fill_cvec_from_file($ARGV[1]); | ||
|
||
print $p1->vector_normalized_distance($p2),qq{\n}; | ||
|
||
__END__ | ||
=pod | ||
=head1 NAME | ||
p5-puzzle-diff - output default distance between two images | ||
=head1 SYNOPSIS | ||
$ p5-puzzle-diff path/to/image1 path/to/image2 | ||
=head1 DESCRIPTION | ||
This script is an implementation of the puzzle-diff(8) utility provide with libpuzzle(3) using | ||
the bindings provided for by L<Image::Libpuzzle>. | ||
The output is the normalized distance between two images. | ||
=head1 BUGS AND LIMITATIONS | ||
Currently this script accepts no options other than the names of the image files to compare. | ||
Please report them via L<https://github.com/estrabd/p5-puzzle-xs/issues>. | ||
=head1 AUTHOR | ||
B. Estrade <estrabd@gmail.com> | ||
=head1 COPYRIGHT AND LICENSE | ||
Copyright (C) 2015 by B. Estrade | ||
This library is free software; you can redistribute it and/or modify it under | ||
the same terms as Perl itself, either Perl version 5.14.4 or, at your option, | ||
any later version of Perl 5 you may have available. | ||
=cut |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/usr/bin/env perl | ||
|
||
use strict; | ||
use warnings; | ||
|
||
use Image::Libpuzzle (); | ||
|
||
my $ngram_size = $Image::Libpuzzle::DEFAULT_NGRAM_SIZE; | ||
|
||
if ($ARGV[1] and int $ARGV[1] > 0) { | ||
$ngram_size = int $ARGV[1]; | ||
} | ||
if ($ARGV[1] and int $ARGV[1] <= 0) { | ||
warn qq{optional argument for ngram size must be >= 1; default is $Image::Libpuzzle::DEFAULT_NGRAM_SIZE}; | ||
exit 1; | ||
} | ||
|
||
my $p1 = Image::Libpuzzle->new; | ||
|
||
my $sig1 = $p1->fill_cvec_from_file($ARGV[0]); | ||
|
||
my $ngrams_ref = $p1->signature_as_char_ngrams($ngram_size); | ||
|
||
foreach my $n (@$ngrams_ref) { | ||
print qq{$n\n}; | ||
} | ||
|
||
__END__ | ||
=pod | ||
=head1 NAME | ||
p5-puzzle-ngrams - produce list of ngrams from an image | ||
=head1 SYNOPSIS | ||
$ p5-puzzle-sig path/to/image [ngram_size] | ||
=head1 DESCRIPTION | ||
This script outputs a ngrams of the character representation of an image as provide for in libpuzzle(3) using | ||
the bindings provided for by L<Image::Libpuzzle>. | ||
=head1 BUGS AND LIMITATIONS | ||
Currently this script accepts no options other than the name of the file to sign. | ||
Please report them via L<https://github.com/estrabd/p5-puzzle-xs/issues>. | ||
=head1 AUTHOR | ||
B. Estrade <estrabd@gmail.com> | ||
=head1 COPYRIGHT AND LICENSE | ||
Copyright (C) 2015 by B. Estrade | ||
This library is free software; you can redistribute it and/or modify it under | ||
the same terms as Perl itself, either Perl version 5.14.4 or, at your option, | ||
any later version of Perl 5 you may have available. | ||
=cut |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/usr/bin/env perl | ||
|
||
use strict; | ||
use warnings; | ||
|
||
use Image::Libpuzzle (); | ||
|
||
my $p1 = Image::Libpuzzle->new; | ||
|
||
my $sig1 = $p1->fill_cvec_from_file($ARGV[0]); | ||
|
||
print $p1->signature_as_char_string, qq{\n}; | ||
|
||
__END__ | ||
=pod | ||
=head1 NAME | ||
p5-puzzle-sig - output character representation of image signature | ||
=head1 SYNOPSIS | ||
$ p5-puzzle-sig path/to/image | ||
=head1 DESCRIPTION | ||
This script outputs a character representation of an image as provide for in libpuzzle(3) using | ||
the bindings provided for by L<Image::Libpuzzle>. | ||
The output is the character representation of the signature, in the range of [0 .. 4]. | ||
=head1 BUGS AND LIMITATIONS | ||
Currently this script accepts no options other than the name of the file to sign. | ||
Please report them via L<https://github.com/estrabd/p5-puzzle-xs/issues>. | ||
=head1 AUTHOR | ||
B. Estrade <estrabd@gmail.com> | ||
=head1 COPYRIGHT AND LICENSE | ||
Copyright (C) 2015 by B. Estrade | ||
This library is free software; you can redistribute it and/or modify it under | ||
the same terms as Perl itself, either Perl version 5.14.4 or, at your option, | ||
any later version of Perl 5 you may have available. | ||
=cut |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.