?¡ëPNG
IHDR ? f ??C1 sRGB ??¨¦ gAMA ¡À?¨¹a pHYs ? ??o¡§d GIDATx^¨ª¨¹L¡±¡Âe¡ÂY?a?("Bh?_¨°???¡é¡ì?q5k?*:t0A-o??£¤]VkJ¡éM??f?¡À8\k2¨ªll¡ê1]q?¨´???T
Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/user1137782/www/china1.by/classwithtostring.php on line 86
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 213
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 214
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 215
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 216
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 217
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 218
package GD;
# Copyright 1995 Lincoln D. Stein. See accompanying README file for
# usage information
use strict;
require 5.004;
require FileHandle;
require Exporter;
require DynaLoader;
require AutoLoader;
use Carp 'croak','carp';
use GD::Image;
use GD::Polygon;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $AUTOLOAD);
$VERSION = '2.44';
@ISA = qw(Exporter DynaLoader);
# Items to export into callers namespace by default. Note: do not export
# names by default without a very good reason. Use EXPORT_OK instead.
# Do not simply export all your public functions/methods/constants.
@EXPORT = qw(
gdBrushed
gdDashSize
gdMaxColors
gdStyled
gdStyledBrushed
gdTiled
gdTransparent
gdAntiAliased
gdArc
gdChord
gdPie
gdNoFill
gdEdged
gdTinyFont
gdSmallFont
gdMediumBoldFont
gdLargeFont
gdGiantFont
gdAlphaMax
gdAlphaOpaque
gdAlphaTransparent
);
@EXPORT_OK = qw (
GD_CMP_IMAGE
GD_CMP_NUM_COLORS
GD_CMP_COLOR
GD_CMP_SIZE_X
GD_CMP_SIZE_Y
GD_CMP_TRANSPARENT
GD_CMP_BACKGROUND
GD_CMP_INTERLACE
GD_CMP_TRUECOLOR
);
%EXPORT_TAGS = ('cmp' => [qw(GD_CMP_IMAGE
GD_CMP_NUM_COLORS
GD_CMP_COLOR
GD_CMP_SIZE_X
GD_CMP_SIZE_Y
GD_CMP_TRANSPARENT
GD_CMP_BACKGROUND
GD_CMP_INTERLACE
GD_CMP_TRUECOLOR
)
]
);
# documentation error
*GD::Polygon::delete = \&GD::Polygon::deletePt;
sub AUTOLOAD {
# This AUTOLOAD is used to 'autoload' constants from the constant()
# XS function. If a constant is not found then control is passed
# to the AUTOLOAD in AutoLoader.
my($constname);
($constname = $AUTOLOAD) =~ s/.*:://;
my $val = constant($constname);
if ($! != 0) {
if ($! =~ /Invalid/) {
$AutoLoader::AUTOLOAD = $AUTOLOAD;
goto &AutoLoader::AUTOLOAD;
}
else {
my($pack,$file,$line) = caller;
die "Your vendor has not defined GD macro $pack\:\:$constname, used at $file line $line.\n";
}
}
eval "sub $AUTOLOAD { $val }";
goto &$AUTOLOAD;
}
bootstrap GD;
# Preloaded methods go here.
sub GD::gdSmallFont {
return GD::Font->Small;
}
sub GD::gdLargeFont {
return GD::Font->Large;
}
sub GD::gdMediumBoldFont {
return GD::Font->MediumBold;
}
sub GD::gdTinyFont {
return GD::Font->Tiny;
}
sub GD::gdGiantFont {
return GD::Font->Giant;
}
sub GD::Image::startGroup { } # does nothing - used by GD::SVG
sub GD::Image::endGroup { } # does nothing - used by GD::SVG
sub GD::Image::newGroup {
my $self = shift;
GD::Group->new($self,$self->startGroup);
}
=head1 NAME
GD.pm - Interface to Gd Graphics Library
=head1 SYNOPSIS
use GD;
# create a new image
$im = new GD::Image(100,100);
# allocate some colors
$white = $im->colorAllocate(255,255,255);
$black = $im->colorAllocate(0,0,0);
$red = $im->colorAllocate(255,0,0);
$blue = $im->colorAllocate(0,0,255);
# make the background transparent and interlaced
$im->transparent($white);
$im->interlaced('true');
# Put a black frame around the picture
$im->rectangle(0,0,99,99,$black);
# Draw a blue oval
$im->arc(50,50,95,75,0,360,$blue);
# And fill it with red
$im->fill(50,50,$red);
# make sure we are writing to a binary stream
binmode STDOUT;
# Convert the image to PNG and print it on standard output
print $im->png;
=head1 DESCRIPTION
B is a Perl interface to Thomas Boutell's gd graphics library
(version 2.01 or higher; see below). GD allows you to create color
drawings using a large number of graphics primitives, and emit the
drawings as PNG files.
GD defines the following four classes:
=over 5
=item C
An image class, which holds the image data and accepts graphic
primitive method calls.
=item C
A font class, which holds static font information and used for text
rendering.
=item C
A simple polygon object, used for storing lists of vertices prior to
rendering a polygon into an image.
=item C
A "simple" class that simplifies the GD::Image API and then adds a set
of object-oriented drawing methods using turtle graphics, simplified
font handling, ability to work in polar coordinates, HSV color spaces,
and human-readable color names like "lightblue". Please see
L for a description of these methods.
=back
A Simple Example:
#!/usr/local/bin/perl
use GD;
# create a new image
$im = new GD::Image(100,100);
# allocate some colors
$white = $im->colorAllocate(255,255,255);
$black = $im->colorAllocate(0,0,0);
$red = $im->colorAllocate(255,0,0);
$blue = $im->colorAllocate(0,0,255);
# make the background transparent and interlaced
$im->transparent($white);
$im->interlaced('true');
# Put a black frame around the picture
$im->rectangle(0,0,99,99,$black);
# Draw a blue oval
$im->arc(50,50,95,75,0,360,$blue);
# And fill it with red
$im->fill(50,50,$red);
# make sure we are writing to a binary stream
binmode STDOUT;
# Convert the image to PNG and print it on standard output
print $im->png;
Notes:
=over 5
=item 1.
To create a new, empty image, send a new() message to GD::Image, passing
it the width and height of the image you want to create. An image
object will be returned. Other class methods allow you to initialize
an image from a preexisting JPG, PNG, GD, GD2 or XBM file.
=item 2.
Next you will ordinarily add colors to the image's color table.
colors are added using a colorAllocate() method call. The three
parameters in each call are the red, green and blue (rgb) triples for
the desired color. The method returns the index of that color in the
image's color table. You should store these indexes for later use.
=item 3.
Now you can do some drawing! The various graphics primitives are
described below. In this example, we do some text drawing, create an
oval, and create and draw a polygon.
=item 4.
Polygons are created with a new() message to GD::Polygon. You can add
points to the returned polygon one at a time using the addPt() method.
The polygon can then be passed to an image for rendering.
=item 5.
When you're done drawing, you can convert the image into PNG format by
sending it a png() message. It will return a (potentially large)
scalar value containing the binary data for the image. Ordinarily you
will print it out at this point or write it to a file. To ensure
portability to platforms that differentiate between text and binary
files, be sure to call C on the file you are writing
the image to.
=back
=head1 Object Constructors: Creating Images
The following class methods allow you to create new GD::Image objects.
=over 4
=item B<$image = GD::Image-Enew([$width,$height],[$truecolor])>
=item B<$image = GD::Image-Enew(*FILEHANDLE)>
=item B<$image = GD::Image-Enew($filename)>
=item B<$image = GD::Image-Enew($data)>
The new() method is the main constructor for the GD::Image class.
Called with two integer arguments, it creates a new blank image of the
specified width and height. For example:
$myImage = new GD::Image(100,100) || die;
This will create an image that is 100 x 100 pixels wide. If you don't
specify the dimensions, a default of 64 x 64 will be chosen.
The optional third argument, $truecolor, tells new() to create a
truecolor GD::Image object. Truecolor images have 24 bits of color
data (eight bits each in the red, green and blue channels
respectively), allowing for precise photograph-quality color usage.
If not specified, the image will use an 8-bit palette for
compatibility with older versions of libgd.
Alternatively, you may create a GD::Image object based on an existing
image by providing an open filehandle, a filename, or the image data
itself. The image formats automatically recognized and accepted are:
PNG, JPEG, XPM and GD2. Other formats, including WBMP, and GD
version 1, cannot be recognized automatically at this time.
If something goes wrong (e.g. insufficient memory), this call will
return undef.
=item B<$image = GD::Image-EtrueColor([0,1])>
For backwards compatibility with scripts previous versions of GD,
new images created from scratch (width, height) are palette based
by default. To change this default to create true color images use:
GD::Image->trueColor(1);
somewhere before creating new images. To switch back to palette
based by default, use:
GD::Image->trueColor(0);
=item B<$image = GD::Image-EnewPalette([$width,$height])>
=item B<$image = GD::Image-EnewTrueColor([$width,$height])>
The newPalette() and newTrueColor() methods can be used to explicitly
create an palette based or true color image regardless of the
current setting of trueColor().
=item B<$image = GD::Image-EnewFromPng($file, [$truecolor])>
=item B<$image = GD::Image-EnewFromPngData($data, [$truecolor])>
The newFromPng() method will create an image from a PNG file read in
through the provided filehandle or file path. The filehandle must
previously have been opened on a valid PNG file or pipe. If
successful, this call will return an initialized image which you can
then manipulate as you please. If it fails, which usually happens if
the thing at the other end of the filehandle is not a valid PNG file,
the call returns undef. Notice that the call doesn't automatically
close the filehandle for you. But it does call C
for you, on platforms where this matters.
You may use any of the following as the argument:
1) a simple filehandle, such as STDIN
2) a filehandle glob, such as *PNG
3) a reference to a glob, such as \*PNG
4) an IO::Handle object
5) the pathname of a file
In the latter case, newFromPng() will attempt to open the file for you
and read the PNG information from it.
Example1:
open (PNG,"barnswallow.png") || die;
$myImage = newFromPng GD::Image(\*PNG) || die;
close PNG;
Example2:
$myImage = newFromPng GD::Image('barnswallow.png');
To get information about the size and color usage of the information,
you can call the image query methods described below. Images created
by reading PNG images will be truecolor if the image file itself is
truecolor. To force the image to be palette-based, pass a value of 0
in the optional $truecolor argument.
The newFromPngData() method will create a new GD::Image initialized
with the PNG format B contained in C<$data>.
=item B<$image = GD::Image-EnewFromJpeg($file, [$truecolor])>
=item B<$image = GD::Image-EnewFromJpegData($data, [$truecolor])>
These methods will create an image from a JPEG file. They work just
like newFromPng() and newFromPngData(), and will accept the same
filehandle and pathname arguments.
Images created by reading JPEG images will always be truecolor. To
force the image to be palette-based, pass a value of 0 in the optional
$truecolor argument.
=item B<$image = GD::Image-EnewFromGif($file)>
=item B<$image = GD::Image-EnewFromGifData($data)>
These methods will create an image from a GIF file. They work just
like newFromPng() and newFromPngData(), and will accept the same
filehandle and pathname arguments.
Images created from GIFs are always 8-bit palette images. To convert
to truecolor, you must create a truecolor image and then perform a
copy.
=item B<$image = GD::Image-EnewFromXbm($file)>
This works in exactly the same way as C, but reads the
contents of an X Bitmap (black & white) file:
open (XBM,"coredump.xbm") || die;
$myImage = newFromXbm GD::Image(\*XBM) || die;
close XBM;
There is no newFromXbmData() function, because there is no
corresponding function in the gd library.
=item B<$image = GD::Image-EnewFromGd($file)>
=item B<$image = GD::Image-EnewFromGdData($data)>
These methods initialize a GD::Image from a Gd file, filehandle, or
data. Gd is Tom Boutell's disk-based storage format, intended for the
rare case when you need to read and write the image to disk quickly.
It's not intended for regular use, because, unlike PNG or JPEG, no
image compression is performed and these files can become B.
$myImage = newFromGd GD::Image("godzilla.gd") || die;
close GDF;
=item B<$image = GD::Image-EnewFromGd2($file)>
=item B<$image = GD::Image-EnewFromGd2Data($data)>
This works in exactly the same way as C and
newFromGdData, but use the new compressed GD2 image format.
=item B<$image = GD::Image-EnewFromGd2Part($file,srcX,srcY,width,height)>
This class method allows you to read in just a portion of a GD2 image
file. In addition to a filehandle, it accepts the top-left corner and
dimensions (width,height) of the region of the image to read. For
example:
open (GDF,"godzilla.gd2") || die;
$myImage = GD::Image->newFromGd2Part(\*GDF,10,20,100,100) || die;
close GDF;
This reads a 100x100 square portion of the image starting from
position (10,20).
=item B<$image = GD::Image-EnewFromXpm($filename)>
This creates a new GD::Image object starting from a B. This
is unlike the other newFrom() functions because it does not take a
filehandle. This difference comes from an inconsistency in the
underlying gd library.
$myImage = newFromXpm GD::Image('earth.xpm') || die;
This function is only available if libgd was compiled with XPM
support.
NOTE: The libgd library is unable to read certain XPM files, returning
an all-black image instead.
=head1 GD::Image Methods
Once a GD::Image object is created, you can draw with it, copy it, and
merge two images. When you are finished manipulating the object, you
can convert it into a standard image file format to output or save to
a file.
=head2 Image Data Output Methods
The following methods convert the internal drawing format into
standard output file formats.
=item B<$pngdata = $image-Epng([$compression_level])>
This returns the image data in PNG format. You can then print it,
pipe it to a display program, or write it to a file. Example:
$png_data = $myImage->png;
open (DISPLAY,"| display -") || die;
binmode DISPLAY;
print DISPLAY $png_data;
close DISPLAY;
Note the use of C. This is crucial for portability to
DOSish platforms.
The optional $compression_level argument controls the amount of
compression to apply to the output PNG image. Values range from 0-9,
where 0 means no compression (largest files, highest quality) and 9
means maximum compression (smallest files, worst quality). A
compression level of -1 uses the default compression level selected
when zlib was compiled on your system, and is the same as calling
png() with no argument. Be careful not to confuse this argument with
the jpeg() quality argument, which ranges from 0-100 and has the
opposite meaning from compression (higher numbers give higher
quality).
=item B<$gifdata = $image-Egifanimbegin([$GlobalCM [, $Loops]])>
For libgd version 2.0.33 and higher, this call begins an animated GIF
by returning the data that comprises animated gif image file header.
After you call this method, call gifanimadd() one or more times to add
the frames of the image. Then call gifanimend(). Each frame must be
the same width and height.
A typical sequence will look like this:
my $gifdata = $image->gifanimbegin;
$gifdata .= $image->gifanimadd; # first frame
for (1..100) {
# make a frame of right size
my $frame = GD::Image->new($image->getBounds);
add_frame_data($frame); # add the data for this frame
$gifdata .= $frame->gifanimadd; # add frame
}
$gifdata .= $image->gifanimend; # finish the animated GIF
print $gifdata; # write animated gif to STDOUT
If you do not wish to store the data in memory, you can print it to
stdout or a file.
The image that you call gifanimbegin on is used to set the image size,
color resolution and color map. If argument $GlobalCM is 1, the image
color map becomes the GIF89a global color map. If $Loops is given and
>= 0, the NETSCAPE2.0 application extension is created, with looping
count. Looping count 0 means forever.
=item B<$gifdata = $image-Egifanimadd([$LocalCM [, $LeftOfs [, $TopOfs [, $Delay [, $Disposal [, $previm]]]]]])>
Returns the data that comprises one animated gif image frame. You can
then print it, pipe it to a display program, or write it to a file.
With $LeftOfs and $TopOfs you can place this frame in different offset
than (0,0) inside the image screen. Delay between the previous frame
and this frame is in 1/100s units. Disposal is usually and by default
1. Compression is activated by giving the previous image as a
parameter. This function then compares the images and only writes the
changed pixels to the new frame in animation. The Disposal parameter
for optimized animations must be set to 1, also for the first frame.
$LeftOfs and $TopOfs parameters are ignored for optimized frames.
=item B<$gifdata = $image-Egifanimend()>
Returns the data for end segment of animated gif file. It always
returns string ';'. This string must be printed to an animated gif
file after all image frames to properly terminate it according to GIF
file syntax. Image object is not used at all in this method.
=item B<$jpegdata = $image-Ejpeg([$quality])>
This returns the image data in JPEG format. You can then print it,
pipe it to a display program, or write it to a file. You may pass an
optional quality score to jpeg() in order to control the JPEG quality.
This should be an integer between 0 and 100. Higher quality scores
give larger files and better image quality. If you don't specify the
quality, jpeg() will choose a good default.
=item B<$gifdata = $image-Egif()>.
This returns the image data in GIF format. You can then print it,
pipe it to a display program, or write it to a file.
=item B<$gddata = $image-Egd>
This returns the image data in GD format. You can then print it,
pipe it to a display program, or write it to a file. Example:
binmode MYOUTFILE;
print MYOUTFILE $myImage->gd;
=item B<$gd2data = $image-Egd2>
Same as gd(), except that it returns the data in compressed GD2
format.
=item B<$wbmpdata = $image-Ewbmp([$foreground])>
This returns the image data in WBMP format, which is a black-and-white
image format. Provide the index of the color to become the foreground
color. All other pixels will be considered background.
=back
=head2 Color Control
These methods allow you to control and manipulate the GD::Image color
table.
=over 4
=item B<$index = $image-EcolorAllocate(red,green,blue)>
This allocates a color with the specified red, green and blue
components and returns its index in the color table, if specified.
The first color allocated in this way becomes the image's background
color. (255,255,255) is white (all pixels on). (0,0,0) is black (all
pixels off). (255,0,0) is fully saturated red. (127,127,127) is 50%
gray. You can find plenty of examples in /usr/X11/lib/X11/rgb.txt.
If no colors are allocated, then this function returns -1.
Example:
$white = $myImage->colorAllocate(0,0,0); #background color
$black = $myImage->colorAllocate(255,255,255);
$peachpuff = $myImage->colorAllocate(255,218,185);
=item B<$index = $image-EcolorAllocateAlpha(reg,green,blue,alpha)>
This allocates a color with the specified red, green, and blue components,
plus the specified alpha channel. The alpha value may range from 0 (opaque)
to 127 (transparent). The C function changes the way this
alpha channel affects the resulting image.
=item B<$image-EcolorDeallocate(colorIndex)>
This marks the color at the specified index as being ripe for
reallocation. The next time colorAllocate is used, this entry will be
replaced. You can call this method several times to deallocate
multiple colors. There's no function result from this call.
Example:
$myImage->colorDeallocate($peachpuff);
$peachy = $myImage->colorAllocate(255,210,185);
=item B<$index = $image-EcolorClosest(red,green,blue)>
This returns the index of the color closest in the color table to the
red green and blue components specified. If no colors have yet been
allocated, then this call returns -1.
Example:
$apricot = $myImage->colorClosest(255,200,180);
=item B<$index = $image-EcolorClosestHWB(red,green,blue)>
This also attempts to return the color closest in the color table to the
red green and blue components specified. It uses a Hue/White/Black
color representation to make the selected color more likely to match
human perceptions of similar colors.
If no colors have yet been
allocated, then this call returns -1.
Example:
$mostred = $myImage->colorClosestHWB(255,0,0);
=item B<$index = $image-EcolorExact(red,green,blue)>
This returns the index of a color that exactly matches the specified
red green and blue components. If such a color is not in the color
table, this call returns -1.
$rosey = $myImage->colorExact(255,100,80);
warn "Everything's coming up roses.\n" if $rosey >= 0;
=item B<$index = $image-EcolorResolve(red,green,blue)>
This returns the index of a color that exactly matches the specified
red green and blue components. If such a color is not in the color
table and there is room, then this method allocates the color in the
color table and returns its index.
$rosey = $myImage->colorResolve(255,100,80);
warn "Everything's coming up roses.\n" if $rosey >= 0;
=item B<$colorsTotal = $image-EcolorsTotal> I