Projector

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2019 License: MIT Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BilinearInterp

func BilinearInterp(data []byte, x, y float64, mw int, numChannels, colorChannel int) byte

Types

type LinearConverter added in v0.5.2

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

LinearConverter This is used for pixel map to coordinates from a reprojected image.

func (*LinearConverter) ColumnOffset added in v0.5.2

func (gc *LinearConverter) ColumnOffset() int

ColumnOffset returns the number of pixels that the image is offset from left

func (*LinearConverter) CropLeft added in v0.5.2

func (gc *LinearConverter) CropLeft() int

CropLeft returns the number of pixels that should be cropped

func (*LinearConverter) Hash added in v0.5.2

func (gc *LinearConverter) Hash() string

func (*LinearConverter) LatLon2XY added in v0.5.2

func (gc *LinearConverter) LatLon2XY(lat, lon float64) (x, y int)

LatLon2XY Converts Latitude/Longitude to Pixel X/Y lat => Latitude in Degrees lon => Longitude in Degrees

func (*LinearConverter) LatLon2XYf added in v0.5.2

func (gc *LinearConverter) LatLon2XYf(lat, lon float64) (x, y float64)

LatLon2XYf Converts Latitude/Longitude to Pixel X/Y (float64) lat => Latitude in Degrees lon => Longitude in Degrees

func (*LinearConverter) LatitudeCoverage added in v0.5.2

func (gc *LinearConverter) LatitudeCoverage() float64

LatitudeCoverage returns Coverage of the view in Latitude Degrees

func (*LinearConverter) LineOffset added in v0.5.2

func (gc *LinearConverter) LineOffset() int

LineOffset returns the number of pixels that the image is offset from top

func (*LinearConverter) LongitudeCoverage added in v0.5.2

func (gc *LinearConverter) LongitudeCoverage() float64

LongitudeCoverage returns Coverage of the view in Longitude Degrees

func (*LinearConverter) MaxLatitude added in v0.5.2

func (gc *LinearConverter) MaxLatitude() float64

MaxLatitude returns the Maximum Visible Latitude

func (*LinearConverter) MaxLongitude added in v0.5.2

func (gc *LinearConverter) MaxLongitude() float64

MaxLongitude returns Maximum visible Longitude

func (*LinearConverter) MinLatitude added in v0.5.2

func (gc *LinearConverter) MinLatitude() float64

MinLatitude returns Minimum Visible Latitude

func (*LinearConverter) MinLongitude added in v0.5.2

func (gc *LinearConverter) MinLongitude() float64

MinLongitude returns Minimum visible latitude

func (*LinearConverter) TrimLatitude added in v0.5.2

func (gc *LinearConverter) TrimLatitude() float64

TrimLatitude returns Latitude Trim parameter for removing artifacts on Reprojection (in degrees)

func (*LinearConverter) TrimLongitude added in v0.5.2

func (gc *LinearConverter) TrimLongitude() float64

TrimLongitude returns Longitude Trim parameter for removing artifacts on Reprojection (in degrees)

func (*LinearConverter) XY2LatLon added in v0.5.2

func (gc *LinearConverter) XY2LatLon(x, y int) (lat, lon float64)

XY2LatLon Converts Pixel X/Y to Latitude/Longitude lat => Latitude in Degrees lon => Longitude in Degrees

type ProjectionConverter added in v0.5.2

type ProjectionConverter interface {
	// LatLon2XY Converts Latitude/Longitude to Pixel X/Y
	// lat => Latitude in Degrees
	// lon => Longitude in Degrees
	LatLon2XY(lat, lon float64) (x, y int)

	// LatLon2XYf Converts Latitude/Longitude to Pixel X/Y (float64)
	// lat => Latitude in Degrees
	// lon => Longitude in Degrees
	LatLon2XYf(lat, lon float64) (x, y float64)

	// XY2LatLon Converts Pixel X/Y to Latitude/Longitude
	// lat => Latitude in Degrees
	// lon => Longitude in Degrees
	XY2LatLon(x, y int) (lat, lon float64)

	Hash() string

	// ColumnOffset returns the number of pixels that the image is offset from left
	ColumnOffset() int

	// LineOffset returns the number of pixels that the image is offset from top
	LineOffset() int

	// CropLeft returns the number of pixels that should be cropped
	CropLeft() int

	// MaxLatitude returns the Maximum Visible Latitude
	MaxLatitude() float64

	// MinLatitude returns Minimum Visible Latitude
	MinLatitude() float64

	// MaxLongitude returns Maximum visible Longitude
	MaxLongitude() float64

	// MinLongitude returns Minimum visible latitude
	MinLongitude() float64

	// LatitudeCoverage returns Coverage of the view in Latitude Degrees
	LatitudeCoverage() float64

	// LongitudeCoverage returns Coverage of the view in Longitude Degrees
	LongitudeCoverage() float64

	// TrimLongitude returns Longitude Trim parameter for removing artifacts on Reprojection (in degrees)
	TrimLongitude() float64

	// TrimLatitude returns Latitude Trim parameter for removing artifacts on Reprojection (in degrees)
	TrimLatitude() float64
}

func MakeLinearConverter added in v0.5.2

func MakeLinearConverter(imgWidth, imgHeight int, pc ProjectionConverter) ProjectionConverter

MakeLinearConverter Creates a new instance of LinearConverter

This is used for pixel map to coordinates from a reprojected image.
imgWidth => Image Width in pixels
imgHeight => Image Height in pixels
pc => Previous Projection Converter (before reprojection)

type Projector

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

func MakeProjector

func MakeProjector(gc ProjectionConverter) *Projector

func (*Projector) DrawLatLonLines

func (p *Projector) DrawLatLonLines(src *image.RGBA, thickness int, c color.Color)

func (*Projector) ReprojectLinear

func (p *Projector) ReprojectLinear(src *image.RGBA) *image.RGBA

func (*Projector) ReprojectLinearGray

func (p *Projector) ReprojectLinearGray(src *image.Gray) *image.Gray

func (*Projector) ReprojectLinearMultiThread

func (p *Projector) ReprojectLinearMultiThread(src image.Image) *image.RGBA

func (*Projector) ReprojectLinearMultiThreadGray

func (p *Projector) ReprojectLinearMultiThreadGray(src image.Image) *image.Gray

type Sampler2D

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

func MakeSampler2D

func MakeSampler2D(img image.Image) *Sampler2D

func (*Sampler2D) GetPixel

func (s *Sampler2D) GetPixel(x, y float64) color.Color

func (*Sampler2D) GetPixelGray

func (s *Sampler2D) GetPixelGray(x, y float64) color.Gray

Jump to

Keyboard shortcuts

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