英语题翻译29

Blurred Vision | JXNUOJ

Aliasing is the stair-step effect achieved when attempting to represent a smooth curve using a finite number of discrete pixels. Of course, all computer displays consist of a finite number of pixels, and many strategies have been devised to smooth the jagged edges with varying degrees of success.
Boudreaux and Thibodeaux are writing video game rendering software for the next big first-person shooter, and they don't know much about any of the progress made in the field of anti-aliasing. Therefore, they've decided to use a very simplistic (and visually unappealing) method to smooth the ragged edges. Unfortunately, it blurs the entire image, but at least it gets rid of those jaggies!
Normally, the game displays in m x n pixels, but they perform an extra anti-aliasing step that converts that image into an (m - 1) x (n - 1) image. Nobody will notice a pixel missing from each dimension, and they can calculate the new pixels by averaging squares of 4 pixels from the original image (and rounding down). For example, the images below represent the original image (left) and the anti-aliased image (right) using numbers to represent varying shades of black and white.

Input to this problem will consist of a (non-empty) series of up to 100 data sets. Each data set will be formatted according to the following description, and there will be no blank lines separating data sets.
A single data set has 3 components:
Start line - A single line:
START R C
where R and C are integers (2 ≤ (R,C) ≤ 9) indicating the number of rows and columns in the input image described by this data set.
Original Image - A series of R lines, each of which contains C integers from 0 to 9 inclusive. These integers represent the grayscale value of a pixel in the original image and will not be separated by spaces.
End line - A single line:
END
After the last data set, there will be a single line:
ENDOFINPUT

The output will be the anti-aliased image, which will be R - 1 rows, each with C - 1 integer pixel values. Each pixel in the output will be generated by averaging (and rounding down) the grayscale pixel values of the corresponding square of four pixels in the Original Image.

翻译:

混叠是尝试使用有限数量的离散像素表示平滑曲线时实现的阶梯效应。当然,所有计算机显示器都由有限数量的像素组成,并且已经设计了许多策略来平滑锯齿状边缘,并取得了不同程度的成功。
Boudreaux 和 Thibodeaux 正在为下一个大型第一人称射击游戏编写视频游戏渲染软件,他们对抗锯齿领域取得的任何进展都知之甚少。因此,他们决定使用一种非常简单(并且在视觉上不吸引人)的方法来平滑参差不齐的边缘。不幸的是,它模糊了整个图像,但至少它摆脱了那些锯齿!
通常,游戏以 m x n 像素显示,但它们会执行额外的抗锯齿步骤,将该图像转换为 (m - 1) x (n - 1) 图像。没有人会注意到每个维度中缺少一个像素,他们可以通过平均原始图像中的 4 个像素的平方(并向下舍入)来计算新像素。例如,下面的图像表示原始图像(左)和抗锯齿图像(右),使用数字表示不同的黑色和白色阴影。
此问题的输入将最多包括 100 个数据集的(非空)列表。每个数据集将根据以下描述进行格式化,并且不会有分隔数据集的空行。
单个数据集包含 3 个组件:
起始行 - 单行:START R C 。其中 R 和 C 是整数 (2 ≤ (R,C) ≤ 9),表示该数据集描述的输入图像中的行数和列数。原始图像一系列 R 行,每行包含从 0 到 9(含)的 C 个整数。这些整数代表原始图像中一个像素的灰度值,不会用空格分隔。
结束行 - 单行:END  在最后一个数据集之后,会有一行:ENDOFINPUT

输出将是抗锯齿图像,它将是 R - 1 行,每行具有 C - 1 个整数像素值。输出中的每个像素将通过平均(并向下舍入)原始图像中四个像素的相应正方形的灰度像素值来生成。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值