Skip Menu |
 

This queue is for tickets about the Imager CPAN distribution.

Report information
The Basics
Id: 29938
Status: resolved
Priority: 50/
Queue: Imager

People
Owner: Nobody in particular
Requestors: TONYC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 0.60
Fixed in: 0.81



Subject: Imager::Matrix2d should either allow addition/multiplication of custom matrices or an initialize from values constructor
Date: Fri, 12 Oct 2007 12:08:24 +1000
To: bug-Imager [...] rt.cpan.org
From: tonyc [...] cpan.org
Download (untitled) / with headers
text/plain 513b
Trying to build a perspective matrix with some offsets to centre it: my $offset1 = Imager::Matrix2d->translate(x => -$work->getwidth / 2, y => 0); my $persp = [ 1, 0, 0, 0, 1, 0, 0, -0.001, 1 ]; my $offset2 = Imager::Matrix2d->translate(x => $work->getwidth / 2, y => 0); my $matrix = $offset1 * $persp * $offset2; # $matrix undef But since there's no way to build an object the only way to make it work is to break encapsulation and bless the custom matrix into Imager::Matrix2d.
Download (untitled) / with headers
text/plain 602b
On Thu Oct 11 22:08:47 2007, TONYC wrote: Show quoted text
> Trying to build a perspective matrix with some offsets to centre it: > > my $offset1 = Imager::Matrix2d->translate(x => -$work->getwidth / > 2, y => 0); > my $persp = [ 1, 0, 0, > 0, 1, 0, > 0, -0.001, 1 ]; > my $offset2 = Imager::Matrix2d->translate(x => $work->getwidth / > 2, y => 0); > my $matrix = $offset1 * $persp * $offset2; > # $matrix undef > > But since there's no way to build an object the only way to make it > work is to break encapsulation and bless the custom matrix into > Imager::Matrix2d. >
Fixed in 0.81.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.