Márton Németh > Image-XWD-0.1 > Image::XWD

Download:
Image-XWD-0.1.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.01   Source  

NAME ^

Image::XWD - X Window Dump image reader

SYNOPSIS ^

  use Image::XWD;

  my $img = new Image::XWD;
  $img->read_file('foo.xwd');
  my $window_name = $img->get_window_name(); # get the window name saved by xwd(1)
  my ($r,$g,$b) = $img->xy_rgb(100,200);     # get pixel at (100,200)

DESCRIPTION ^

Image::XWD can be used to read the screenshot created by xwd(1).

METHODS ^

$img = new Image::XWD();

Constructs a new Image::XWD object.

$img->read_file($filename);

Reads the given filename to the memory. Specify '-' as filename to read from stdin.

$img->get_width();

Returns the width of the image in pixels.

$img->get_heigth();

Returns the heigth of the image in pixels.

$img->get_window_name();

Returns the window name saved by xwd(1). If the image contains no window name undef is returned. (Note that this differs from emty string as window name.)

$img->xy_rgb($x, $y)

Get the color of the pixel in RGB. The upper left corner is (0, 0) and the lower right corner is ($img->get_width()-1, $img->get_heigth()-1).

SEE ALSO ^

xwd(1), xwud(1), gimp(1), /usr/include/X11/XWDFile.h

AUTHOR ^

Márton Németh, <nm127@freemail.hu>

COPYRIGHT AND LICENSE ^

Copyright (C) 2008 by Márton Németh

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.

syntax highlighting: