The Perl and Raku Conference 2025: Greenville, South Carolina - June 27-29 Learn more

sub new {
my ($class, $name) = @_;
my $self = $class->SUPER::new;
$self->{filename} = "";
$self->{bytes} = 0; ### number which stores all bytes of the png image
$self->{length} = 0;
}
### public methods
sub read_in_byte_array {
my $self = shift;
my $self->{filename} = shift;
### FIXME png reader code
$self->{length} = ;
}
sub get_byte {
my $self = shift;
my $index = shift; ### byte index
return ($self->{bytes} >> ($index-1)*4 - $self->{bytes} >> $index*4);
}
sub get_byte_interval {
my $self = shift;
my $i = shift;
my $j = shift; ### j > i
return ($self->{bytes} >> $j*4 - $self->{bytes} >> $i*4);
}
1;