sub
new {
my
(
$class
) =
@_
;
my
$self
= {
width
=> 0,
height
=> 0,
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
);
$self
->{width} =
$reader
->{width};
$self
->{height} =
$reader
->{height};
for
(
my
$i
= 0;
$i
<
$reader
->{
length
};
$i
+=4) {
my
$rgba
= GFX::Enhancer::PNGRGBA->new(
$i
,
$reader
->get_byte_interval(
$i
,
$i
+4));
if
((
$rgba
->red |
$rgba
->green |
$rgba
->blue) > 0) {
push
(@{
$self
->{points}},
$rgba
);
}
}
}
sub
scan_in_image {
my
(
$self
) =
@_
;
}
1;