Пример #1
0
func main() {
	/* Choose the color function by changing the closure below
	 * Interesting functions include x^y, x*y and (x+y)/2
	 */
	m := Image{257, 257, func(x, y int) uint8 { return uint8(x * y) }}
	pic.ShowImage(m)
}
Пример #2
0
func main() {
	m := Image{width: 200, height: 200}
	m.Initialize()
	m.Draw()
	pic.ShowImage(&m)
	//fmt.Println(m.image)
}
Пример #3
0
func ExerciseImages() {
	m := Image{
		W: 100,
		H: 100,
	}
	pic.ShowImage(m)
}
Пример #4
0
func main() {
	m := Image{}
	m.x = 0
	m.y = 0
	m.w = 100
	m.h = 100
	pic.ShowImage(m)
}
Пример #5
0
func main() {
	m := Image{
		256,
		256,
		func(x, y int) uint8 {
			return uint8((x + y) / 2)
		},
	}
	pic.ShowImage(m)
}
Пример #6
0
func main() {
	m := &Image{
		x: 100,
		y: 200,
		r: 255,
		g: 128,
		b: 128,
		a: 255,
	}
	pic.ShowImage(m)
}
Пример #7
0
func main() {
	haha := make([][]byte, 100)
	for i := range haha {
		haha[i] = make([]byte, 100)
	}

	for i := range haha {
		for j := range haha[i] {
			haha[i][j] = byte(i * j * i)
		}
	}
	m := Image{100, 100, haha}
	pic.ShowImage(m)
}
Пример #8
0
func main() {
	m := Image{256, 256}
	pic.ShowImage(m)
}
Пример #9
0
func imageTester() {
	m := image.NewRGBA(image.Rect(0, 0, 100, 100))
	fmt.Println("Bounds = ", m.Bounds())
	fmt.Println(m.At(0, 0).RGBA())
	pic.ShowImage(m)
}
Пример #10
0
func main() {
	m := Image{100, 200, 200}
	pic.ShowImage(&m)
}
Пример #11
0
func main() {
	m := Image{200, 200, 255}
	pic.ShowImage(&m)
}
Пример #12
0
func TestImage2(t *testing.T) {
	m := Image{100, 100}
	pic.ShowImage(m)
}
Пример #13
0
func main() {
	m := Image{Pic(100, 100)}
	pic.ShowImage(m)
}
Пример #14
0
func main() {
	m := Image{50, 80, 120}
	pic.ShowImage(&m)
}
Пример #15
0
func main() {
	//sq := func(x, y, w, h int) int { return x * y }
	pic.ShowImage(&Image{500, 500, mandelbrot})
}
Пример #16
0
func main() {
	m := Image{100, 100}
	pic.ShowImage(m)
}
Пример #17
0
func main() {

	pic.ShowImage(&Image{})
}
Пример #18
0
func main() {
	m := Image{255, 255}
	pic.ShowImage(m)
}
Пример #19
0
func main() {
	m := Image{128, 128}
	pic.ShowImage(m)
}
Пример #20
0
func main() {
	m := Image{W: 100, H: 100}
	pic.ShowImage(m)
}
Пример #21
0
func testImages() {
	m := Image{W: 100, H: 100}
	pic.ShowImage(m)
}
Пример #22
0
func main() {
	i := NewImage(255, 255, func(a, b int) uint8 { return uint8((a^b)/1 + (a + b)) }) // Need the one so you don't divide by zero
	pic.ShowImage(i)
}
Пример #23
0
func main() {
	m := &Image{10, 20}
	pic.ShowImage(m)
}
Пример #24
0
func main() {
	m := Image{}
	pic.ShowImage(m)
}
Пример #25
0
func main() {
	m := Image{250, 70}
	pic.ShowImage(m)
}