The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Math::Image - Perl class to represent an image

TREE

-+- Math::Image

REQUIRES

SEE ALSO

PDL for scientific and bulk numeric data processing and display

Math

Math::Vectors

Math::Color, Math::ColorRGBA, Math::Image, Math::Vec2, Math::Vec3, Math::Rotation

SYNOPSIS

        use Math::Image;
        my $i = new Math::Image;  # Make a new Image

        my $i = new Math::Image(1,2,3);

DESCRIPTION

Default value

        0 0 0

OPERATORS

Summary

        '""'            =>   Returns a string representation of the vector.

METHODS

new(w, h, components, array)

w is the width of the image. h is height of the image. comp is the number of components of the image, 1 for greyscale, 2 for greyscale+alpha, 3 for rgb, 4 for rgb+alpha). All these values are scalar. Array is an array ref containing the w*h values for the pixels of the image.

Format of each pixel:

        Comp.   byte[0]    byte[1]     byte[2]    byte[3]
        ------- ---------- ---------- ----------- -----------
           1    intensity1 intensity2  intensity3  intensity4
           2    intensity1   alpha1    intensity2   alpha2 
           3       red1      green1      blue1       red2
           4       red1      green1      blue1      alpha1

Examples:

        $v = new Math::Image();
        $v = new Math::Image( 2, 2, 4, [ 0xABCDEFAB, 0xABCDEFAB, 0xABCDEABF, 0xABCDABEF ] );

copy

Not implemented yet.

setValue(width, height, components, array)

setWidth(width)

Not implemented yet.

setHeight(height)

Not implemented yet.

setComponents(comp)

Not implemented yet.

setArray(array)

Not implemented yet.

getValue

Returns the value of the image (width, height, components, array) as a 4 components array.

        ($width, $height, $components, $array) = $i->getValue;
        @i = $i->getValue;

getWidth

Not implemented yet.

getHeight

Not implemented yet.

getComponents

Not implemented yet.

getArray

Not implemented yet.

toString

Returns a string representation of the image. This is used to overload the '""' operator, so that image may be freely interpolated in strings.

        my $i = new Math::Image(0, 0, 0);
        print $c->toString; # "0 0 0"
        print "$c";         # "0 0 0"

SEE ALSO

PDL for scientific and bulk numeric data processing and display

Math

Math::Vectors

Math::Color, Math::ColorRGBA, Math::Image, Math::Vec2, Math::Vec3, Math::Rotation

BUGS & SUGGESTIONS

If you run into a miscalculation, need some sort of feature or an additional holiday, or if you know of any new changes to the funky math, please drop the author a note.

ARRANGED BY

Holger Seelig holger.seelig@yahoo.de

COPYRIGHT

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