NAME
Graphics::DZI::Overlay - DeepZoom Image Pyramid, Sparse Images
SYNOPSIS
# build some overlays first
use Graphics::DZI::Overlay;
my $o1 = new Graphics::DZI::Overlay (image => ..., # what is the image?
x => 1000, y=>1000, # where on the canvas?
squeeze => 64); # how much smaller than the canvas?
my $o2 = new Graphics::DZI::Overlay (image => ..., # what is the image?
x => 2000, y=>2000, # where on the canvas?
squeeze => 32); # how much smaller than the canvas?
# then add the overlay over the canvas
use Graphics::DZI::Files;
my $dzi = new Graphics::DZI::Files (image => $image,
overlap => 4,
tilesize => 512,
format => 'png',
overlays => [ $o1, $o2],
path => $path . 'xxx_files/',
prefix => 'xxx',
);
# normal DZI generation
write_file ($path . 'xxx.xml', $dzi->descriptor);
$dzi->iterate ();
DESCRIPTION
This package can hold one overlay image, together with a coordinate and a factor how much this images is smaller than the canvas onto which the image is to be put.
INTERFACE
Constructor
It expects the following fields:
image
: (required)-
Image::Magick object.
x
,y
: (integers, no default)-
Coordinates of the top-left corner of the above image on the canvas
squeeze
: (integers, no default)-
A factor how much the image should be made smaller, relative to the canvas. I use a power of two to avoid that the canvas is a bit fuzzy.
Methods
- halfsize
-
Makes the overlay smaller by 2. This will be called by the DZI algorithm.
- crop
-
Gets a tile off the overlay.
AUTHOR
Robert Barta, <drrho at cpan.org>
COPYRIGHT & LICENSE
Copyright 2010 Robert Barta, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.