100% found this document useful (1 vote)
8 views

Graphics Programming with Perl 1st Edition Martien Verbruggen instant download

Graphics Programming with Perl is a comprehensive guide aimed at programmers looking to manipulate graphics using the Perl programming language. The book covers various topics including image creation, editing, and combining, as well as developing libraries and modules for graphics tasks. It is designed for readers with a basic knowledge of Perl and provides practical references to achieve common graphics programming objectives.

Uploaded by

csehiimeran
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
8 views

Graphics Programming with Perl 1st Edition Martien Verbruggen instant download

Graphics Programming with Perl is a comprehensive guide aimed at programmers looking to manipulate graphics using the Perl programming language. The book covers various topics including image creation, editing, and combining, as well as developing libraries and modules for graphics tasks. It is designed for readers with a basic knowledge of Perl and provides practical references to achieve common graphics programming objectives.

Uploaded by

csehiimeran
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 42

Graphics Programming with Perl 1st Edition

Martien Verbruggen download

https://ebookultra.com/download/graphics-programming-with-
perl-1st-edition-martien-verbruggen/

Explore and download more ebooks or textbooks


at ebookultra.com
We have selected some products that you may be interested in
Click the link to download now or visit ebookultra.com
for more options!.

Programming the Network with Perl 1st Edition Paul Barry

https://ebookultra.com/download/programming-the-network-with-perl-1st-
edition-paul-barry/

Modern Perl Programming 1st Edition Michael Saltzman

https://ebookultra.com/download/modern-perl-programming-1st-edition-
michael-saltzman/

Advanced Perl Programming Second Edition Simon Cozens

https://ebookultra.com/download/advanced-perl-programming-second-
edition-simon-cozens/

Advanced 3D Game Programming with DirectX 10 0 Wordware


Game and Graphics Library 1st Edition Peter Walsh

https://ebookultra.com/download/advanced-3d-game-programming-with-
directx-10-0-wordware-game-and-graphics-library-1st-edition-peter-
walsh/
Penetration Testing with Perl 1st Edition Berdeaux

https://ebookultra.com/download/penetration-testing-with-perl-1st-
edition-berdeaux/

Perl Hacks Tips and Tools for Programming Debugging and


Surviving 1st Edition Chromatic

https://ebookultra.com/download/perl-hacks-tips-and-tools-for-
programming-debugging-and-surviving-1st-edition-chromatic/

XML Processing with Perl Python and PHP 1st Edition Martin
C. Brown

https://ebookultra.com/download/xml-processing-with-perl-python-and-
php-1st-edition-martin-c-brown/

Mobile 3D Graphics with OpenGL ES and M3G 1st Edition Kari


Pulli

https://ebookultra.com/download/mobile-3d-graphics-with-opengl-es-
and-m3g-1st-edition-kari-pulli/

Computer graphics with Open GL Fourth Edition.,Pearson New


International Edition Baker

https://ebookultra.com/download/computer-graphics-with-open-gl-fourth-
edition-pearson-new-international-edition-baker/
Graphics Programming with Perl 1st Edition Martien
Verbruggen Digital Instant Download
Author(s): Martien Verbruggen
ISBN(s): 9781930110021, 1930110022
Edition: 1st
File Details: PDF, 2.55 MB
Year: 2002
Language: english
Graphics Programming with Perl
Graphics
Programming
with Perl
MARTIEN VERBRUGGEN

MANNING
Greenwich
(74° w. long.)
For online information and ordering of this and other Manning books,
go to www.manning.com. The publisher offers discounts on this book
when ordered in quantity. For more information, please contact:
Special Sales Department
Manning Publications Co.
209 Bruce Park Avenue Fax: (203) 661-9018
Greenwich, CT 06830 email: [email protected]

©2002 by Manning Publications Co. All rights reserved.

No part of this publication may be reproduced, stored in a retrieval system, or transmitted,


in any form or by means electronic, mechanical, photocopying, or otherwise, without prior
written permission of the publisher.

Many of the designations used by manufacturers and sellers to distinguish their products are
claimed as trademarks. Where those designations appear in the book, and Manning
Publications was aware of a trademark claim, the designations have been printed in initial
caps or all caps.

Recognizing the importance of preserving what has been written, it is Manning’s policy to have the
books we publish printed on acid-free paper, and we exert our best efforts to that end.

Manning Publications Co. Copyeditor: Sharon Mullins


209 Bruce Park Avenue Typesetter: Syd Brown
Greenwich, CT 06830 Cover designer: Leslie Haimes

ISBN 1-930110-02-2

Printed in the United States of America


1 2 3 4 5 6 7 8 9 10 – VHG – 06 05 04 03 02
To Margaret, because she thought that “Advanced RenderMan”
should be the name of a Super Hero

To Maxine, for being excited about appearing in this book


contents
preface xiii
About this book xiii
Who should read this book? xiv
Coding practices xv
Source code downloads xvi
author online xvii
acknowledgments xix
about the cover illustration xxi

Part 1 Foundations 1
1 Overview of graphics 3
1.1 Perl and graphics 4
1.2 The bits and pieces in graphics programming 5
1.3 Color spaces and palettes 7
RGB 7 ✦ CMY and CMYK 8 ✦ HSV and HLS 9
YUV, YIQ and YCbCr 12 ✦ Grayscale 12
Color distance 13 ✦ Reducing the number of
colors in an image 13
1.4 Summary 14

2 Overview of graphics file formats 15


2.1 Some graphics formats 16
GIF 17 ✦ JPEG, JFIF 18 ✦ PNG 18
MNG 19 ✦ SVG 19 ✦ TIFF 19
2.2 Finding the size and type of an image 20
Image::Size 20 ✦ Image::Magick 21
Do it yourself 22 ✦ More on file size and information 24
2.3 Conversion of graphics formats 24
2.4 Summary 26

vii
3 Overview of tools and modules 27
3.1 CPAN 28
3.2 The tools 29
The Chart::* modules 29 ✦ Gnuplot 29
GD 29 ✦ GD::Graph, GIFgraph and Chart::PNGgraph 30
GD::Text 30 ✦ The Gimp 30 ✦ Image::Magick 30
Image::Size 31 ✦ Inline 31 ✦ OpenGL 32
PGPLOT 32 ✦ RenderMan 33 ✦ Term::Gnuplot 33
3.3 A note on module versions 34
3.4 Summary 34

Part 2 Creating graphics 35


4 Drawing 37
4.1 Drawing with GD 39
An example drawing 40 ✦ Filling objects 42
Drawing text with GD 43 ✦ GD’s built-in fonts 44
TrueType fonts and GD 45
4.2 Drawing with Image::Magick 46
An example drawing 46 ✦ Anti-alias and fuzz 47
Drawing by combining images 48 ✦ Drawing with paths 50
Drawing text with Image::Magick 51
4.3 Combining GD and Image::Magick 53
4.4 Drawing with Term::Gnuplot 55
4.5 PostScript and SVG 59
4.6 Summary 59
5 Creating charts 60
5.1 GD::Graph and friends 62
Preparing your data sets for GD::Graph 63
Controlling the look of your chart 65
GD::Graph and fonts 65 ✦ Saving your chart to a file 66
Bar and area charts 68 ✦ Lines, Points and
LinesPoints charts 70 ✦ Mixed charts 72
5.2 The Chart distribution 74
Pareto charts 75
5.3 PGPLOT 76
PGPLOT devices 76 ✦ Example: A simple X-Y plot 77
Example: A contour plot 81 ✦ Example: Plotting a galaxy 84
5.4 Interfacing with gnuplot 85
5.5 Summary 89

viii CONTENTS
6 Graphics and the Web 90
6.1 The Common Gateway Interface 91
HTTP and CGI 91
6.2 Suitable image formats 92
Web safe color palettes 92
6.3 CGI and dynamically generated graphics 94
6.4 Forms and encapsulated graphics 96
6.5 Image collections and thumbnailing 100
Thumbnails with Image::Magick 101
Thumbnails with GD 102 ✦ Contact sheets with
Image::Magick’s ✦ visual directory 103
Contact sheets with Image::Magick::Montage 104
An example application: A web photo album 105
Designing the data 107
6.6 Summary 121
7 Animations for the Web 122
7.1 Animation file formats 123
GIF 123 ✦ MNG 124
Macromedia Flash 124 ✦ SVG 125
7.2 GIF animations 125
7.3 Perl and animations 126
7.4 Repeatedly applying a filter 127
Example: making objects appear 127
Example: Zooming in on an object 129
7.5 Animated text 131
7.6 Animated charts 132
7.7 Animations with the Gimp 134
7.8 Summary 137

8 Resizing and combining images 138


8.1 Scaling and cropping an image 139
Image::Magick geometry specification 139
Cropping an image 140
8.2 Combining Images 140
Combining GD images 140
Combining Image::Magick images 142
Adding a watermark to an image 145
8.3 Summary 151

CONTEN TS ix
9 Three-dimensional graphics 153
9.1 OpenGL 154
OpenGL library functions in Perl 155
Capturing your OpenGL output 157
Example: a planetary system 160
OpenGL summary 164
9.2 RenderMan 164
How to use the module and the BMRT 165
The RenderMan language binding for Perl 166
Example: A rotating cube of cubes 167
9.3 Summary 172

Part 3 Special topics 173


10 Writing your own graphics modules 175
10.1 Interface design 176
Coordinate transformation 180
Choosing your drawing primitives 181
Implementing the interface 182
10.2 An OO implementation of a clock 186
10.3 Summary 188

11 Controlling text placement 190


11.1 Determining text size 191
Text sizes in GD 191
Text sizes in Image::Magick 192
11.2 Aligning text in graphics 194
Aligning text with GD 194
Aligning text with Image::Magick 196
11.3 Wrapping text 197
The GD::Text modules 207
11.4 Summary 209

12 Manipulating pixels and transparency 210


12.1 GD and pixels 211
Example: rotating RGB values 211
Removing duplicate color palette entries 212
12.2 Image::Magick and pixels 213
Rotating RGB values 214

x CONTENTS
12.3 Convolution 215
Convolution with Image::Magick 217
Using Image::Magick's Convolve() method 224
Convolution with PDL 226
12.4 Alpha channels and transparency 229
Transparency and the GD module 229
Transparency and Image::Magick 230
How to view partially transparent images 233
12.5 Fast manipulation of image pixels 233
Using Inline::C 234
12.6 Summary 238

Part 4 Appendices 239


A Image::Magick introduction & reference 241
B Color space conversion algorithms 284
C Module code 288
references 293
index 295

CONTEN TS xi
preface
Welcome to Graphics Programming with Perl. When Manning Publications contacted
me to assess my interest in writing a book about graphics programming for the Perl
language, I was a bit skeptical at first. I didn’t think there would be enough coherent
material to write such a book, and I wasn’t entirely certain there would be much room
for one.
However, after doing some research I noticed that, in fact, there was a gap in the
published material. The only book I could find that combined graphics programming
and Perl was too general, and was largely a collection of recipes on how to use tools,
many of which had no relation to Perl [1]. There were not enough references that
described and explained how to achieve concrete graphics tasks in Perl.
So I accepted the challenge and started working, with the goal of providing a book
that would sum up the ways to work with graphics from within Perl, and to offer suf-
ficient background information to improve the understanding of graphics program-
ming and graphics in general. This work seeks to provide a programmer with enough
fundamental knowledge and pointers to achieve the most common graphics program-
ming tasks. I hope those goals have been realized.

ABOUT THIS BOOK


The objective of the book is to show how graphical programming projects may be
accomplished.
When commencing work on a program, you have probably formulated an idea of
your goal, but you might not necessarily know how to reach it. In most cases all that
is needed is a pointer to the right modules, tools, commands or techniques. This book
aims at providing this sort of reference for graphics manipulation using the Perl pro-
gramming language.
The content includes a wide range of topics related to manipulation and produc-
tion of graphics with Perl, including the creation, editing and combining of images,
the development of libraries, interfaces and modules for graphics creation, massaging
of text for graphics, the building of charts, as well as working with single pixels in
images. This book is not meant as a reference work for the modules available for

xiii
graphics programming.1 For that you are encouraged to read the documentation that
comes with the modules, which in most cases is satisfactory. This book is also not
intended to be an exhaustive introduction to graphics in general, or a detailed expla-
nation of graphics algorithms, although where appropriate, some graphics theory and
algorithm description will be touched on.
The reader is expected to have a basic knowledge of Perl. The programs and code
fragments will be explained in terms of what they do and how they operate, and only
occasionally in terms of what the Perl statements mean. The documentation that
comes with Perl and the Camel [2] does a much better job of accurately describing
Perl, and other books [3],[4] provide a useful introduction to programming with Perl.
Where necessary, general programming techniques and their implementation in Perl
will be explained when this is pertinent to graphics programming (as in chapter 10,
“Writing your own graphics modules”).
There are many tasks you can accomplish with graphics, and there is a plethora of
questions you might ask when confronted with a graphics programming job. When
thinking about how this book should be arranged, several highly structured possibil-
ities for organizing the content sprang to mind. However, trying to fit various bits and
pieces into this organization turned out to be not that simple. Many tasks in graphics
programming defy neat categorization.
For that reason you might find that, even though the book is divided into chapters,
some of the sections in those chapters might also apply to other chapters. The book is
structured such that it may be read from beginning to end, but it is also arranged to facil-
itate access to specific information relevant to the actual tasks in which you are engaged.

WHO SHOULD READ THIS BOOK?


If you’re a programmer who has done some work with Perl, but has almost never
worked with graphics, this is the book for you. If you have worked with graphics, but
want to have a look around to see what else is available in this area, this is the place to
look. If you’re just curious about what is available in graphics manipulation for Perl,
you should be able to find it here.
If you’re a programmer who has been only marginally exposed to Perl, and you
need to dive into graphics programming and Perl at the same time, this book could
be a fit for you, but I’d advise first learning the Perl language (see reference list [3],[4]).
If you plan to learn Perl from this book, you will be disappointed.
This book concentrates mainly on how to accomplish tasks with the tools avail-
able, and within the boundaries of the Perl programming language. Since those
boundaries are fairly flexible, this includes the use of a large number of modules, some
of which work with external programs, some implement algorithms, others involve

1
There is one exception to this: the Image::Magick module is used extensively in the book, but lacks well
developed documentation of its own, so a reference is included in appendix A.

xiv PREFACE
web work, and many other bits and pieces. If you want to know how to use the graph-
ics modules available for Perl to write your programs, read this book. If you want to
know for which graphics programming tasks Perl is suited, and for which ones it is
less so, read this book. If you want some minimal introduction to graphics theory—
just enough to get you to work—read this book. If you are looking for a reference
for Image::Magick you will find this book useful. If you need to know how to gen-
erally combine graphics and HTML in your CGI applications, read this book. If you
find yourself repeatedly doing the same graphics tasks in an interactive program, read
this book.
On the other hand, if you are seeking a book that teaches you to build graphical
user interfaces, this isn’t it: there is no PerlTk discussion in this book. The programs
presented all use a command-line interface, if they accept input at all.
If you want to learn about graphics theory and computer graphics algorithms, you
will find some rudimentary introductions in this book, but a more elaborate discussion
of these issues is available elsewhere.

CODING PRACTICES
The code in this book has been written to be as portable as possible between the dif-
ferent operating systems on which Perl runs. You might find a slight bias toward
Unix2 operating systems, since that is what I work on most of the time. Pathnames
are always separated by a slash (/), which works on Unix and Microsoft-based operat-
ing systems, but not, for example, on older operating systems for the Macintosh. If
you are on a system that doesn’t support the slash as a directory separator, you might
need to do some work before the example code will run for you. Really portable code
of course uses File::Spec, but, for the sake of clarity I decided not to do that.
When writing code to create graphical output, which is often binary data, it is
imperative to remember the use of binmode() on the file handles that are used to
read and write image files. Failing to do this commonly leads to the creation of bugs
that are difficult to track on platforms in which there is a distinction between text and
binary files. On platforms where there is no such distinction, using binmode() has
no effect; however, that is no excuse to leave it out. Portable code always calls bin-
mode() on a file handle that is to be used for binary data. Apart from portability
issues, using binmode(), even when you know it has no effect, is a good way to doc-
ument that the data stream is of a binary nature.
Coding standards are always up for debate, and mine are not always consistent with
the guidelines from the perlstyle documentation, although they come very close.
I’ll highlight some points that regularly crop up as a subject of disagreement, and some
that I find important.

2
... and BSD and Linux and others. When I refer to Unix, I mean all Unix-like operating systems, not
just the ones licensed by X/Open.

CODING PRACTICES xv
Random documents with unrelated
content Scribd suggests to you:
you want to fire, or you deaden the boat’s way. Take care also to let
the sheet be under the barrel of the gun, in order that your line of
aim may be clear of every thing. In this pursuit, when the more wind
sometimes the more sport, never go with less than three good
hands; and be careful in squally weather not to make too fast the
mainsheet, as nine-tenths of the misfortunes that we hear of, have
occurred from this very circumstance.—Hawker.

Seagreen, a. Resembling the colour of the distant


sea, cerulean.

Seagull, s. A sea bird. Vide Gull.

Seahog, s. The porpoise.

Seal, s. A stamp engraved with a particular


impression, which is fixed upon wax; the
seacalf, or phoca.
Seals are very numerous on the coast, and at this season a number
may be seen any warm day you make an excursion up the Sound of
Achil. We shoot them occasionally; the skin makes a waterproof
covering, and the fat affords an excellent oil for many domestic
purposes. It is difficult, however, to secure the animal, for numbers
are shot and few gotten. The head is the only place to strike them,
for even when mortally wounded in the body, they generally manage
to escape. This fact we have ascertained, from finding them dead on
shore many days after they were wounded, and at a considerable
distance from the place where they had received the bullet. I shot
one last autumn at the mouth of the river, and a fortnight afterwards
he was taken up in the neighbourhood of Dhuhill. There could be no
doubt as to the identity of the creature, for on opening him to
extract the oil, a rifle-ball, such as I use, of the unusually small size
of fifty-four to the pound, was found lodged in his lungs. Unless
when killed outright, they sink instantly; and I have seen the sea
dyed with blood to an extent that proved how severely the seal had
been wounded, but never could trace him farther.
Formerly, when seal-oil and skins were of value, some persons on
the coast made the pursuit of the animal a profession. There is one
of these persons living near the Sound, a miserable, dwarfish, red-
bearded wretch, whom you would consider hardly equal to grapple
with a salmon, and yet he secures more seals than any hunter in the
district. His method of effecting it is singular; he uses neither gun
nor spear, but kills the animal with a short bludgeon, loaded at the
end with lead.
Adjacent to the seal-killer’s residence there is a large rock,
uncovered at half-tide, and this appears the most favourite haunt for
the animal to bask upon. The rock is easily approached from the
main land, and on a sunny day, when the wind favours the attempt,
the hunter, undressed, and armed with his bludgeon, silently winds
among the stones, and steals upon his sleeping prey. Wary as the
creature is, the Red Dwarf seldom fails in surprising him, and with
astonishing expertness generally despatches him with a single blow.
—Wild Sports.

Seamew, s. A fowl that frequents the sea; one of


the gull tribe.

Sear, v. To burn, to cauterise.


Secondary, s. In ornithology, the second feather in
the wing.

Sedge, s. A growth of narrow flags, a narrow flag.

Sedgy, a. Overgrown with narrow flags.

Seer, s. A gunlock spring.

Seine, s. A net used in sea-fishing.

Serpentine, a. Resembling a serpent; winding like a


serpent.

Serrated, a. Formed with jags or indentures, like


the edge of a saw.

Seton, s. A seton is made when the skin is taken


up with a needle, and the wound kept open by
a twist of silk or hair, that humours may vent
themselves. Farriers call this operation in
cattle, rowelling.
Setons consist of tape, threads, or lamp cotton passed under the
skin, and smeared with digestive ointment. The instrument
employed for conveying these under the skin is named a seton
needle, and may be purchased at the instrument makers. When
lamp cotton is used, it can be withdrawn gradually, thread by thread,
which on some occasions is desirable. Setons are preferable to
rowels, being more convenient and equally efficacious.—White.

Setter, s. One who sets; a dog who beats the


field, and points the bird for the sportsmen.

The Old English Setter. (Canis Index, variety α.)—This breed was
originally produced between the Spanish pointer and the large water
spaniel, and was famous on account of his steadiness and exquisite
sense of smelling; the hair over the whole body was much more
curled than that of the present breed, which has been considerably
lightened by the additional cross of the springer; he was also much
more steady than the improved variety, but then he had not the
same speed to recommend him. Fine dogs of this kind were also
produced by a cross with the stag and blood hounds. They united
great strength, considerable swiftness, and were used for the chace
in some few instances.
The English Setter (Canis Index, variety β), is a breed produced
between the Spanish pointer, the English water spaniel and springer,
which, by careful cultivation, has attained a high degree of
perfection as a sporting dog. He has an elegant figure, and a very
pleasing diversity of colour; added to this, his skin is covered with
beautifully curled hair, very villous on the lower margin of the tail;
being altogether an extremely handsome dog, and quite unrivalled
by any of the canine species.
The setter has all the excellent qualities of the pointer, with a greater
degree of speed and natural vivacity of temper; he, however, is not
so easily broken in as the pointer, and requires a certain degree of
training every year, to make him continue staunch. There are,
however, various instances of setters being self-taught, as the
following example will show:—The black and tan small setter bitch
which I have (says Mr. Torry), was originally out of the Duke of
Bedford’s breed, and both she and her mother inherit the utmost
natural sagacity as sporting dogs. At ten months old, and before she
had got a lesson in breaking, or had seen game killed, she was
taken to the moors for the first time, and on finding a bird, was
perfectly steady at her point, backed, and did not run the game. The
gentleman who was with me wounded a bird, and it fell at a
considerable distance. The pup, unknown to us, had kept her eye
upon it, and, to our astonishment, after we had loaded, and again
ordered our dogs to range, she went direct to the spot where the
bird fell, found and fetched it to my friend’s feet. This happened in
August, 1825.
The setter ranges with great speed, and is a very hardy dog. Many
prefer him to the pointer, and if water is plentiful, he is certainly
more useful, for his feet are much better defended against the sharp
cutting of the heath than those of the pointer, as he has a great deal
of hair growing between the toes and round the ball of the foot, of
which the latter is almost destitute. Besides, he unquestionably
ranges much faster, and can endure much more fatigue. He can also
serve in thick coverts, where a pointer will not enter; and, on this
account, is useful in woodcock shooting, where springers or cockers
are not kept.
Formerly the setter was used for the purpose of taking partridges
with a draw-net, and was generally taught to squat down when the
game was within a proper distance—hence the name setter. They
are now, however, trained to point in the same manner as the
spaniel. It is said that Robert Dudley, Duke of Northumberland, was
the first person who broke a setter to the net.

There is not a country in Europe that can boast of finer setters than
Ireland; they are there called English spaniels, and differ widely from
the setters of England and Scotland. They are not esteemed in
Ireland unless their colour be either a deep chestnut and white, or
all red; a black and white setter, or any colour but red, or red and
white, would not be looked upon or reputed well bred, allowing
them to be ever so good. It matters not whether they are all red, or
red and white; but those esteemed most have a black nose, and a
black roof to their mouth,—as most sportsmen conceive the black
nose to be finer and superior to any other. Sir William Barker, Mr.
Oliver of Castle Oliver, Mr. Macarthy of Spring House, and many
other gentlemen in Ireland, have the most beautiful and steady of
this kind. A circumstance occurred, with respect to the steadiness
and discipline of some of this breed, which the compiler was an eye-
witness to:—Colonel Macdonald being on a visit at Mr. Oliver’s,
during the grousing season, and going out one day, took out with
him five brace of setters; on getting to the mountains, one of the
dogs found some birds, all the rest backed in at once, upon which
Colonel Macdonald called to the last dog to take the lead, and in that
manner he drew the dogs alternately, until the last became first, and
fixed the birds, which had run nearly a mile. These dogs in general
fetch a long price; Mr. Macarthy got two hundred guineas for a brace
of them, and a gentleman in the north of Ireland was known once to
have given, for a dog and bitch of this sort, to his tenant, the
renewal of a lease of a farm for nine hundred and ninety-nine years,
which if this lease had expired, would have cleared to the landlord
above two hundred and fifty pounds a year. The compiler himself
sold a brace of setters, in the year 1801, for two hundred guineas,
to a Captain Baggot.—Brown—Thornhill.

Settingdog, s. A dog taught to find game, and


point it out to the sportsmen.

Shad, s. A kind of fish.

Shaft, s. An arrow, a missile weapon; a narrow,


deep, perpendicular pit; anything straight.

Shag, Skart, Scarfe or Green Cormorant, (Pelicanus


graculus, Linn.; Le petit Cormorant, ou le
Nigaud, Buff.) s.
The form, the aspect altogether, the outward conformation of all the
parts, the character, manners, and habits, and places of abode, of
this species, are nearly like those of the cormorant; but they do not
associate, and these make their nests on the rugged, shelvy sides
and crevices of the rocky precipices or projecting cliffs which
overhang the sea, while the others make theirs on the summits
above them; and these are at once distinguished from the others by
the greenness of the upper, and brownness of the under plumage,
and also in being of a much less size—the largest shags weighing
only about four pounds, and measuring nearly two feet six inches in
length, and three feet eight in breadth. The bill is of a more slender
make, but nearly as long as that of the cormorant; the head, in the
male, is crested in the same manner; the middle claw is serrated;
and its tail, consisting of twelve stiff feathers stained with green, is
also of the same form and hoary or dirty appearance as that of the
cormorant; the crown of the head, hinder part of the neck, lower
back, and rump, are of a plain black, or very dark green, shining like
satin; the upper back, or shoulders, together with the scapulars and
wings, are nearly of the same colour, but with a tinge of bronze
brown, and each feather is distinctly edged with purple glossed
black; the under parts are clouded with dusky dirty white, and
brown.—Bewick.

Shaggy, a. Ruggedly hairy, rough, rugged.

Shagreen, s. The skin of a kind of fish, or skin


made rough in imitation of it.

Shambling, a. Moving awkwardly and irregularly.

Shank, s. The middle joint of the leg, that part


which reaches from the ankle to the knee; the
bone of the leg; the long part of any
instrument; long part of a fishhook.
Sheep, s. The animal that bears wool.

Sheep, s. The animal that bears wool.


To break a Sheep-biting Dog.—Take some wool off a sheep’s rump,
steep it in train oil, put it in the dog’s jaws, and sew up his mouth.
For killing poultry, boil a chicken in its feathers, take it hot from the
boiler, squeeze the water from it and put it into his jaws, and tie
them together.

“I have a fine pointer,” said a gentleman to his friend, “staunch as


can be at birds, but I cannot break him from sheep.” His reply was,
that the best way would be to couple him to the horns of an old
ram, and leave him in a stable all night, and the discipline he would
receive would prevent his loving field-mutton again. The same
person meeting the owner of the dog some time afterwards,
accosted him thus: “Well, sir, your pointer is now the best in
England, no doubt, from my prescription.” “Much the same, sir, for
he killed my ram, and ate a shoulder!”—Sporting Anecdotes.

Sheldrake, or Burrough Duck, (Anas Tudorna, Linn.;


La Tudorne, Buff.) s.
The male of this prettily marked species is somewhat larger than the
mallard, measuring about two feet in length, three and a half in
breadth, and weighing, commonly, two pounds ten ounces. The bill
is red, with the nail and nostrils black; the upper mandible is broad,
flat, and grooved on the edges towards the point, where it has
rather a cast upwards; it is also depressed in the middle, and raised
into a knob or tubercle at the base. The head and upper part of the
neck are of a glossy dark or bottle green; the lower part of the neck,
to the breast, is encircled with white, and joined by a broad band of
bright orange bay, which is spread over, and covers the breast and
shoulders. The back, wing-coverts, rump, upper tail-coverts, and
sides of the belly, to the vent and tail, are white; a dusky stripe,
tinged with rufous, runs along the middle from the breast, the whole
length of the belly; part of the scapulars next the wings are black,
and those next the body white; the bastard wing, and some of the
first primary quills, are black; the exterior webs of the next adjoining
ones are glossed with gold green, which forms the speculum or
beauty-spot of the wings; this spot is bounded and partly covered by
the orange webs of the three succeeding quill-feathers, which
separate it from the scapulars. The tail is white, but some of its
feathers are tipped with black; the legs pale red.
The female is less than the male, and her plumage is not so vivid
and beautiful. She makes her nest, and rears her young,
underground, in the rabbit-holes which are made in the sand-hills
near the sea shore: it is chiefly formed of the fine down plucked
from her own breast: she lays from twelve to sixteen roundish white
eggs, and the incubation lasts about thirty days. During this time,
the male, who is very attentive to his charge, keeps watch in the
day-time, on some adjoining hillock, where he can see all around
him, and which he quits only when impelled by hunger, to procure
subsistence. The female also leaves the nest, for the same purpose,
in the mornings and evenings, at which times the male takes his
turn, and supplies her place. As soon as the young are hatched, or
are able to waddle along, they are conducted, and sometimes
carried in the bill, by the parents, to the full tide, upon which they
launch without fear, and are not seen afterwards out of tide-mark
until they are well able to fly; lulled by the roaring of the flood, they
find themselves at home amidst an ample store of their natural food,
which consists of sand-hoppers, sea-worms, &c. or small shell-fish,
and the innumerable shoals of the little fry which have not yet
ventured out into the great deep, but are left on the beach, or
tossed to the surface of the water by the restless surge.
If this family in their progress from the nest to the sea, happen to be
interrupted by any person, the young ones, it is said, seek the first
shelter, and squat close down, and the parent birds fly off; then
commences that truly curious scene dictated by an instinct
analogous to reason, the same as has been already noticed in the
mallard and the partridge; the tender mother drops at no great
distance from her helpless brood, trails herself along the ground,
flaps it with her wings, and appears to struggle as if she were
wounded, in order to attract attention, and tempt a pursuit after her.
Should these wily schemes, in which she is also aided by her mate,
succeed, they both return when the danger is over, to their terrified
motionless little offspring, to renew the tender offices of cherishing
and protecting them.
These birds are sometimes watched to their holes, which are dug up
to the nest, whence the eggs are taken and hatched, and the young
reared by a tame duck.
In this way many gentlemen, tempted by the richness of their garb,
have their ponds stocked with these beautiful birds; but as they are
of a roving disposition, and are apt to stray, or to quit altogether
such limited spots, it is generally found necessary to pinion or
disable a wing to secure them. The sheldrake has been known to
breed with the common duck; but it is not well ascertained whether
the hybrids thus produced will breed again or not.

This species is dispersed in greater or less numbers, over the warm


as well as the cold climates, in various parts of the world; they are
met with as far north as Iceland in the spring, and in Sweden and
the Orkney Islands in the winter. Captain Cook notices them, among
other sea fowl, on the coast of Van Diemen’s Land; and they have
been seen in great numbers at the Falkland Islands. Although they
are not numerous on the British and the opposite shores, yet they
are common enough in the British Isles, where they remain
throughout the year, always in pairs, and occasionally straggle away
from the sea coasts to the lakes inland.—Bewick.

Shell, s. The hard covering of anything; the


external crust; the covering of a testaceous or
crustaceous animal; the covering of the seeds
of siliquous plants; the covering of kernels; the
covering of an egg.
Shellfish, s. Fish invested with a hard covering,
either testaceous, as oysters, or crustaceous,
as lobsters.

Sherry, s. A kind of sweet Spanish wine.

Shetland Pony, s. A horse peculiar to the Shetland


isles.
Although the Shetland ponies are exceedingly diminutive in size,
they are in other respects excellent. There have been instances of
these animals whose height from the foot to the shoulder scarcely
exceeded three feet, and a man of ordinary size and strength can lift
one of them from the ground with great ease.
The general form of these ponies is very elegant, and their body is
thicker and more compact than that of a blood-horse; they have
small legs and large manes, their bones are exceedingly small, as is
also their head, and that part of the neck which joins to it, the most
common colours are grey, bay, and black. The latter are esteemed
the hardiest, whilst those that are pied seldom prove good. They
sometimes live to the age of thirty years and upwards,
notwithstanding the little care that is bestowed on them in sheltering
them from the cold, which, in the climate of the Shetland Islands, is
peculiarly severe in the winter: but from the circumstance of their
being compelled to live out of doors during even the severest
months of the year, great numbers are occasionally frozen to death.
At this season, when the ground is entirely covered with snow, the
wretched animals are compelled to seek subsistence on the sea-
weeds, which, once in every twelve hours, are left exposed by the
tide.—Illustrations of Natural History by Le Keux.
Shin, s. The forepart of the leg.

Shingles, s. A kind of tetter or herpes that spreads


itself round the loins.

Ship, s. A ship may be defined a large hollow


building made to pass over the sea with sails; a
vessel with three masts. Vide Yacht.

Shittlecock, s. A cork stuck with feathers, and


driven by players from one to another with
battledoors.

Shoal, s. A crowd, a multitude, a throng; a


shallow, a sand bank; a number of fishes.

Shoaly, a. Full of shoals, full of shallow places.

Shock Dog (Canis Fotor), s. A lady’s dog.


This variety is probably a breed betwixt the king Charles’s dog and
the small water spaniel, to which last it seems most nearly allied. It
has long and slightly curled hair, and its eyes are almost hid in the
curls. It is of a small size, and is used in this country and on the
continent as a lap-dog. It is a useless little animal, seeming to
possess no other quality than a faithful attachment to its mistress.
I have never seen one of these diminutive little creatures which
would take the water, although they possess all the requisites for
swimming. This may probably be accounted for from the frequency
of their immersion in that element, contrary to their inclination, for
the purpose of washing them.
Shoe, s. The cover of the foot; the iron plate
which defends a horse’s hoof.

Shoe, v. To fit the foot with a shoe; to cover at the


bottom.

Shoeing, v. To affix the shoe to the hoof.


The Preparation of the Foot.—We will suppose that the horse is sent
to the forge to be shod. If the master would occasionally accompany
him there, he would find it much to his advantage. The old shoe
must be first taken off. We have something to observe even on this.
It was retained on the foot by the ends of the nails being twisted off,
turned down, and clenched. These clenches should be first raised,
which the smith seldom takes the trouble thoroughly to do; but after
going carelessly round the crust, and raising one or two of the
clenches, he takes hold first of one heel of the shoe, and then of the
other, and by a violent wrench separates them from the foot, and by
a third wrench, applied to the middle of the shoe, he tears it off. By
this means he must enlarge every nail hole, and weaken the future
hold, and sometimes tear off portions of the crust, and otherwise
injure the foot. The horse generally shows by his flinching that he
suffers by the violence with which this preliminary operation is
performed. The clenches should always be raised or filed off; and
where the foot is tender, or the horse is to be examined for
lameness, each nail should be partly punched out. Many a stub is
left in the crust, the source of future annoyance, when this
unnecessary violence is used.
The shoe having been removed, the smith proceeds to rasp the
edges of the crust. Let not the stander-by object to the apparent
violence which he uses, or fear that the foot will suffer. It is the only
means he has, with safety to his instruments, to detect whether any
stubs remain in the nail-holes, and it is the most convenient method
of removing that portion of the crust into which dirt and gravel have
insinuated themselves.
Next comes the important process of paring out, with regard to
which it is almost impossible to lay down any specific rules. This,
however, we can say with confidence, that more injury has been
done by the neglect of paring, than by carrying it to too great an
extent. The act of paring is a work of much more labour than the
proprietor of the horse often imagines; the smith, except he be
overlooked, will give himself as little trouble about it as he can; and
that, which in the unshod foot would be worn away by contact with
the ground, is suffered to accumulate month after month, until the
elasticity of the sole is destroyed, and it can no longer descend, and
the functions of the foot are impeded, and foundation is laid for
corn, and contraction, and navicular disease, and inflammation. That
portion of horn should be left on the sole, which will defend the
internal parts from being bruised, and yet suffer the external sole to
descend. How is this to be measured? The strong pressure of the
thumb of the smith will be the best guide. The buttress, that most
destructive of all instruments, being banished from the respectable
forge, the smith sets to work with his drawing knife, and he removes
the growth of horn until the sole will yield, although in the slightest
possible degree, to the very strong pressure of his thumb. The
proper thickness of horn will then remain.
If the foot has been previously neglected, and the horn is become
very hard, the owner must not object if the smith resorts to some
means to soften it a little; and if he takes one of his flat irons, and,
having heated it, draws it over the sole, and keeps it a little while in
contact with it. When the sole is thick, this rude and apparently
barbarous method can do no harm, but it should never be permitted
with the sole that is regularly pared out.
The quantity of horn to be removed in order to leave the proper
degree of thickness will vary with different feet. From the strong foot
a great deal must be taken. From the concave foot the horn may be
removed until the sole will yield to a moderate pressure. From the
flat foot little need be pared; while the pumiced foot will spare
nothing but the ragged parts.
The paring being nearly completed, the knife and the rasp of the
smith must be a little watched, or he will reduce the crust to a level
with the sole, and thus endanger the bruising of the sole by its
pressure on the edge of the seating. The crust should be reduced to
a perfect level all round, but left a little higher than the sole.
The heels will require very considerable attention. From the stress
which is thrown on the inner heel, and from the weakness of the
quarter there, it usually wears considerably faster than the outer
one; and if an equal portion of horn were pared from it, it would be
left lower than the outer heel. The smith should, therefore,
accommodate his paring to the comparative wear of the heels, and
be very careful to leave them precisely level.
If the reader will recollect what we have said of the intention and
action of the bars, he will readily perceive that the smith should be
checked in his almost universal fondness for opening the heels, or,
more truly, removing that which is the main impediment to
contraction. That portion of the heels between the inflection of the
bar and the frog should scarcely be touched, at least nothing but the
ragged and detached parts should be cut away. The foot may not
look so pretty, but it will last longer without contraction.
The bar likewise should be left fully prominent, not only at its first
inflection, but as it runs down the side of the frog. The heel of our
shoe is designed to rest partly on the heel of the foot, and partly on
the bar, for reasons that have been already stated. If the bar is
weak, the growth of it should be encouraged, and it should be
scarcely touched at the shoeing until it has attained a level with the
crust. We recal to the recollection of our readers the observation
which we have before made, that the destruction of the bars not
only leads to contraction by removing a powerful impediment to it,
but by adding a still more powerful cause in the slanting direction
which is given to the bearing at the heels, when the bar does not
contribute to the support of the weight.
It will also be apparent that the horn between the crust and the bar
should be carefully pared out. Every horseman has observed the
relief which is given to the animal lame with corns when this angle is
well thinned; a relief, however, which is but temporary, for when the
horn grows again and the shoe presses upon it, the torture of the
animal is renewed.
The degree of paring to which the frog must be subjected will
depend on its prominence, and on the shape of the foot. The
principle has already been stated, that it must be left so far
projecting and prominent, that it shall be just within and above the
lower surface of the shoe, it will then descend with the sole
sufficiently to discharge the functions which we have attributed to it.
If it be lower it will be bruised and injured; if it be higher it cannot
come in contact with the ground, and thus be enabled to do its duty.
The ragged parts must be removed, and especially those occasioned
by thrush, but the degree of paring must depend entirely on this
principle.
It appears, then, that the office of the smith requires some skill and
judgment in order to be properly discharged; and the horse
proprietor will find it his interest occasionally to visit the forge and
complain of the careless, or idle, or obstinate, and reward, by some
trifling gratuity, the expert and diligent. He should likewise
remember that a great deal more depends on the paring out of the
foot than on the construction of the shoe; that few shoes, except
they press upon the sole, or are made outrageously bad, will lame
the horse; but that he may be very easily lamed from ignorant and
improper paring out of the foot.
The putting on of the Shoe.—The foot being thus prepared, the
smith looks about for a shoe. He should select one that as nearly as
possible fits the foot, or may be altered to the foot. He will
sometimes care little about this, for he can easily alter the foot to
the shoe. The toe-knife is a very convenient instrument for him, and
plenty of horn can be struck off with it, or removed by the rasp, to
make the foot as small as the shoe; while he cares little, although by
this destructive method the crust is materially thinned where it
should receive the nail, and the danger of puncture is increased, and
the danger of pressure upon the sole is increased, and a foot so
artificially diminished in size will soon grow over the shoe, to the
hazard of considerable or permanent lameness.
While choosing the shoe we must once more refer to the shape of
our pattern shoe; the web is of equal thickness from toe to heel. A
shoe, thinner at the heel than at the toe, by letting down the heel
too low, is apt to produce sprain of the flexor tendon, and a shoe
thicker at the heels than at the toe is fit only to elevate the frog, to
the destruction of its function, and to its own certain disease, and
also to press upon and to batter and to bruise that part of the foot
which is soonest and most destructively injured.
The Hinder Shoe.—In forming the hinder shoe it should be
remembered that the hind limbs are the principal instruments in
progression, that in every act of progression, except the walk, the
toe is the point on which the whole frame of the animal turns, and
from which it is propelled. This part, then, should be strengthened
as much as possible; and, therefore, the hinder shoes are made
broader at the toe than the fore ones, and the toe of the foot, which
is naturally broader than that of the fore-foot, is still further widened
by rasping. Another good effect is produced by this, that the hinder
foot being shortened there is less danger of overreaching or forging,
and especially if the shoe be wider on the foot surface than on the
ground one; and thus the shoe is made to slope inward, and is a
little within the toe of the crust.
The shape of the hinder foot is somewhat different from that of the
fore foot; it is straighter in the quarters, and the shoe must have the
same shape. For carriage and draught horses generally, calkins may
be put on the heels, because the animal will be thus enabled to dig
his toe more firmly into the ground, and urge himself forward, and
throw his weight into the collar with greater advantage. But the
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookultra.com

You might also like