PDL.pm 1.16 KB
Newer Older
Marc Lehmann's avatar
Marc Lehmann committed
1
2
package Gimp::PDL;

Marc Lehmann's avatar
Marc Lehmann committed
3
warn "use'ing Gimp::PDL is no longer necessary, please remove it!\n";
Marc Lehmann's avatar
Marc Lehmann committed
4
5
6
7
8
9
10

1;
__END__

=head1 NAME

Gimp::PDL - Overwrite Tile/Region functions to work with piddles.
Marc Lehmann's avatar
Marc Lehmann committed
11
This module is obsolete, please remove any references to it.
Marc Lehmann's avatar
Marc Lehmann committed
12
13
14
15

=head1 SYNOPSIS

  use Gimp;
Marc Lehmann's avatar
Marc Lehmann committed
16
  use Gimp::PDL;
Marc Lehmann's avatar
Marc Lehmann committed
17
18
19
20
  use PDL;

=head1 DESCRIPTION

Marc Lehmann's avatar
Marc Lehmann committed
21
22
23
24
This module overwrites some methods of Gimp::Tile and Gimp::PixelRgn. The
new functions return and accept piddles. The last argument (height) of
C<gimp_pixel_rgn_set_rect> is calculated from the piddle. There is no
other way to access the raw pixeldata in Gimp.
Marc Lehmann's avatar
Marc Lehmann committed
25
26
27

Some exmaples:

Marc Lehmann's avatar
Marc Lehmann committed
28
 $region = $drawable->get->pixel_rgn (0,0, 100,100, 1,0);
Marc Lehmann's avatar
Marc Lehmann committed
29
 $pixel = $region->get_pixel (5,7);	# fetches the pixel from (5|7)
Marc Lehmann's avatar
Marc Lehmann committed
30
31
32
 print $pixel;				# outputs something like
 					# [255, 127, 0], i.e. in
 					# RGB format ;)
Marc Lehmann's avatar
Marc Lehmann committed
33
34
35
36
37
38
39
40
41
42
43
44
 $region->set_pixel ($pixel * 0.5, 5, 7);# darken the pixel
 $rect = $region->get_rect (3,3,70,20);	# get a horizontal stripe
 $rect = $rect->hclip(255/5)*5;		# clip and multiply by 5
 $region->set_rect($rect);		# and draw it!
 undef $region;				# and update it!

=head1 AUTHOR

Marc Lehmann <pcg@goof.com>

=head1 SEE ALSO

Marc Lehmann's avatar
Marc Lehmann committed
45
L<Gimp::Pixel>, perl(1), Gimp(1).
Marc Lehmann's avatar
Marc Lehmann committed
46
47

=cut