Documentation ¶
Index ¶
- Constants
- Variables
- func DrawOver(dst *image.RGBA, src *image.RGBA)
- func LinearInterpolator(samples []scope.Voltage, size int) ([]scope.Voltage, error)
- func PlotToPng(dev scope.Device, width, height int, ...) error
- func SincInterpolator(samples []scope.Voltage, size int) ([]scope.Voltage, error)
- func SincZeroPadInterpolator(samples []scope.Voltage, size int) ([]scope.Voltage, error)
- func StepInterpolator(samples []scope.Voltage, size int) ([]scope.Voltage, error)
- type Interpolator
- type Plot
- func (plot Plot) DrawAll(data []scope.ChannelData, traceParams map[scope.ChanID]scope.TraceParams, ...) error
- func (plot Plot) DrawFromDevice(dev scope.Device, traceParams map[scope.ChanID]scope.TraceParams, ...) error
- func (plot Plot) DrawLine(p1, p2 image.Point, rect image.Rectangle, col color.RGBA)
- func (plot Plot) DrawSamples(samples []scope.Voltage, traceParams scope.TraceParams, rect image.Rectangle, ...) error
- func (plot Plot) Fill(col color.RGBA)
Constants ¶
const ( // DivRows specifies the number of horizontal rows, where each row spans an // identical distance expressed in volts. DivRows = 8 // DivCols specifies of vertical columns, where each column spans an // idential duration of time. DivCols = 10 )
Variables ¶
var ( ColorWhite = color.RGBA{255, 255, 255, 255} ColorBlack = color.RGBA{0, 0, 0, 255} ColorRed = color.RGBA{255, 0, 0, 255} ColorGreen = color.RGBA{0, 200, 0, 255} ColorBlue = color.RGBA{0, 0, 255, 255} ColorPurple = color.RGBA{255, 0, 255, 255} ColorYellow = color.RGBA{255, 255, 0, 255} ColorGrey = color.RGBA{200, 200, 200, 255} )
Commonly used color values.
Functions ¶
func DrawOver ¶
DrawOver copies opaque pixels of src onto dst into the same positions, effectively drawing over the dst. DrawOver panics if dst and src are not of the same dimensions. DrawOver handles the alpha channel only in the most simplified way. For complex drawing operations, use image/draw package instead.
func LinearInterpolator ¶
LinearInterpolator estimates the values of the points using linear segments joining neihbouring points
func PlotToPng ¶
func PlotToPng(dev scope.Device, width, height int, traceParams map[scope.ChanID]scope.TraceParams, cols map[scope.ChanID]color.RGBA, outputFile string) error
PlotToPng creates a plot of the samples from the device and saves it as PNG.
func SincInterpolator ¶
SincInterpolator uses Fourier series for interpolation
func SincZeroPadInterpolator ¶
SincZeroPadInterpolator uses Fourier series for interpolation and adds zeros to the input samples to make sure their number is a power of 2
Types ¶
type Interpolator ¶
Interpolator constructs new data points within the range of a set of known data points
type Plot ¶
Plot represents the entire plotting area.
func CreatePlot ¶
func CreatePlot(dev scope.Device, width, height int, traceParams map[scope.ChanID]scope.TraceParams, cols map[scope.ChanID]color.RGBA) (Plot, error)
CreatePlot plots samples from the device.
func (Plot) DrawAll ¶
func (plot Plot) DrawAll(data []scope.ChannelData, traceParams map[scope.ChanID]scope.TraceParams, cols map[scope.ChanID]color.RGBA) error
DrawAll draws samples from all the channels in the plot.
func (Plot) DrawFromDevice ¶
func (plot Plot) DrawFromDevice(dev scope.Device, traceParams map[scope.ChanID]scope.TraceParams, cols map[scope.ChanID]color.RGBA) error
DrawFromDevice draws samples from the device in the plot.
func (Plot) DrawLine ¶
DrawLine draws a straight line from pixel p1 to p2. Only the line fragment inside the image rectangle defined by starting (upper left) and ending (lower right) pixel is drawn.