Algorithm-Scale2x

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

        my @result2x = Algorithm::Scale2x::scale2x( @pixels );

        # scale3x - returns a 3x3 grid of scaled pixels
        my @result3x = Algorithm::Scale2x::scale3x( @pixels );

DESCRIPTION
    This module provides a generic implementation of the Scale2x and Scale3x
    algorithms. Scale2x is described as:

        ...[a] real-time graphics effect able to increase the size of small bitmaps
        guessing the missing pixels without interpolating pixels and blurring the images.

METHODS
  scale2x( @pixels )
    Given a 3x3 grid of pixels (i.e color index numbers), it will expand the
    centre pixel into 4 new pixels (i.e. 2x scale).

        +---+---+---+
        | 0 | 1 | 2 |    +----+----+
        +---+---+---+    | 4A | 4B |
        | 3 | 4 | 5 | => +----+----+

lib/Algorithm/Scale2x.pm  view on Meta::CPAN


    # scale3x - returns a 3x3 grid of scaled pixels
    my @result3x = Algorithm::Scale2x::scale3x( @pixels );

=head1 DESCRIPTION

This module provides a generic implementation of the Scale2x and Scale3x algorithms.
Scale2x is described as:

    ...[a] real-time graphics effect able to increase the size of small bitmaps
    guessing the missing pixels without interpolating pixels and blurring the images.

=head1 METHODS

=head2 scale2x( @pixels )

Given a 3x3 grid of pixels (i.e color index numbers), it will expand the centre pixel
into 4 new pixels (i.e. 2x scale).

    +---+---+---+
    | 0 | 1 | 2 |    +----+----+



( run in 0.270 second using v1.01-cache-2.11-cpan-702932259ff )