Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
devel:languages:perl:CPAN-G
perl-GD
perl-GD.spec
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File perl-GD.spec of Package perl-GD
# # spec file for package perl-GD # # Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # %define cpan_name GD Name: perl-GD Version: 2.82 Release: 0 License: Artistic-1.0 OR GPL-1.0-or-later Summary: Perl interface to the libgd graphics library URL: https://metacpan.org/release/%{cpan_name} Source0: https://cpan.metacpan.org/authors/id/R/RU/RURBAN/%{cpan_name}-%{version}.tar.gz BuildRequires: perl BuildRequires: perl-macros BuildRequires: perl(ExtUtils::Constant) >= 0.22 BuildRequires: perl(ExtUtils::PkgConfig) BuildRequires: perl(Test::Fork) >= 0.02 BuildRequires: perl(Test::More) >= 0.88 BuildRequires: perl(Test::NoWarnings) >= 1.00 %{perl_requires} %description *GD.pm* 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: * 'GD::Image' An image class, which holds the image data and accepts graphic primitive method calls. * 'GD::Font' A font class, which holds static font information and used for text rendering. * 'GD::Polygon' A simple polygon object, used for storing lists of vertices prior to rendering a polygon into an image. * 'GD::Simple' 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 GD::Simple for a description of these methods. A Simple Example: #!/usr/bin/perl use GD; # create a new image $im = GD::Image->new(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: * 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, XBM or other supported image files. * 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. * 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. * 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. * 5. When you're done drawing, you can convert the image into PNG format by sending it a png() message (or any other supported image format). 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 'binmode()' on the file you are writing the image to. %prep %autosetup -n %{cpan_name}-%{version} find . -type f ! -path "*/t/*" ! -name "*.pl" ! -path "*/bin/*" ! -path "*/script/*" ! -path "*/scripts/*" ! -name "configure" -print0 | xargs -0 chmod 644 %build perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}" %make_build %check make test %install %perl_make_install %perl_process_packlist %perl_gen_filelist %files -f %{name}.files %doc ChangeLog const-c.inc const-xs.inc README README.QUICKDRAW testcpan.sh testlibs.sh %license LICENSE %changelog
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor