Skip to content

PolygonMitchellNetravali

Overview

Mitchell-Netravali filter (B=⅓, C=⅓ ) contribution given a polygon

@author Jonathan Olson <jonathan.olson@colorado.edu>

Class PolygonMitchellNetravali

import { PolygonMitchellNetravali } from 'scenerystack/alpenglow';

Static Methods

evaluateFull( pointX : number, pointY : number, minX : number, minY : number ) : number

evaluateLinearEdges( edges : LinearEdge[], pointX : number, pointY : number, minX : number, minY : number ) : number

Evaluates the contribution of the (clipped) polygon to the filter at the given point. minX/minY note the lower coordinates of the clipped polygon unit pixel.

evaluatePolygons( polygons : Vector2[][], pointX : number, pointY : number, minX : number, minY : number ) : number

Evaluates the contribution of the (clipped) polygon to the filter at the given point. minX/minY note the lower coordinates of the clipped polygon unit pixel.

evaluateFilter( t : number ) : number

Evaluates the 1-dimensional Mitchell-Netravali filter at the given point. Outside -2<=t<=2, the filter will be zero.

NOTE: It is a separable filter, so if you need the 2D equivalent, just do evaluateFilter( x ) * evaluateFilter( y )

evaluate( polygon : Vector2[], point : Vector2 ) : number

evaluateCase00( p0x : number, p0y : number, p1x : number, p1y : number ) : number

evaluateCase10( p0x : number, p0y : number, p1x : number, p1y : number ) : number

evaluateCase11( p0x : number, p0y : number, p1x : number, p1y : number ) : number

Static Properties

full00

Values for the three cases, if presented with a full "pixel", e.g. PolygonMitchellNetravali.evaluateCase00( 0, 0, 1, 0 ) + PolygonMitchellNetravali.evaluateCase00( 1, 0, 1, 1 ) + PolygonMitchellNetravali.evaluateCase00( 1, 1, 0, 1 ) + PolygonMitchellNetravali.evaluateCase00( 0, 1, 0, 0 ) 0.2640817901234568 PolygonMitchellNetravali.evaluateCase10( 1, 0, 2, 0 ) + PolygonMitchellNetravali.evaluateCase10( 2, 0, 2, 1 ) + PolygonMitchellNetravali.evaluateCase10( 2, 1, 1, 1 ) + PolygonMitchellNetravali.evaluateCase10( 1, 1, 1, 0 ) -0.007137345679012345 PolygonMitchellNetravali.evaluateCase11( 1, 1, 2, 1 ) + PolygonMitchellNetravali.evaluateCase11( 2, 1, 2, 2 ) + PolygonMitchellNetravali.evaluateCase11( 2, 2, 1, 2 ) + PolygonMitchellNetravali.evaluateCase11( 1, 2, 1, 1 ) 0.0001929012345679021

full10

full11

Source Code

See the source for PolygonMitchellNetravali.ts in the alpenglow repository.