pimit

所属分类:图形图象
开发工具:GO
文件大小:0KB
下载次数:0
上传日期:2023-07-10 12:27:58
上 传 者sh-1993
说明:  (P) Go编程语言中的并行(Im)age(It)操作。
((P)arallel (Im)age (It)eration in Go programming language.)

文件列表:
LICENSE (1070, 2023-09-18)
NOTICES (2292, 2023-09-18)
Taskfile.yml (470, 2023-09-18)
access.go (1815, 2023-09-18)
cluster.go (4393, 2023-09-18)
cluster_test.go (7733, 2023-09-18)
column.go (12100, 2023-09-18)
column_test.go (25412, 2023-09-18)
error.go (395, 2023-09-18)
error_test.go (526, 2023-09-18)
general.go (12090, 2023-09-18)
general_test.go (20688, 2023-09-18)
go.mod (308, 2023-09-18)
go.sum (1351, 2023-09-18)
matrix.go (3017, 2023-09-18)
matrix_test.go (5041, 2023-09-18)
mock_test.go (1108, 2023-09-18)
nrgba.go (9527, 2023-09-18)
nrgba_test.go (13507, 2023-09-18)
rgba.go (9495, 2023-09-18)
rgba_test.go (13416, 2023-09-18)
row.go (12028, 2023-09-18)
row_test.go (25088, 2023-09-18)

# (P)arallel (Im)age (It)eration [![Go Reference](https://pkg.go.dev/badge/github.com/Krzysztofz01/pimit.svg)](https://pkg.go.dev/github.com/Krzysztofz01/pimit) [![Go Report Card](https://goreportcard.com/badge/github.com/Krzysztofz01/pimit)](https://goreportcard.com/report/github.com/Krzysztofz01/pimit) ![GitHub](https://img.shields.io/github/license/Krzysztofz01/pimit) ![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/Krzysztofz01/pimit?include_prereleases) ![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/Krzysztofz01/pimit) A minimalist library that adds functionality to wrap logic for concurrent iteration over images. The library contains various types of functions that allow parallel iteration over images for reading or writing. It is also possible to indicate whether the concurrent iteration is to be performed against columns, rows or clusters. Thanks to this library, it is possible to clean up the code fragments in which you perform image processing by separating the parts of the code related to iteration and concurrent operations. Thanks to the concurrent operation of these iterators, it is possible to increase the performance of the algorithm at the expense of a small increase in memory consumption. The current state of the library strongly **contradicts the YAGNI rule**, due to the large number of combinations of functions whose functionality is very similar. The library in its current state can not be considered finished. Which functions are most needed and which will remain in the library will become clear after some time of using it. ## Installation ``` go get -u github.com/Krzysztofz01/pimit ``` ## Documentation [https://pkg.go.dev/github.com/Krzysztofz01/pimit](https://pkg.go.dev/github.com/Krzysztofz01/pimit) ## Example A quick example of iteration over the image with current color printing. The "After" is additionaly handling all the concurrency work and is performing 2x faster on average. ### Before ```go image := CreateExampleImage() height := image.Bounds().Dy() width := image.Bounds().Dx() for y := 0; y < height; y += 1 { for x := 0; x < width; x += 1 { color := image.At(xIndex, yIndex) fmt.Print(color) } } ``` ### After ```go image := CreateExampleImage() ParallelColumnColorRead(image, func(c color.Color) { fmt.Print(c) }) ``` A quick example of making the picture black and white using parallel row iteration. ```go image := CreateExampleImage() ParallelRowColorReadWrite(img, func(c color.Color) color.Color { rgb, _ := c.(color.RGBA) value := uint8(0.299*float32(rgb.R) + 0.587*float32(rgb.G) + 0.114*float32(rgb.B)) return color.RGBA{value, value, value, 0xff} }) ```

近期下载者

相关文件


收藏者