Normal quotes

This commit is contained in:
James Gregory 2013-12-30 18:34:31 +11:00
commit 18011c595a
352 changed files with 6040 additions and 6040 deletions

View file

@ -6,27 +6,27 @@ Chapter 55\
Color Modeling in 256-Color Mode {#Heading1}
---------------------------------
### Pondering X-Sharp’s Color Model in an RGB State of Mind {#Heading2}
### Pondering X-Sharp's Color Model in an RGB State of Mind {#Heading2}
Once she turned six, my daughter wanted some fairly sophisticated books
read to her*. Wind in the Willows.* *Little House on the Prairie.*
Pretty heady stuff for one so young, and sometimes I wondered how much
of it she really understood. As an experiment, during one reading I
stopped whenever I came to a word I thought she might not know, and
asked her what it meant. One such word was “mulling.”
asked her what it meant. One such word was "mulling."
“Do you know what ‘mulling’ means?” I asked.
"Do you know what ‘mulling' means?" I asked.
She thought about it for a while, then said, “Pondering.”
She thought about it for a while, then said, "Pondering."
“Very good!” I said, more than a little surprised.
"Very good!" I said, more than a little surprised.
She smiled and said, “But, Dad, how do you know that I know what
‘pondering’ means?”
She smiled and said, "But, Dad, how do you know that I know what
‘pondering' means?"
“Okay,” I said, “What does ‘pondering’ mean?”
"Okay," I said, "What does ‘pondering' mean?"
“Mulling,” she said.
"Mulling," she said.
What does this anecdote tell us about the universe in which we live?
Well, it certainly indicates that this universe is inhabited by at least
@ -34,12 +34,12 @@ one comedian and one good straight man. Beyond that, though, it can be
construed as a parable about the difficulty of defining things properly;
for example, consider the complications inherent in the definition of
color on a 256-color display adapter such as the VGA. Coincidentally,
VGA color modeling just happens to be this chapter’s topic, and the
VGA color modeling just happens to be this chapter's topic, and the
place to start is with color modeling in general.
#### A Color Model {#Heading3}
We’ve been developing X-Sharp for several chapters now. In the previous
We've been developing X-Sharp for several chapters now. In the previous
chapter, we added illumination sources and shading; that addition makes
it necessary for us to have a general-purpose color model, so that we
can display the gradations of color intensity necessary to render
@ -50,14 +50,14 @@ shallower angle, we need to be able to display progressively dimmer
shades of green.
The first thing to do is to select a color model in which to perform our
shading calculations. I’ll use the dot product-based stuff I discussed
in the previous chapter. The approach we’ll take is to select an ideal
shading calculations. I'll use the dot product-based stuff I discussed
in the previous chapter. The approach we'll take is to select an ideal
representation of the full color space and do our calculations there, as
if we really could display every possible color; only as a final step
will we map each desired color into the limited 256-color set of the
VGA, or the color range of whatever adapter we happen to be working
with. There are a number of color models that we might choose to work
with, but I’m going to go with the one that’s both most familiar and, in
with, but I'm going to go with the one that's both most familiar and, in
my opinion, simplest: RGB (red, green, blue).
In the RGB model, a given color is modeled as the mix of specific
@ -73,7 +73,7 @@ inside or on the cube.
RGB is good for modeling colors generated by light sources, because red,
green, and blue are the additive primaries; that is, all other colors
can be generated by mixing red, green, and blue light sources. They’re
can be generated by mixing red, green, and blue light sources. They're
also the primaries for color computer displays, and the RGB model maps
beautifully onto the display capabilities of 15- and 24-bpp display
adapters, which tend to represent pixels as RGB combinations in display
@ -98,32 +98,32 @@ value 0, and full intensity is represented by the value 255. This gives
us 256 levels of each primary color component, and a total of 16,772,216
possible colors.
Holy cow! Isn’t 16,000,000-plus colors a bit of overkill?
Holy cow! Isn't 16,000,000-plus colors a bit of overkill?
Actually, no, it isn’t. At the eighth Annual Computer Graphics Show in
Actually, no, it isn't. At the eighth Annual Computer Graphics Show in
New York, Sheldon Linker, of Linker Systems, related an interesting tale
about color perception research at the Jet Propulsion Lab back in the
’70s. The JPL color research folks had the capability to print more than
'70s. The JPL color research folks had the capability to print more than
50,000,000 distinct and very precise colors on paper. As a test, they
tried printing out words in various colors, with each word printed on a
background that differed by only one color index from the word’s color.
background that differed by only one color index from the word's color.
No one expected the human eye to be able to differentiate between two
colors, out of 50,000,000-plus, that were so similar. It turned out,
though, that everyone could read the words with no trouble at all; the
human eye is surprisingly sensitive to color gradations, and also
happens to be wonderful at detecting edges.
When the JPL team went to test the eye’s sensitivity to color on the
When the JPL team went to test the eye's sensitivity to color on the
screen, they found that only about 16,000,000 colors could be
distinguished, because the color-sensing mechanism of the human eye is
more compatible with reflective sources such as paper and ink than with
emissive sources such as CRTs. Still, the human eye can distinguish
about 16,000,000 colors on the screen. That’s not so hard to believe, if
about 16,000,000 colors on the screen. That's not so hard to believe, if
you think about it; the eye senses each primary color separately, so
we’re really only talking about detecting 256 levels of intensity per
primary here. It’s the brain that does the amazing part; the
we're really only talking about detecting 256 levels of intensity per
primary here. It's the brain that does the amazing part; the
16,000,000-plus color capability actually comes not from extraordinary
sensitivity in the eye, but rather from the brain’s ability to
sensitivity in the eye, but rather from the brain's ability to
distinguish between all the mixes of 256 levels of each of three
primaries.