Change bold code snippets to inline code blocks
This commit is contained in:
parent
f658bfbb40
commit
3c76d884ef
185 changed files with 1772 additions and 1772 deletions
22
56-02.md
22
56-02.md
|
|
@ -12,13 +12,13 @@ pages: 1050-1053
|
|||
|
||||
Ah, but what is an "equivalent amount"? Think of it this way. If a
|
||||
destination edge is 100 scan lines high, it will be stepped 100 times.
|
||||
Then, we'll divide the **SourceXWidth** and **SourceYHeight** lengths of
|
||||
Then, we'll divide the `SourceXWidth` and `SourceYHeight` lengths of
|
||||
the source edge by 100, and add those amounts to the source edge's
|
||||
coordinates each time the destination is stepped one scan line. Put
|
||||
another way, we have, as usual, arranged things so that in the
|
||||
destination polygon we step **DestYHeight** times, where **DestYHeight**
|
||||
destination polygon we step `DestYHeight` times, where `DestYHeight`
|
||||
is the height of the destination edge. The this approach arranges to
|
||||
step the source image edge **DestYHeight** times also, to match what the
|
||||
step the source image edge `DestYHeight` times also, to match what the
|
||||
destination is doing.
|
||||
|
||||

|
||||
|
|
@ -26,18 +26,18 @@ destination is doing.
|
|||
Now we're able to track the coordinates of the polygon edges through the
|
||||
source image in tandem with the destination edges. Stepping across each
|
||||
destination scan line uses precisely the same technique, as shown in
|
||||
Figure 56.4. In the destination, we step **DestXWidth** times across
|
||||
Figure 56.4. In the destination, we step `DestXWidth` times across
|
||||
each scan line of the polygon, once for each pixel on the scan line.
|
||||
(**DestXWidth** is the horizontal distance between the two edges being
|
||||
(`DestXWidth` is the horizontal distance between the two edges being
|
||||
scanned on any given scan line.) To match this, we divide
|
||||
**SourceXWidth** and **SourceYHeight** (the lengths of the scan line in
|
||||
`SourceXWidth` and `SourceYHeight` (the lengths of the scan line in
|
||||
the source image, as determined by the source edge points we've been
|
||||
tracking, as just described) by the width of the destination scan line,
|
||||
**DestXWidth**, to produce **SourceXStep** and **SourceYStep**. Then, we
|
||||
just step **DestXWidth** times, adding **SourceXStep** and
|
||||
**SourceYStep** to **SourceX** and **SourceY** each time, and choose the
|
||||
nearest image pixel to (**SourceX**,**SourceY**) to copy to (**DestX**,
|
||||
**DestY**). (Note that the names used above, such as **SourceXWidth**,
|
||||
`DestXWidth`, to produce `SourceXStep` and `SourceYStep`. Then, we
|
||||
just step `DestXWidth` times, adding `SourceXStep` and
|
||||
`SourceYStep` to `SourceX` and `SourceY` each time, and choose the
|
||||
nearest image pixel to (`SourceX`,`SourceY`) to copy to (`DestX`,
|
||||
`DestY`). (Note that the names used above, such as `SourceXWidth`,
|
||||
are used for descriptive purposes, and don't necessarily correspond to
|
||||
the actual variable names used in Listing 56.2.)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue