slice_pratice

command
v0.0.0-...-1c8a91e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 10, 2020 License: MIT Imports: 2 Imported by: 0

README

题目:

实现Pic。它返回一个长度为dy的slice,其中每个元素是一个长度为dx且元素类型为uint8的slice。当你运行这个程序时,它会将每个整数作为对应像素的灰度值(其实是蓝度)并显示这个 slice所对应的图像。

计算每个像素的灰度值的方法由你决定;几个有意思的选择包括 (x+y)/2、x*y 和 x^y 。 (需要使用循环来分配 [][]uint8 中的每个 []uint8 。) (使用 uint8(intValue) 来在类型之间进行转换。)

提示:

外层slice长度为dy 作为子元素的slice的长度为dx 里层slice每个元素值:(x+y)/2 或x*y 或 x^y 使用两层for循环嵌套 计算颜色值,不同的计算方式,会有不同的运行结果

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL