Kodi Documentation 23.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
TestGeometryTransforms.cpp File Reference

Functions

 TEST (TestGeometryTransforms, SquarePixelsWhenNoDisplayAspectIsDeclared)
 
 TEST (TestGeometryTransforms, AnamorphicPixelsAreWiderThanTheyAreCoded)
 
 TEST (TestGeometryTransforms, CodedRatioOfAnamorphicScopeMatchesAnUnrelatedEntry)
 
 TEST (TestGeometryTransforms, SquarePixelsAreExactWhenTheStreamAgreesWithItsCoding)
 
 TEST (TestGeometryTransforms, AStereoscopicViewCarriesItsOwnPixelAspect)
 
 TEST (TestGeometryTransforms, TheCutFollowsTheFramesOwnMeasurement)
 
 TEST (TestGeometryTransforms, WithNothingMeasuredOnTheFrameTheResolvedRectangleIsStillCut)
 
 TEST (TestGeometryTransforms, ARotatedStreamIsCutInCodedSpace)
 
 TEST (TestGeometryTransforms, WithNoResolvedRectangleTheSourceIsLeftAlone)
 With no resolved rectangle either there is nothing to cut to, and the source stands.
 
 TEST (TestGeometryTransforms, AQuarterTurnTransposesTheRectangle)
 
 TEST (TestGeometryTransforms, AnUnusableRotationIsTreatedAsUpright)
 
 TEST (TestGeometryTransforms, SideBySideSelectsOneView)
 
 TEST (TestGeometryTransforms, TopAndBottomSelectsOneView)
 
 TEST (TestGeometryTransforms, MonoAndUnknownModesAreLeftWhole)
 
 TEST (TestGeometryTransforms, TheMeasuredFrameIsOneViewOrTheWholeFrame)
 
 TEST (TestGeometryTransforms, ScaleRectReturnsAReducedReadingToCodedSpace)
 
 TEST (TestGeometryTransforms, ScaleRectRoundsToTheNearestPixel)
 
 TEST (TestGeometryTransforms, ScaleRectLeavesADegenerateSpaceAlone)
 

Function Documentation

◆ TEST() [1/18]

TEST ( TestGeometryTransforms ,
AnamorphicPixelsAreWiderThanTheyAreCoded  )

◆ TEST() [2/18]

TEST ( TestGeometryTransforms ,
AnUnusableRotationIsTreatedAsUpright  )

◆ TEST() [3/18]

TEST ( TestGeometryTransforms ,
AQuarterTurnTransposesTheRectangle  )

◆ TEST() [4/18]

TEST ( TestGeometryTransforms ,
ARotatedStreamIsCutInCodedSpace  )

A rotated stream is decoded upright and turned at draw time, so the frame's own measurement, the coded frame and the source rectangle are all in the same unrotated space. The cut has to leave them there: a quarter turn applied to it would put a letterbox crop down the sides. The ratio is the one part that does carry the rotation, answered as it leaves the picture.

◆ TEST() [5/18]

TEST ( TestGeometryTransforms ,
AStereoscopicViewCarriesItsOwnPixelAspect  )

The region and its pixel aspect are one answer, and the reason they are taken together rather than separately. A half side-by-side view is half the packing's width at the packing's display ratio, so its pixels are twice as wide - measured with the packing's pixel aspect instead, a scope picture in the view classifies as 1.2.

◆ TEST() [6/18]

TEST ( TestGeometryTransforms ,
CodedRatioOfAnamorphicScopeMatchesAnUnrelatedEntry  )

◆ TEST() [7/18]

TEST ( TestGeometryTransforms ,
MonoAndUnknownModesAreLeftWhole  )

An unrecognised mode must be left whole rather than guessed at. Halving a mono frame would report a pillarbox that is not there, and that is the direction that masks real picture.

◆ TEST() [8/18]

TEST ( TestGeometryTransforms ,
ScaleRectLeavesADegenerateSpaceAlone  )

◆ TEST() [9/18]

TEST ( TestGeometryTransforms ,
ScaleRectReturnsAReducedReadingToCodedSpace  )

The reduced-readback path detects on a small copy of the frame and returns to coded space through ScaleRect. The 2.40 rectangle of a 4K frame read at 960 wide is the case that ships: 960x540's scope rows are 70..470, and coded rows 280..1880 must come back exactly, because the vocabulary entry's own rectangle is what the selector compares against.

◆ TEST() [10/18]

TEST ( TestGeometryTransforms ,
ScaleRectRoundsToTheNearestPixel  )

◆ TEST() [11/18]

TEST ( TestGeometryTransforms ,
SideBySideSelectsOneView  )

◆ TEST() [12/18]

TEST ( TestGeometryTransforms ,
SquarePixelsAreExactWhenTheStreamAgreesWithItsCoding  )

◆ TEST() [13/18]

TEST ( TestGeometryTransforms ,
SquarePixelsWhenNoDisplayAspectIsDeclared  )

◆ TEST() [14/18]

TEST ( TestGeometryTransforms ,
TheCutFollowsTheFramesOwnMeasurement  )

The renderer cuts its source to the rectangle measured from the frame it is drawing, which is not the one the published answer describes - live detection stamps each picture with its own. The ratio comes back with it, because what the picture is scaled to has to be the shape of what was cut rather than of what was resolved.

◆ TEST() [15/18]

TEST ( TestGeometryTransforms ,
TheMeasuredFrameIsOneViewOrTheWholeFrame  )

The region a measurement describes, which everything resolving one has to be told about. StereoViewRect() answers "nothing to narrow" as an empty rectangle, and an empty rectangle used as a frame is a frame with no picture in it - so the fallback belongs with the rule rather than at each of the places that needs it.

◆ TEST() [16/18]

TEST ( TestGeometryTransforms ,
TopAndBottomSelectsOneView  )

◆ TEST() [17/18]

TEST ( TestGeometryTransforms ,
WithNoResolvedRectangleTheSourceIsLeftAlone  )

With no resolved rectangle either there is nothing to cut to, and the source stands.

◆ TEST() [18/18]

TEST ( TestGeometryTransforms ,
WithNothingMeasuredOnTheFrameTheResolvedRectangleIsStillCut  )

Live detection off, or no reading taken yet. The published answer still stands, so the source is cut to the rectangle the resolver settled on - returning it uncut while reporting the resolved ratio would leave the coded bars on screen and then scale the picture as though they had been removed, which squashes it by the difference between the two shapes.