new
Creates a new PDL::IO::GD object.
Accepts a hash describing how to create the object. Accepts a single hash ( with curly braces ), an
inline hash (the same, but without the braces) or a single string interpreted as a filename. Thus the
following are all equivalent:
PDL::IO::GD->new( {filename => 'image.png'} );
PDL::IO::GD->new( filename => 'image.png' );
PDL::IO::GD->new( 'image.png' );
If the hash has:
pdl => $pdl_var (lut => $lut_ndarray)
Then a new GD is created from that PDL variable.
filename => $file
Then a new GD is created from the image file.
x => $num, y => $num
Then a new GD is created as a palette image, with size x, y
x => $num, y => $num, true_color => 1
Then a new GD is created as a true color image, with size x, y
data => $scalar (type => $typename)
Then a new GD is created from the file data stored in $scalar.
If no type is given, then it will try to guess the type of the data, but
this will not work for WBMP and gd image types. For those types, you
_must_ specify the type of the data, or the operation will fail.
Valid types are: 'jpg', 'png', 'gif', 'gd', 'gd2', 'wbmp'.
Example:
my $gd = PDL::IO::GD->new({ pdl => $pdl_var });
my $gd = PDL::IO::GD->new({ pdl => $pdl_var, lut => $lut_ndarray });
my $gd = PDL::IO::GD->new({ filename => "image.png" });
my $gd = PDL::IO::GD->new({ x => 100, y => 100 });
my $gd = PDL::IO::GD->new({ x => 100, y => 100, true_color => 1 });
my $gd = PDL::IO::GD->new({ data => $imageData });
my $gd = PDL::IO::GD->new({ data => $imageData, type => 'wbmp' });
to_pdl
When you're done playing with your GDImage and want an ndarray back, use this function to return one.
For true-colour, RGB dim is highest (x,y,3). To get it in the lowest dim (and with y=0 is the bottom),
use "to_rpic".
to_rpic
When you're done playing with your GDImage and want an ndarray back, use this function to return one.
For true-colour, RGB dim is lowest (3,x,y). To get it in the highest dim (and with y=0 is the top), use
"to_pdl".
apply_lut($lut(ndarray))
Does a $im->ColorAllocate() for an entire LUT ndarray at once.
The LUT ndarray format is the same as for the general interface above.
WARNING:
All of the docs below this point are auto-generated (not to mention the actual code), so read with a
grain of salt, and always check the main GD documentation about how that function works and what it does.
write_Png
$image->write_Png( $filename )
write_PngEx
$image->write_PngEx( $filename, $level )
write_WBMP
$image->write_WBMP( $fg, $filename )
write_Jpeg
$image->write_Jpeg( $filename, $quality )
write_Gd
$image->write_Gd( $filename )
write_Gd2
$image->write_Gd2( $filename, $cs, $fmt )
write_Gif
$image->write_Gif( $filename )
get_Png_data
$image->get_Png_data( )
get_PngEx_data
$image->get_PngEx_data( $level )
get_WBMP_data
$image->get_WBMP_data( $fg )
get_Jpeg_data
$image->get_Jpeg_data( $quality )
get_Gd_data
$image->get_Gd_data( )
get_Gd2_data
$image->get_Gd2_data( $cs, $fmt )
SetPixel
$image->SetPixel( $x, $y, $color )
Alias for gdImageSetPixel.
gdImageSetPixel
$image->gdImageSetPixel( $x, $y, $color )
GetPixel
$image->GetPixel( $x, $y )
Alias for gdImageGetPixel.
gdImageGetPixel
$image->gdImageGetPixel( $x, $y )
AABlend
$image->AABlend( )
Alias for gdImageAABlend.
gdImageAABlend
$image->gdImageAABlend( )
Line
$image->Line( $x1, $y1, $x2, $y2, $color )
Alias for gdImageLine.
gdImageLine
$image->gdImageLine( $x1, $y1, $x2, $y2, $color )
DashedLine
$image->DashedLine( $x1, $y1, $x2, $y2, $color )
Alias for gdImageDashedLine.
gdImageDashedLine
$image->gdImageDashedLine( $x1, $y1, $x2, $y2, $color )
Rectangle
$image->Rectangle( $x1, $y1, $x2, $y2, $color )
Alias for gdImageRectangle.
gdImageRectangle
$image->gdImageRectangle( $x1, $y1, $x2, $y2, $color )
FilledRectangle
$image->FilledRectangle( $x1, $y1, $x2, $y2, $color )
Alias for gdImageFilledRectangle.
gdImageFilledRectangle
$image->gdImageFilledRectangle( $x1, $y1, $x2, $y2, $color )
SetClip
$image->SetClip( $x1, $y1, $x2, $y2 )
Alias for gdImageSetClip.
gdImageSetClip
$image->gdImageSetClip( $x1, $y1, $x2, $y2 )
GetClip
$image->GetClip( $x1P, $y1P, $x2P, $y2P )
Alias for gdImageGetClip.
gdImageGetClip
$image->gdImageGetClip( $x1P, $y1P, $x2P, $y2P )
BoundsSafe
$image->BoundsSafe( $x, $y )
Alias for gdImageBoundsSafe.
gdImageBoundsSafe
$image->gdImageBoundsSafe( $x, $y )
Char
$image->Char( $f, $x, $y, $c, $color )
Alias for gdImageChar.
gdImageChar
$image->gdImageChar( $f, $x, $y, $c, $color )
CharUp
$image->CharUp( $f, $x, $y, $c, $color )
Alias for gdImageCharUp.
gdImageCharUp
$image->gdImageCharUp( $f, $x, $y, $c, $color )
String
$image->String( $f, $x, $y, $s, $color )
Alias for gdImageString.
gdImageString
$image->gdImageString( $f, $x, $y, $s, $color )
StringUp
$image->StringUp( $f, $x, $y, $s, $color )
Alias for gdImageStringUp.
gdImageStringUp
$image->gdImageStringUp( $f, $x, $y, $s, $color )
String16
$image->String16( $f, $x, $y, $s, $color )
Alias for gdImageString16.
gdImageString16
$image->gdImageString16( $f, $x, $y, $s, $color )
StringUp16
$image->StringUp16( $f, $x, $y, $s, $color )
Alias for gdImageStringUp16.
gdImageStringUp16
$image->gdImageStringUp16( $f, $x, $y, $s, $color )
Polygon
$image->Polygon( $p, $n, $c )
Alias for gdImagePolygon.
gdImagePolygon
$image->gdImagePolygon( $p, $n, $c )
FilledPolygon
$image->FilledPolygon( $p, $n, $c )
Alias for gdImageFilledPolygon.
gdImageFilledPolygon
$image->gdImageFilledPolygon( $p, $n, $c )
ColorAllocate
$image->ColorAllocate( $r, $g, $b )
Alias for gdImageColorAllocate.
gdImageColorAllocate
$image->gdImageColorAllocate( $r, $g, $b )
ColorAllocateAlpha
$image->ColorAllocateAlpha( $r, $g, $b, $a )
Alias for gdImageColorAllocateAlpha.
gdImageColorAllocateAlpha
$image->gdImageColorAllocateAlpha( $r, $g, $b, $a )
ColorClosest
$image->ColorClosest( $r, $g, $b )
Alias for gdImageColorClosest.
gdImageColorClosest
$image->gdImageColorClosest( $r, $g, $b )
ColorClosestAlpha
$image->ColorClosestAlpha( $r, $g, $b, $a )
Alias for gdImageColorClosestAlpha.
gdImageColorClosestAlpha
$image->gdImageColorClosestAlpha( $r, $g, $b, $a )
ColorClosestHWB
$image->ColorClosestHWB( $r, $g, $b )
Alias for gdImageColorClosestHWB.
gdImageColorClosestHWB
$image->gdImageColorClosestHWB( $r, $g, $b )
ColorExact
$image->ColorExact( $r, $g, $b )
Alias for gdImageColorExact.
gdImageColorExact
$image->gdImageColorExact( $r, $g, $b )
ColorExactAlpha
$image->ColorExactAlpha( $r, $g, $b, $a )
Alias for gdImageColorExactAlpha.
gdImageColorExactAlpha
$image->gdImageColorExactAlpha( $r, $g, $b, $a )
ColorResolve
$image->ColorResolve( $r, $g, $b )
Alias for gdImageColorResolve.
gdImageColorResolve
$image->gdImageColorResolve( $r, $g, $b )
ColorResolveAlpha
$image->ColorResolveAlpha( $r, $g, $b, $a )
Alias for gdImageColorResolveAlpha.
gdImageColorResolveAlpha
$image->gdImageColorResolveAlpha( $r, $g, $b, $a )
ColorDeallocate
$image->ColorDeallocate( $color )
Alias for gdImageColorDeallocate.
gdImageColorDeallocate
$image->gdImageColorDeallocate( $color )
TrueColorToPalette
$image->TrueColorToPalette( $ditherFlag, $colorsWanted )
Alias for gdImageTrueColorToPalette.
gdImageTrueColorToPalette
$image->gdImageTrueColorToPalette( $ditherFlag, $colorsWanted )
ColorTransparent
$image->ColorTransparent( $color )
Alias for gdImageColorTransparent.
gdImageColorTransparent
$image->gdImageColorTransparent( $color )
FilledArc
$image->FilledArc( $cx, $cy, $w, $h, $s, $e, $color, $style )
Alias for gdImageFilledArc.
gdImageFilledArc
$image->gdImageFilledArc( $cx, $cy, $w, $h, $s, $e, $color, $style )
Arc
$image->Arc( $cx, $cy, $w, $h, $s, $e, $color )
Alias for gdImageArc.
gdImageArc
$image->gdImageArc( $cx, $cy, $w, $h, $s, $e, $color )
FilledEllipse
$image->FilledEllipse( $cx, $cy, $w, $h, $color )
Alias for gdImageFilledEllipse.
gdImageFilledEllipse
$image->gdImageFilledEllipse( $cx, $cy, $w, $h, $color )
FillToBorder
$image->FillToBorder( $x, $y, $border, $color )
Alias for gdImageFillToBorder.
gdImageFillToBorder
$image->gdImageFillToBorder( $x, $y, $border, $color )
Fill
$image->Fill( $x, $y, $color )
Alias for gdImageFill.
gdImageFill
$image->gdImageFill( $x, $y, $color )
CopyRotated
$image->CopyRotated( $dstX, $dstY, $srcX, $srcY, $srcWidth, $srcHeight, $angle )
Alias for gdImageCopyRotated.
gdImageCopyRotated
$image->gdImageCopyRotated( $dstX, $dstY, $srcX, $srcY, $srcWidth, $srcHeight, $angle )
SetBrush
$image->SetBrush( )
Alias for gdImageSetBrush.
gdImageSetBrush
$image->gdImageSetBrush( )
SetTile
$image->SetTile( )
Alias for gdImageSetTile.
gdImageSetTile
$image->gdImageSetTile( )
SetAntiAliased
$image->SetAntiAliased( $c )
Alias for gdImageSetAntiAliased.
gdImageSetAntiAliased
$image->gdImageSetAntiAliased( $c )
SetAntiAliasedDontBlend
$image->SetAntiAliasedDontBlend( $c, $dont_blend )
Alias for gdImageSetAntiAliasedDontBlend.
gdImageSetAntiAliasedDontBlend
$image->gdImageSetAntiAliasedDontBlend( $c, $dont_blend )
SetStyle
$image->SetStyle( $style, $noOfPixels )
Alias for gdImageSetStyle.
gdImageSetStyle
$image->gdImageSetStyle( $style, $noOfPixels )
SetThickness
$image->SetThickness( $thickness )
Alias for gdImageSetThickness.
gdImageSetThickness
$image->gdImageSetThickness( $thickness )
Interlace
$image->Interlace( $interlaceArg )
Alias for gdImageInterlace.
gdImageInterlace
$image->gdImageInterlace( $interlaceArg )
AlphaBlending
$image->AlphaBlending( $alphaBlendingArg )
Alias for gdImageAlphaBlending.
gdImageAlphaBlending
$image->gdImageAlphaBlending( $alphaBlendingArg )
SaveAlpha
$image->SaveAlpha( $saveAlphaArg )
Alias for gdImageSaveAlpha.
gdImageSaveAlpha
$image->gdImageSaveAlpha( $saveAlphaArg )
TrueColor
$image->TrueColor( )
Alias for gdImageTrueColor.
gdImageTrueColor
$image->gdImageTrueColor( )
ColorsTotal
$image->ColorsTotal( )
Alias for gdImageColorsTotal.
gdImageColorsTotal
$image->gdImageColorsTotal( )
Red
$image->Red( $c )
Alias for gdImageRed.
gdImageRed
$image->gdImageRed( $c )
Green
$image->Green( $c )
Alias for gdImageGreen.
gdImageGreen
$image->gdImageGreen( $c )
Blue
$image->Blue( $c )
Alias for gdImageBlue.
gdImageBlue
$image->gdImageBlue( $c )
Alpha
$image->Alpha( $c )
Alias for gdImageAlpha.
gdImageAlpha
$image->gdImageAlpha( $c )
GetTransparent
$image->GetTransparent( )
Alias for gdImageGetTransparent.
gdImageGetTransparent
$image->gdImageGetTransparent( )
GetInterlaced
$image->GetInterlaced( )
Alias for gdImageGetInterlaced.
gdImageGetInterlaced
$image->gdImageGetInterlaced( )
SX
$image->SX( )
Alias for gdImageSX.
gdImageSX
$image->gdImageSX( )
SY
$image->SY( )
Alias for gdImageSY.
gdImageSY
$image->gdImageSY( )
ColorAllocates
$image->ColorAllocates( $r(pdl), $g(pdl), $b(pdl) )
Alias for gdImageColorAllocates.
gdImageColorAllocates
$image->gdImageColorAllocates( $r(pdl), $g(pdl), $b(pdl) )
ColorAllocateAlphas
$image->ColorAllocateAlphas( $r(pdl), $g(pdl), $b(pdl), $a(pdl) )
Alias for gdImageColorAllocateAlphas.
gdImageColorAllocateAlphas
$image->gdImageColorAllocateAlphas( $r(pdl), $g(pdl), $b(pdl), $a(pdl) )
SetPixels
$image->SetPixels( $x(pdl), $y(pdl), $color(pdl) )
Alias for gdImageSetPixels.
gdImageSetPixels
$image->gdImageSetPixels( $x(pdl), $y(pdl), $color(pdl) )
Lines
$image->Lines( $x1(pdl), $y1(pdl), $x2(pdl), $y2(pdl), $color(pdl) )
Alias for gdImageLines.
gdImageLines
$image->gdImageLines( $x1(pdl), $y1(pdl), $x2(pdl), $y2(pdl), $color(pdl) )
DashedLines
$image->DashedLines( $x1(pdl), $y1(pdl), $x2(pdl), $y2(pdl), $color(pdl) )
Alias for gdImageDashedLines.
gdImageDashedLines
$image->gdImageDashedLines( $x1(pdl), $y1(pdl), $x2(pdl), $y2(pdl), $color(pdl) )
Rectangles
$image->Rectangles( $x1(pdl), $y1(pdl), $x2(pdl), $y2(pdl), $color(pdl) )
Alias for gdImageRectangles.
gdImageRectangles
$image->gdImageRectangles( $x1(pdl), $y1(pdl), $x2(pdl), $y2(pdl), $color(pdl) )
FilledRectangles
$image->FilledRectangles( $x1(pdl), $y1(pdl), $x2(pdl), $y2(pdl), $color(pdl) )
Alias for gdImageFilledRectangles.
gdImageFilledRectangles
$image->gdImageFilledRectangles( $x1(pdl), $y1(pdl), $x2(pdl), $y2(pdl), $color(pdl) )
FilledArcs
$image->FilledArcs( $cx(pdl), $cy(pdl), $w(pdl), $h(pdl), $s(pdl), $e(pdl), $color(pdl), $style(pdl) )
Alias for gdImageFilledArcs.
gdImageFilledArcs
$image->gdImageFilledArcs( $cx(pdl), $cy(pdl), $w(pdl), $h(pdl), $s(pdl), $e(pdl), $color(pdl),
$style(pdl) )
Arcs
$image->Arcs( $cx(pdl), $cy(pdl), $w(pdl), $h(pdl), $s(pdl), $e(pdl), $color(pdl) )
Alias for gdImageArcs.
gdImageArcs
$image->gdImageArcs( $cx(pdl), $cy(pdl), $w(pdl), $h(pdl), $s(pdl), $e(pdl), $color(pdl) )
FilledEllipses
$image->FilledEllipses( $cx(pdl), $cy(pdl), $w(pdl), $h(pdl), $color(pdl) )
Alias for gdImageFilledEllipses.
gdImageFilledEllipses
$image->gdImageFilledEllipses( $cx(pdl), $cy(pdl), $w(pdl), $h(pdl), $color(pdl) )