Brian Cassidy > Image-XBin-0.06 > Image::XBin::Palette

Download:
Image-XBin-0.06.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.06   Source  

NAME ^

Image::XBin::Palette - Manipulate XBin palette data

SYNOPSIS ^

        use Image::XBin::Palette;

        # Read the data...
        my $pal = Image::XBin::Palette->new( $data );

        # Get
        my $rgb = $pal->get( $index );

        # Set
        $pal->set( $index, $rgb );

        # Get data suitable for saving...
        my $out = $pal->as_string;

        # Clear the data
        $pal->clear;

DESCRIPTION ^

Xbin images can contain palette (16 indexes) data. This module will allow you to create, and manipulate that data.

METHODS ^

new( [$data] )

Creates a new Image::XBin::Palette object. Unpacks 16 rgb triples.

read( $data )

Explicitly reads in data.

as_string( )

Returns the palette as a pack()'ed string - suitable for saving in an XBin.

get( $index )

Get the rgb triple at index $index

set( $index, $rgb )

Write an rgb triple at index $index

clear( )

Clears any in-memory data.

TODO ^

AUTHOR ^

COPYRIGHT AND LICENSE ^

Copyright 2003-2009 by Brian Cassidy

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

syntax highlighting: