Image::XWD (original) (raw)

NAME

Image::XWD - X Window Dump image reader

SYNOPSIS

use Image::XWD;

my $img = new Image::XWD;
$img->read_file('foo.xwd');
my <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>w</mi><mi>i</mi><mi>n</mi><mi>d</mi><mi>o</mi><msub><mi>w</mi><mi>n</mi></msub><mi>a</mi><mi>m</mi><mi>e</mi><mo>=</mo></mrow><annotation encoding="application/x-tex">window_name = </annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8444em;vertical-align:-0.15em;"></span><span class="mord mathnormal" style="margin-right:0.02691em;">w</span><span class="mord mathnormal">in</span><span class="mord mathnormal">d</span><span class="mord mathnormal">o</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.02691em;">w</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.0269em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">n</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord mathnormal">am</span><span class="mord mathnormal">e</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span></span></span></span>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−>readfile(img->read_file(img>readfile(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−>xyrgb(img->xy_rgb(img>xyrgb(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

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

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.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 387:

Non-ASCII character seen before =encoding in 'Márton'. Assuming UTF-8