myimage

package
v0.0.0-...-21f7faa Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2014 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MyImage

type MyImage struct {
	// contains filtered or unexported fields
}

func MakeMyImageFromPath

func MakeMyImageFromPath(path string) *MyImage

Given a path to an image file on disk, return a MyImage struct.

func (*MyImage) Congregate

func (i *MyImage) Congregate(maxMoveDist int, numIters float64)

Modify the image in-place by swapping pixels to places where they match their neighbors. maxMoveDist is the max distance between two swapped pixels. If 0, there is no limit.

func (*MyImage) GetColorWithLinearInterpolation

func (i *MyImage) GetColorWithLinearInterpolation(x float64, y float64) *mycolor.MyColor

Return an interpolated pixel value from the image. x and y values outside the image will return the value from the nearest point in the image.

func (*MyImage) SaveAs

func (i *MyImage) SaveAs(path string)

func (*MyImage) ShowThumb

func (i *MyImage) ShowThumb(thumbSize float64)

func (*MyImage) SortColumns

func (i *MyImage) SortColumns(kind string, numThreads int)

Launch some threads to sort the rows of the image. Wait until complete, and kill the threads.

func (*MyImage) SortRows

func (i *MyImage) SortRows(kind string, numThreads int)

Launch some threads to sort the rows of the image. Wait until complete, and kill the threads.

func (*MyImage) String

func (i *MyImage) String() string

func (*MyImage) ThumbnailByPixels

func (i *MyImage) ThumbnailByPixels(maxRes int) *MyImage

Return a new image which fits in a square of maxRes x maxRes pixels but keeps the same aspect ratio. If the image is already small enough, just return the same image again.

func (*MyImage) ThumbnailByRatio

func (i *MyImage) ThumbnailByRatio(ratio float64) *MyImage

Return a new image which has a size of (ratio * original_image_size)

func (*MyImage) ToBuiltInImage

func (i *MyImage) ToBuiltInImage() image.Image

Create an image using the built-in image.RGBA type and copy our pixels into it.

Jump to

Keyboard shortcuts

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