Imager

 view release on metacpan or  search on metacpan

lib/Imager/APIRef.pod  view on Meta::CPAN



Creates a new image that is a copy of the image C<source>.

Tags are not copied, only the image data.

Returns: i_img *


=for comment
From: File image.c

=item i_copyto(C<dest>, C<src>, C<x1>, C<y1>, C<x2>, C<y2>, C<tx>, C<ty>)


Copies image data from the area (C<x1>,C<y1>)-[C<x2>,C<y2>] in the
source image to a rectangle the same size with it's top-left corner at
(C<tx>,C<ty>) in the destination image.

If C<x1> > C<x2> or C<y1> > C<y2> then the corresponding co-ordinates
are swapped.


=for comment
From: File paste.im

=item i_copyto_trans(C<im>, C<src>, C<x1>, C<y1>, C<x2>, C<y2>, C<tx>, C<ty>, C<trans>)


(C<x1>,C<y1>) (C<x2>,C<y2>) specifies the region to copy (in the
source coordinates) (C<tx>,C<ty>) specifies the upper left corner for
the target image.  pass NULL in C<trans> for non transparent i_colors.


=for comment
From: File image.c

=item i_img_info(im, info)


Return image information

   im - Image pointer
   info - pointer to array to return data

info is an array of 4 integers with the following values:

 info[0] - width
 info[1] - height
 info[2] - channels
 info[3] - channel mask


=for comment
From: File image.c

=item i_rubthru(C<im>, C<src>, C<tx>, C<ty>, C<src_minx>, C<src_miny>, C<src_maxx>, C<src_maxy>)


Takes the sub image C<src>[C<src_minx>, C<src_maxx>)[C<src_miny>, C<src_maxy>)> and
overlays it at (C<tx>,C<ty>) on the image object.

The alpha channel of each pixel in C<src> is used to control how much
the existing color in C<im> is replaced, if it is 255 then the color
is completely replaced, if it is 0 then the original color is left
unmodified.


=for comment
From: File rubthru.im


=back

=head2 Image creation/destruction

=over

=item i_sametype(C<im>, C<xsize>, C<ysize>)


  i_img *img = i_sametype(src, width, height);

Returns an image of the same type (sample size, channels, paletted/direct).

For paletted images the palette is copied from the source.


=for comment
From: File image.c

=item i_sametype_chans(C<im>, C<xsize>, C<ysize>, C<channels>)


  i_img *img = i_sametype_chans(src, width, height, channels);

Returns an image of the same type (sample size).

For paletted images the equivalent direct type is returned.


=for comment
From: File image.c

=item im_img_16_new(ctx, x, y, ch)
X<im_img_16_new API>X<i_img_16_new API>

  i_img *img = im_img_16_new(aIMCTX, width, height, channels);
  i_img *img = i_img_16_new(width, height, channels);

Create a new 16-bit/sample image.

Returns the image on success, or NULL on failure.

Also callable as C<i_img_16_new(x, y, ch)>


=for comment
From: File img16.c

=item im_img_8_new(ctx, x, y, ch)



( run in 0.456 second using v1.01-cache-2.11-cpan-99c4e6809bf )