pimit

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: MIT Imports: 6 Imported by: 3

README

(P)arallel (Im)age (It)eration

Go Reference Go Report Card GitHub GitHub release (latest by date including pre-releases) GitHub code size in bytes

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

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
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
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.

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}
})

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewErrorTrap added in v0.2.0

func NewErrorTrap() *errorTrap

func ParallelClusterDistributedReadWrite deprecated

func ParallelClusterDistributedReadWrite(i draw.Image, c int, a ReadWriteAccess)

Perform parallel reading and editing of pixels of the passed image. For each pixel, execute the passed access function allowing to read the color and coordinates, which will return the color that the pixel should take after this operation. The changes will be applied to the passed image instance. The passed integer is the number of clusters into which the image will be divided. Each cluster is then iterated through a separate goroutine.

Deprecated: Use ParallelDistributedReadWrite instead.

func ParallelClusterDistributedReadWriteE deprecated

func ParallelClusterDistributedReadWriteE(i draw.Image, c int, a ReadWriteAccessE) error

Perform parallel reading and editing of pixels of the passed image. For each pixel, execute the passed access function allowing to read the color and coordinates, which will return the color that the pixel should take after this operation. The changes will be applied to the passed image instance. The passed integer is the number of clusters into which the image will be divided. Each cluster is then iterated through a separate goroutine. Errors that occur in the function will be caught and the first one will be returned by the function.

Deprecated: Use ParallelDistributedReadWriteE instead.

func ParallelColumnColorRead deprecated

func ParallelColumnColorRead(i image.Image, a ReadColorAccess)

Perform a parallel reading of the pixels of the passed image. For each pixel, execute the passed access function allowing you to read only the color. Every column is iterated in a separate goroutine.

Deprecated: Use ParallelRead instead.

func ParallelColumnColorReadE deprecated

func ParallelColumnColorReadE(i image.Image, a ReadColorAccessE) error

Perform a parallel reading of the pixels of the passed image. For each pixel, execute the passed access function allowing you to read only the color. Every column is iterated in a separate goroutine. Errors that occur in the function will be caught and the first one will be returned by the function.

Deprecated: Use ParallelReadE instead.

func ParallelColumnColorReadWrite deprecated

func ParallelColumnColorReadWrite(i draw.Image, a ReadWriteColorAccess)

Perform parallel reading and editing of pixels of the passed image. For each pixel, execute the passed access function allowing to read only the color, which will return the color that the pixel should take after this operation. The changes will be applied to the passed image instance. Every column is iterated in a separate goroutine.

Deprecated: Use ParallelReadWrite instead.

func ParallelColumnColorReadWriteE deprecated

func ParallelColumnColorReadWriteE(i draw.Image, a ReadWriteColorAccessE) error

Perform parallel reading and editing of pixels of the passed image. For each pixel, execute the passed access function allowing to read only the color, which will return the color that the pixel should take after this operation. The changes will be applied to the passed image instance. Every column is iterated in a separate goroutine. Errors that occur in the function will be caught and the first one will be returned by the function.

Deprecated: Use ParallelReadWriteE instead.

func ParallelColumnColorReadWriteNew deprecated

func ParallelColumnColorReadWriteNew(i image.Image, a ReadWriteColorAccess) image.Image

Perform parallel reading and editing of pixels of the passed image. For each pixel, execute the passed access function allowing to read only the color, which will return the color that the pixel should take after this operation. The changes will be applied to the passed image instance. The changes will be applied to a new image instance returned from this function. Every column is iterated in a separate goroutine.

Deprecated: Use ParallelReadWriteNew instead.

func ParallelColumnColorReadWriteNewE deprecated

func ParallelColumnColorReadWriteNewE(i image.Image, a ReadWriteColorAccessE) (image.Image, error)

Perform parallel reading and editing of pixels of the passed image. For each pixel, execute the passed access function allowing to read only the color, which will return the color that the pixel should take after this operation. The changes will be applied to the passed image instance. The changes will be applied to a new image instance returned from this function. Every column is iterated in a separate goroutine. Errors that occur in the function will be caught and the first one will be returned by the function.

Deprecated: Use ParallelReadWriteNewE instead.

func ParallelColumnIndices deprecated added in v0.1.0

func ParallelColumnIndices(w, h int, a IndicesAccess)

Perform a parallel iteration of the indexes according to the width and height indicated by the parameters. For each combination of indexes excute the passed access function. Each column is iterated in a separate goroutine.

Deprecated: Use ParallelIndices instead.

func ParallelColumnRead deprecated

func ParallelColumnRead(i image.Image, a ReadAccess)

Perform a parallel reading of the pixels of the passed image. For each pixel, execute the passed access function allowing you to read the color and coordinates. Every column is iterated in a separate goroutine.

Deprecated: Use ParallelRead function instead.

func ParallelColumnReadE deprecated

func ParallelColumnReadE(i image.Image, a ReadAccessE) error

Perform a parallel reading of the pixels of the passed image. For each pixel, execute the passed access function allowing you to read the color and coordinates. Every column is iterated in a separate goroutine. Errors that occur in the function will be caught and the first one will be returned by the function.

Deprecated: Used ParallelReadE instead.

func ParallelColumnReadWrite deprecated

func ParallelColumnReadWrite(i draw.Image, a ReadWriteAccess)

Perform parallel reading and editing of pixels of the passed image. For each pixel, execute the passed access function allowing to read the color and coordinates, which will return the color that the pixel should take after this operation. The changes will be applied to the passed image instance. Every column is iterated in a separate goroutine.

Deprecated: Use ParallelReadWrite instead.

func ParallelColumnReadWriteE deprecated

func ParallelColumnReadWriteE(i draw.Image, a ReadWriteAccessE) error

Perform parallel reading and editing of pixels of the passed image. For each pixel, execute the passed access function allowing to read the color and coordinates, which will return the color that the pixel should take after this operation. The changes will be applied to the passed image instance. Every column is iterated in a separate goroutine. Errors that occur in the function will be caught and the first one will be returned by the function.

Deprecated: Use ParallelReadWriteE instead.

func ParallelColumnReadWriteNew deprecated

func ParallelColumnReadWriteNew(i image.Image, a ReadWriteAccess) image.Image

Perform parallel reading and editing of pixels of the passed image. For each pixel, execute the passed access function allowing to read the color and coordinates, which will return the color that the pixel should take after this operation. The changes will be applied to a new image instance returned from this function. Every column is iterated in a separate goroutine.

Deprecated: Use ParallelReadWriteNew instead.

func ParallelColumnReadWriteNewE deprecated

func ParallelColumnReadWriteNewE(i image.Image, a ReadWriteAccessE) (image.Image, error)

Perform parallel reading and editing of pixels of the passed image. For each pixel, execute the passed access function allowing to read the color and coordinates, which will return the color that the pixel should take after this operation. The changes will be applied to a new image instance returned from this function. Every column is iterated in a separate goroutine. Errors that occur in the function will be caught and the first one will be returned by the function.

Deprecated: Use ParallelReadWriteNewE instead.

func ParallelDistributedReadWrite added in v0.2.0

func ParallelDistributedReadWrite(src draw.Image, c int, d ReadWriteDelegate)

Perform a parallel iteration of the pixels of the provided image. For each pixel, execute the delegate function allowing you to read the color and coordinates, the delegate return color will be set at the given coordinates. This changes will be applied to the passed image instance. The integer parameter is the number of clustes into which the image will be devided. Each cluster is then iterated in a separate goroutine.

func ParallelDistributedReadWriteE added in v0.2.0

func ParallelDistributedReadWriteE(src draw.Image, c int, d ReadWriteErrorableDelegate) error

Perform a parallel iteration of the pixels of the provided image. For each pixel, execute the delegate function allowing you to read the color and coordinates, the delegate return color will be set at the given coordinates. This changes will be applied to the passed image instance. The integer parameter is the number of clustes into which the image will be devided. Each cluster is then iterated in a separate goroutine. The iteration will break after the first error occurs and the error will be returned.

func ParallelIndices added in v0.2.0

func ParallelIndices(w, h int, d IndicesDelegate)

Perform a parallel iteration of the indexes according to the width and height provided via the parameters. Execute the delegate for each indexes combination. Each row is iterated in a separate goroutine.

func ParallelMatrixReadWrite added in v0.1.0

func ParallelMatrixReadWrite[T any](m [][]T, d func(x, y int, value T) T)

Perform a parallel iteration of the values of the provided matrix represented as a two-dimentional generic slice. For each entry, execute the delegate function allowing you to read the values and coordinates, the delegate return value will be set at the given coordinates. This changes will be applied to the passed two-dimentional slice instance. Each column is iterated in a separate goroutine.

func ParallelMatrixReadWriteE added in v0.1.0

func ParallelMatrixReadWriteE[T any](m [][]T, d func(x, y int, value T) (T, error)) error

Perform a parallel iteration of the values of the provided matrix represented as a two-dimentional generic slice. For each entry, execute the delegate function allowing you to read the values and coordinates, the delegate return value will be set at the given coordinates. This changes will be applied to the passed two-dimentional slice instance. Each column is iterated in a separate goroutine. The iteration will break after the first error occurs and the error will be returned.

func ParallelNrgbaRead added in v0.2.0

func ParallelNrgbaRead(src *image.NRGBA, d NrgbaReadDelegate)

Perform a parallel iteration of the pixels of the provided NRGBA image. For each pixel, execute the delegate function allowing you to read the color (R, G, B and A as uint8) and coordinates. Each row is iterated in a separate goroutine.

func ParallelNrgbaReadE added in v0.2.0

func ParallelNrgbaReadE(src *image.NRGBA, d NrgbaReadErrorableDelegate) error

Perform a parallel iteration of the pixels of the provided NRGBA image. For each pixel, execute the delegate function allowing you to read the color (R, G, B and A as uint8) and coordinates. Each row is iterated in a separate goroutine. The iteration will break after the first error occurs and the error will be returned.

func ParallelNrgbaReadWrite added in v0.2.0

func ParallelNrgbaReadWrite(src *image.NRGBA, d NrgbaReadWriteDelegate)

Perform a parallel iteration of the pixels of the provided NRGBA image. For each pixel, execute the delegate function allowing you to read the color (R, G, B and A as uint8) and coordinates, the delegate return color will be set at the given coordinates. This changes will be applied to the passed image instance. Consider using ParallelReadWriteNew if you want to avoid changes to the original image at the expense of additional allocations. Each row is iterated in a separate goroutine.

func ParallelNrgbaReadWriteE added in v0.2.0

func ParallelNrgbaReadWriteE(src *image.NRGBA, d NrgbaReadWriteErrorableDelegate) error

Perform a parallel iteration of the pixels of the provided NRGBA image. For each pixel, execute the delegate function allowing you to read the color (R, G, B and A as uint8) and coordinates, the delegate return color will be set at the given coordinates. This changes will be applied to the passed image instance. Consider using ParallelReadWriteNewE if you want to avoid changes to the original image at the expense of additional allocations. Each row is iterated in a separate goroutine. The iteration will break after the first error occurs and the error will be returned.

func ParallelNrgbaReadWriteNew added in v0.2.0

func ParallelNrgbaReadWriteNew(src *image.NRGBA, d NrgbaReadWriteDelegate) *image.NRGBA

Perform a parallel iteration of the pixels of the provided NRGBA image. For each pixel, execute the delegate function allowing you to read the color (R, G, B and A as uint8) and coordinates, the delegate return color will be set at the given coordinates. This changes will be applied to a new image instance which internaly uses the NRGBA color space and is returned by the function. Each row is iterated in a separate goroutine.

func ParallelNrgbaReadWriteNewE added in v0.2.0

func ParallelNrgbaReadWriteNewE(src *image.NRGBA, d NrgbaReadWriteErrorableDelegate) (*image.NRGBA, error)

Perform a parallel iteration of the pixels of the provided NRGBA image. For each pixel, execute the delegate function allowing you to read the color (R, G, B and A as uint8) and coordinates, the delegate return color will be set at the given coordinates. This changes will be applied to a new image instance which internaly uses the NRGBA color space and is returned by the function. Each row is iterated in a separate goroutine. The iteration will break after the first error occurs and the error will be returned.

func ParallelRead added in v0.2.0

func ParallelRead(src image.Image, d ReadDelegate)

Perform a parallel iteration of the pixels of the provided image. For each pixel, execute the delegate function allowing you to read the color and coordinates. Each row is iterated in a separate goroutine.

func ParallelReadE added in v0.2.0

func ParallelReadE(src image.Image, d ReadErrorableDelegate) error

Perform a parallel iteration of the pixels of the provided image. For each pixel, execute the delegate function allowing you to read the color and coordinates. Each row is iterated in a separate goroutine. The iteration will break after the first error occurs and the error will be returned.

func ParallelReadWrite added in v0.2.0

func ParallelReadWrite(src draw.Image, d ReadWriteDelegate)

Perform a parallel iteration of the pixels of the provided image. For each pixel, execute the delegate function allowing you to read the color and coordinates, the delegate return color will be set at the given coordinates. This changes will be applied to the passed image instance. Consider using ParallelReadWriteNew if you want to avoid changes to the original image at the expense of additional allocations. Each row is iterated in a separate goroutine.

func ParallelReadWriteE added in v0.2.0

func ParallelReadWriteE(src draw.Image, d ReadWriteErrorableDelegate) error

Perform a parallel iteration of the pixels of the provided image. For each pixel, execute the delegate function allowing you to read the color and coordinates, the delegate return color will be set at the given coordinates. This changes will be applied to the passed image instance. Consider using ParallelReadWriteNewE if you want to avoid changes to the original image at the expense of additional allocations. Each row is iterated in a separate goroutine. The iteration will break after the first error occurs and the error will be returned.

func ParallelReadWriteNew added in v0.2.0

func ParallelReadWriteNew(src image.Image, d ReadWriteDelegate) draw.Image

Perform a parallel iteration of the pixels of the provided image. For each pixel, execute the delegate function allowing you to read the color and coordinates, the delegate return color will be set at the given coordinates. This changes will be applied to a new image instance which internaly uses the NRGBA color space and is returned by the function. Each row is iterated in a separate goroutine.

func ParallelReadWriteNewE added in v0.2.0

func ParallelReadWriteNewE(src image.Image, d ReadWriteErrorableDelegate) (draw.Image, error)

Perform a parallel iteration of the pixels of the provided image. For each pixel, execute the delegate function allowing you to read the color and coordinates, the delegate return color will be set at the given coordinates. This changes will be applied to a new image instance which internaly uses the NRGBA color space and is returned by the function. Each row is iterated in a separate goroutine. The iteration will break after the first error occurs and the error will be returned.

func ParallelRgbaRead added in v0.2.0

func ParallelRgbaRead(src *image.RGBA, d RgbaReadDelegate)

Perform a parallel iteration of the pixels of the provided RGBA image. For each pixel, execute the delegate function allowing you to read the color (R, G, B and A as uint8) and coordinates. Each row is iterated in a separate goroutine.

func ParallelRgbaReadE added in v0.2.0

func ParallelRgbaReadE(src *image.RGBA, d RgbaReadErrorableDelegate) error

Perform a parallel iteration of the pixels of the provided RGBA image. For each pixel, execute the delegate function allowing you to read the color (R, G, B and A as uint8) and coordinates. Each row is iterated in a separate goroutine. The iteration will break after the first error occurs and the error will be returned.

func ParallelRgbaReadWrite added in v0.2.0

func ParallelRgbaReadWrite(src *image.RGBA, d RgbaReadWriteDelegate)

Perform a parallel iteration of the pixels of the provided RGBA image. For each pixel, execute the delegate function allowing you to read the color (R, G, B and A as uint8) and coordinates, the delegate return color will be set at the given coordinates. This changes will be applied to the passed image instance. Consider using ParallelReadWriteNew if you want to avoid changes to the original image at the expense of additional allocations. Each row is iterated in a separate goroutine.

func ParallelRgbaReadWriteE added in v0.2.0

func ParallelRgbaReadWriteE(src *image.RGBA, d RgbaReadWriteErrorableDelegate) error

Perform a parallel iteration of the pixels of the provided RGBA image. For each pixel, execute the delegate function allowing you to read the color (R, G, B and A as uint8) and coordinates, the delegate return color will be set at the given coordinates. This changes will be applied to the passed image instance. Consider using ParallelReadWriteNewE if you want to avoid changes to the original image at the expense of additional allocations. Each row is iterated in a separate goroutine. The iteration will break after the first error occurs and the error will be returned.

func ParallelRgbaReadWriteNew added in v0.2.0

func ParallelRgbaReadWriteNew(src *image.RGBA, d RgbaReadWriteDelegate) *image.RGBA

Perform a parallel iteration of the pixels of the provided RGBA image. For each pixel, execute the delegate function allowing you to read the color (R, G, B and A as uint8) and coordinates, the delegate return color will be set at the given coordinates. This changes will be applied to a new image instance which internaly uses the NRGBA color space and is returned by the function. Each row is iterated in a separate goroutine.

func ParallelRgbaReadWriteNewE added in v0.2.0

func ParallelRgbaReadWriteNewE(src *image.RGBA, d RgbaReadWriteErrorableDelegate) (*image.RGBA, error)

Perform a parallel iteration of the pixels of the provided RGBA image. For each pixel, execute the delegate function allowing you to read the color (R, G, B and A as uint8) and coordinates, the delegate return color will be set at the given coordinates. This changes will be applied to a new image instance which internaly uses the NRGBA color space and is returned by the function. Each row is iterated in a separate goroutine. The iteration will break after the first error occurs and the error will be returned.

func ParallelRowColorRead deprecated

func ParallelRowColorRead(i image.Image, a ReadColorAccess)

Perform a parallel reading of the pixels of the passed image. For each pixel, execute the passed access function allowing you to read only the color. Every row is iterated in a separate goroutine.

Deprecated: Use ParallelRead instead.

func ParallelRowColorReadE deprecated

func ParallelRowColorReadE(i image.Image, a ReadColorAccessE) error

Perform a parallel reading of the pixels of the passed image. For each pixel, execute the passed access function allowing you to read only the color. Every row is iterated in a separate goroutine. Errors that occur in the function will be caught and the first one will be returned by the function.

Deprecated: Use ParallelReadE instead.

func ParallelRowColorReadWrite deprecated

func ParallelRowColorReadWrite(i draw.Image, a ReadWriteColorAccess)

Perform parallel reading and editing of pixels of the passed image. For each pixel, execute the passed access function allowing to read only the color, which will return the color that the pixel should take after this operation. The changes will be applied to the passed image instance. Every row is iterated in a separate goroutine.

Deprecated: Use ParallelReadWrite instead.

func ParallelRowColorReadWriteE deprecated

func ParallelRowColorReadWriteE(i draw.Image, a ReadWriteColorAccessE) error

Perform parallel reading and editing of pixels of the passed image. For each pixel, execute the passed access function allowing to read only the color, which will return the color that the pixel should take after this operation. The changes will be applied to the passed image instance. Every row is iterated in a separate goroutine. Errors that occur in the function will be caught and the first one will be returned by the function.

Deprecated: Use ParallelReadWriteE instead.

func ParallelRowColorReadWriteNew deprecated

func ParallelRowColorReadWriteNew(i image.Image, a ReadWriteColorAccess) image.Image

Perform parallel reading and editing of pixels of the passed image. For each pixel, execute the passed access function allowing to read only the color, which will return the color that the pixel should take after this operation. The changes will be applied to the passed image instance. The changes will be applied to a new image instance returned from this function. Every row is iterated in a separate goroutine.

Deprecated: Use ParallelReadWriteNew instead.

func ParallelRowColorReadWriteNewE deprecated

func ParallelRowColorReadWriteNewE(i image.Image, a ReadWriteColorAccessE) (image.Image, error)

Perform parallel reading and editing of pixels of the passed image. For each pixel, execute the passed access function allowing to read only the color, which will return the color that the pixel should take after this operation. The changes will be applied to the passed image instance. The changes will be applied to a new image instance returned from this function. Every row is iterated in a separate goroutine. Errors that occur in the function will be caught and the first one will be returned by the function.

Deprecated: Use ParallelReadWriteNewE instead.

func ParallelRowIndices deprecated added in v0.1.0

func ParallelRowIndices(w, h int, a IndicesAccess)

Perform a parallel iteration of the indexes according to the width and height indicated by the parameters. For each combination of indexes excute the passed access function. Each row is iterated in a separate goroutine.

Deprecated: Use ParallelIndices instead.

func ParallelRowRead deprecated

func ParallelRowRead(i image.Image, a ReadAccess)

Perform a parallel reading of the pixels of the passed image. For each pixel, execute the passed access function allowing you to read the color and coordinates. Every row is iterated in a separate goroutine.

Deprecated: Use ParallelRead function instead.

func ParallelRowReadE deprecated

func ParallelRowReadE(i image.Image, a ReadAccessE) error

Perform a parallel reading of the pixels of the passed image. For each pixel, execute the passed access function allowing you to read the color and coordinates. Every row is iterated in a separate goroutine. Errors that occur in the function will be caught and the first one will be returned by the function.

Deprecated: Used ParallelReadE instead.

func ParallelRowReadWrite deprecated

func ParallelRowReadWrite(i draw.Image, a ReadWriteAccess)

Perform parallel reading and editing of pixels of the passed image. For each pixel, execute the passed access function allowing to read the color and coordinates, which will return the color that the pixel should take after this operation. The changes will be applied to the passed image instance. Every row is iterated in a separate goroutine.

Deprecated: Use ParallelReadWrite instead.

func ParallelRowReadWriteE deprecated

func ParallelRowReadWriteE(i draw.Image, a ReadWriteAccessE) error

Perform parallel reading and editing of pixels of the passed image. For each pixel, execute the passed access function allowing to read the color and coordinates, which will return the color that the pixel should take after this operation. The changes will be applied to the passed image instance. Every row is iterated in a separate goroutine. Errors that occur in the function will be caught and the first one will be returned by the function.

Deprecated: Use ParallelReadWriteE instead.

func ParallelRowReadWriteNew deprecated

func ParallelRowReadWriteNew(i image.Image, a ReadWriteAccess) image.Image

Perform parallel reading and editing of pixels of the passed image. For each pixel, execute the passed access function allowing to read the color and coordinates, which will return the color that the pixel should take after this operation. The changes will be applied to a new image instance returned from this function. Every row is iterated in a separate goroutine.

Deprecated: Use ParallelReadWriteNew instead.

func ParallelRowReadWriteNewE deprecated

func ParallelRowReadWriteNewE(i image.Image, a ReadWriteAccessE) (image.Image, error)

Perform parallel reading and editing of pixels of the passed image. For each pixel, execute the passed access function allowing to read the color and coordinates, which will return the color that the pixel should take after this operation. The changes will be applied to a new image instance returned from this function. Every row is iterated in a separate goroutine. Errors that occur in the function will be caught and the first one will be returned by the function.

Deprecated: Use ParallelReadWriteNewE instead.

Types

type IndicesAccess added in v0.1.0

type IndicesAccess = func(xIndex, yIndex int)

Iteration access function. Allows you to read the coordinates.

type IndicesDelegate added in v0.2.0

type IndicesDelegate = func(x, y int)

type NrgbaReadDelegate added in v0.2.0

type NrgbaReadDelegate = func(x, y int, r, g, b, a uint8)

type NrgbaReadErrorableDelegate added in v0.2.0

type NrgbaReadErrorableDelegate = func(x, y int, r, g, b, a uint8) error

type NrgbaReadWriteDelegate added in v0.2.0

type NrgbaReadWriteDelegate = func(x, y int, r, g, b, a uint8) (uint8, uint8, uint8, uint8)

type NrgbaReadWriteErrorableDelegate added in v0.2.0

type NrgbaReadWriteErrorableDelegate = func(x, y int, r, g, b, a uint8) (uint8, uint8, uint8, uint8, error)

type ReadAccess

type ReadAccess = func(xIndex, yIndex int, color color.Color)

Iteration access function. Allows you to read the coordinates of a pixel and its color.

type ReadAccessE

type ReadAccessE = func(xIndex, yIndex int, color color.Color) error

Iteration access function. Allows you to read the coordinates of a pixel and its color. Errors can be passed down to the iterator.

type ReadColorAccess

type ReadColorAccess = func(color color.Color)

Iteration access function. Allows you to read the pixel color.

type ReadColorAccessE

type ReadColorAccessE = func(color color.Color) error

Iteration access function. Allows you to read the pixel color. Errors can be passed down to the iterator.

type ReadDelegate added in v0.2.0

type ReadDelegate = func(x, y int, c color.Color)

type ReadErrorableDelegate added in v0.2.0

type ReadErrorableDelegate = func(x, y int, c color.Color) error

type ReadWriteAccess

type ReadWriteAccess = func(xIndex, yIndex int, color color.Color) color.Color

Iteration access function. Allows you to read the coordinates of a pixel and its color. Returns the color to be set.

type ReadWriteAccessE

type ReadWriteAccessE = func(xIndex, yIndex int, color color.Color) (color.Color, error)

Iteration access function. Allows you to read the coordinates of a pixel and its color. Returns the color to be set. Errors can be passed down to the iterator.

type ReadWriteColorAccess

type ReadWriteColorAccess = func(color color.Color) color.Color

Iteration access function. Allows you to read the pixel color. Returns the color to be set.

type ReadWriteColorAccessE

type ReadWriteColorAccessE = func(color color.Color) (color.Color, error)

Iteration access function. Allows you to read the pixel color. Returns the color to be set. Errors can be passed down to the iterator.

type ReadWriteDelegate added in v0.2.0

type ReadWriteDelegate = func(x, y int, c color.Color) color.Color

type ReadWriteErrorableDelegate added in v0.2.0

type ReadWriteErrorableDelegate = func(x, y int, c color.Color) (color.Color, error)

type RgbaReadDelegate added in v0.2.0

type RgbaReadDelegate = func(x, y int, r, g, b, a uint8)

type RgbaReadErrorableDelegate added in v0.2.0

type RgbaReadErrorableDelegate = func(x, y int, r, g, b, a uint8) error

type RgbaReadWriteDelegate added in v0.2.0

type RgbaReadWriteDelegate = func(x, y int, r, g, b, a uint8) (uint8, uint8, uint8, uint8)

type RgbaReadWriteErrorableDelegate added in v0.2.0

type RgbaReadWriteErrorableDelegate = func(x, y int, r, g, b, a uint8) (uint8, uint8, uint8, uint8, error)

Jump to

Keyboard shortcuts

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