public PointF GetPointCentroid(ISpectralPoint point) { var centerX = point.Seconds.Center(); var centerY = point.Hertz.Center(); return(new PointF( (float)this.TemporalScale.To(centerX), (float)this.SpectralScale.To(centerY))); }
public RectangleF GetPixelRectangle(ISpectralPoint point) { // todo: optimise return(new RectangleF( (float)this.TemporalScale.To(point.Seconds.Minimum), (float)this.SpectralScale.To(point.Hertz.Maximum), (float)this.TemporalScale.ToMagnitude(point.Seconds.Size()), (float)this.SpectralScale.ToMagnitude(point.Hertz.Size()))); }
public PointF GetPoint(ISpectralPoint point) { // TODO: this should probably be rounded // and rounding operation should be _round_ rather than truncate or ceiling // because we want the point to be in the "center" of the point even if an // image's dimensions change. return(new PointF( (float)this.TemporalScale.To(point.Seconds.Minimum), (float)this.SpectralScale.To(point.Hertz.Maximum))); }
public bool Equals([AllowNull] ISpectralPoint other) { return(this.Seconds.Equals(other?.Seconds) && this.Hertz.Equals(other?.Hertz) && this.Value.Equals(other?.Value)); }