i_color_set
i_color_info
- i_img_empty
- i_img_empty_ch
- i_img_exorcise
- i_img_destroy
-
i_img_info
i_img_setmask
if ($ex_version < 5.57) {
@ISA = qw(Exporter);
}
- $VERSION = '0.90';
+ $VERSION = '0.93';
require XSLoader;
XSLoader::load(Imager => $VERSION);
}
sub setsamples {
my $self = shift;
- my %opts = ( x => 0, offset => 0, @_ );
unless ($self->{IMG}) {
$self->_set_error('setsamples: empty input image');
return;
}
- my $data = $opts{data};
- unless(defined $data) {
+ my %opts = ( x => 0, offset => 0 );
+ my $data_index;
+ # avoid duplicating the data parameter, it may be a large scalar
+ my $i = 0;
+ while ($i < @_ -1) {
+ if ($_[$i] eq 'data') {
+ $data_index = $i+1;
+ }
+ else {
+ $opts{$_[$i]} = $_[$i+1];
+ }
+
+ $i += 2;
+ }
+
+ unless(defined $data_index) {
$self->_set_error('setsamples: data parameter missing');
return;
}
+ unless (defined $_[$data_index]) {
+ $self->_set_error('setsamples: data parameter not defined');
+ return;
+ }
my $type = $opts{type};
defined $type or $type = '8bit';
my $count;
if ($type eq '8bit') {
$count = i_psamp($self->{IMG}, $opts{x}, $opts{y}, $opts{channels},
- $data, $opts{offset}, $width);
+ $_[$data_index], $opts{offset}, $width);
}
elsif ($type eq 'float') {
$count = i_psampf($self->{IMG}, $opts{x}, $opts{y}, $opts{channels},
- $data, $opts{offset}, $width);
+ $_[$data_index], $opts{offset}, $width);
}
elsif ($type =~ /^([0-9]+)bit$/) {
my $bits = $1;
- unless (ref $data) {
+ unless (ref $_[$data_index]) {
$self->_set_error("setsamples: data must be an array ref for type not 8bit or float");
return;
}
$count = i_psamp_bits($self->{IMG}, $opts{x}, $opts{y}, $bits,
- $opts{channels}, $data, $opts{offset},
+ $opts{channels}, $_[$data_index], $opts{offset},
$width);
}
else {
$new->{IMG} = i_convert($self->{IMG}, $matrix);
unless ($new->{IMG}) {
# most likely a bad matrix
+ i_push_error(0, "convert");
$self->{ERRSTR} = _error_as_msg();
return undef;
}
L<Imager::ExtUtils> - tools to get access to Imager's C API.
+=item *
+
+L<Imager::Security> - brief security notes.
+
=back
=head2 Basic Overview
L<Imager::Engines/"Matrix Transformations">,
L<Imager::Font/transform()>
-metadata, image - L<Imager::ImageTypes/"Tags">
+metadata, image - L<Imager::ImageTypes/"Tags">, L<Image::ExifTool>
mosaic - L<Imager::Filters/mosaic>
scaling - L<Imager::Transformations/scale()>
+security - L<Imager::Security>
+
SGI files - L<Imager::Files/"SGI (RGB, BW)">
sharpen - L<Imager::Filters/unsharpmask>, L<Imager::Filters/conv>
L<GD>(3), L<Image::Magick>(3), L<Graphics::Magick>(3),
L<Prima::Image>, L<IPA>.
+For manipulating image metadata see L<Image::ExifTool>.
+
If you're trying to use Imager for array processing, you should
probably using L<PDL>.