NAME
Image::Base::Prima::Image -- draw into Prima image
SYNOPSIS
use Image::Base::Prima::Image;
my $image = Image::Base::Prima::Image->new
(-width => 200, -height => 100);
$image->line (0,0, 99,99, '#FF00FF');
$image->rectangle (10,10, 20,15, 'white');
CLASS HIERARCHY
Image::Base::Prima::Image is a subclass of Image::Base::Prima::Drawable,
Image::Base
Image::Base::Prima::Drawable
Image::Base::Prima::Image
DESCRIPTION
Image::Base::Prima::Image extends Image::Base to create and draw into Prima::Image objects, including file loading and saving.
See Image::Base::Prima::Drawable for the drawing operations. This subclass adds image creation and file load/save. begin_paint() / end_paint() bracketing is still necessary.
As of Prima 1.28 the supported file formats for both read and write include PNG, JPEG, TIFF, GIF, XBM, XPM and BMP. Prima on X11 draws using the X server, so an X connection is necessary. Don't use Prima::noX11 or drawing operations will quietly do nothing.
FUNCTIONS
See "FUNCTIONS" in Image::Base::Prima::Drawable and "FUNCTIONS" in Image::Base for behaviour inherited from the superclasses.
$image = Image::Base::Prima::Image->new (key=>value,...)-
Create and return a new image object. A new
Prima::Imageobject can be created, usually with a-widthand-height(but it also works to set them later),$ibase = Image::Base::Prima::Image->new (-width => 200, -height => 100);;Or an existing
Prima::Imageobject can be given$ibase = Image::Base::Prima::Image->new (-drawable => $prima_image); $image->load ()$image->load ($filename)-
Load from
-file, or with a$filenameargument set-filethen load.The Prima
loadExtrasoption is used so as to get the file formatcodecIDin the underlying image, and any possible "hotspot" for-hotxand-hotybelow ("ATTRIBUTES"). $image->save ()$image->save ($filename)-
Save to
-file, or with a$filenameargument set-filethen save to that.As per Prima
save, the file format is taken from the underlying$primaimage->{'extras'}->{'codecID'}if that's set, otherwise from the filename extension. The-file_formatattribute below can set the desired output format.
ATTRIBUTES
-file(string)-
For saving Prima takes the file format from the filename extension, for example ".png". See Prima::image-load.
-file_format(string orundef)-
The file format as a string like "PNG" or "JPEG", or
undefif unknown or never set. Getting or setting-file_formatoperates on the$primaimage->{'extras'}->{'codecID'}field of the underlyingPrime::Image.After
loadthe-file_formatis the format read. Setting-file_formatchanges the format for a subsequentsave. -hotx(integer or undef, default undef)-hoty(integer or undef, default undef)-
The cursor hotspot in images with that attribute. These are the
hotSpotXandhotSpotYextra in the$primaimage->{'extras'}(see Prima::codecs and "Querying extra information" in Prima::image-load). As of Prima 1.29 they're available from XPM and XBM format files. -quality_percent(0 to 100 orundef)-
The image quality when saving to JPEG format. JPEG compresses by reducing colours and resolution in ways that are not too noticeable to the human eye. 100 means full quality, no such reductions.
undefmeans the Prima default, which is 75.This becomes the
qualityparameter to$primaimage->save().
SEE ALSO
Image::Base, Prima::Image, Prima::image-load, Image::Base::Prima::Drawable
Image::Xpm, Image::Xbm, Image::Base::GD, Image::Base::PNGwriter, Image::Base::Gtk2::Gdk::Pixbuf
HOME PAGE
http://user42.tuxfamily.org/image-base-prima/index.html
LICENSE
Image-Base-Prima is Copyright 2010, 2011, 2015 Kevin Ryde
Image-Base-Prima is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
Image-Base-Prima is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Image-Base-Prima. If not, see <http://www.gnu.org/licenses/>.