sub
new {
my
(
$class
) =
@_
;
my
$self
= {
points
=> (), };
$class
=
ref
(
$class
) ||
$class
;
bless
$self
,
$class
;
}
sub
scan_in_points_of_png_image_file {
my
(
$self
,
$filename
) =
@_
;
my
$reader
= GFX::Enhancer::PNGReader->new;
$reader
->read_in_byte_array(
$filename
);
for
(
my
$i
= 0;
$i
<
$reader
->{
length
};
$i
+4) {
my
$rgba
= GFX::Enhancer::PNGRGBA->new(
$reader
->get_byte_interval(
$i
,
$i
+4));
if
((
$rgba
->red |
$rgba
->green |
$rgba
->blue) > 0) {
push
(
$self
->{points},
$i
);
}
}
}
sub
scan_in_image {
my
(
$self
,
}
1;