other ¶
Classes:
-
Dar–A Fraction representing the Display Aspect Ratio.
-
Sar–A Fraction representing the Sample Aspect Ratio.
Dar ¶
Bases: Fraction
A Fraction representing the Display Aspect Ratio.
This represents the dimensions of the physical display used to view the image. For more information, see https://en.wikipedia.org/wiki/Display_aspect_ratio.
Methods:
-
from_clip–Get the DAR from the specified clip and SAR.
-
from_res–Get the DAR from the specified dimensions and SAR.
-
to_sar–Convert the DAR to a SAR object.
from_clip classmethod ¶
Get the DAR from the specified clip and SAR.
Parameters:
-
(clip¶VideoNode) –Clip or frame that holds the frame properties.
-
(sar¶bool, default:True) –Whether to use SAR metadata.
Returns:
-
Self–A DAR object created using the specified clip and SAR.
Source code in vstools/enums/other.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 | |
from_res classmethod ¶
Get the DAR from the specified dimensions and SAR.
Parameters:
-
(width¶int) –The width of the image.
-
(height¶int) –The height of the image.
-
(sar¶Fraction | Literal[False], default:False) –The SAR object. Optional.
Returns:
-
Self–A DAR object created using the specified dimensions and SAR.
Source code in vstools/enums/other.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | |
to_sar ¶
Convert the DAR to a SAR object.
Parameters:
-
(active_area¶int | Fraction) –The active image area. For more information, see
Sar.from_ar. -
(height¶int) –The height of the image.
Returns:
-
Sar–A SAR object created using the DAR.
Source code in vstools/enums/other.py
56 57 58 59 60 61 62 63 64 65 66 67 68 | |
Sar ¶
Bases: Fraction
A Fraction representing the Sample Aspect Ratio.
This represents the aspect ratio of the pixels or samples of an image. It may also be known as the Pixel Aspect Ratio in certain scenarios. For more information, see https://en.wikipedia.org/wiki/Pixel_aspect_ratio.
Methods:
-
apply–Apply the SAR values as _SARNum and _SARDen frame properties to a clip.
-
from_ar–Calculate the SAR using a DAR object & active area. See
Dar.to_sarfor more information. -
from_clip–Get the SAR from the clip's frame properties.
apply ¶
apply(clip: VideoNode) -> VideoNode
Apply the SAR values as _SARNum and _SARDen frame properties to a clip.
Source code in vstools/enums/other.py
115 116 117 118 119 120 | |
from_ar classmethod ¶
Calculate the SAR using a DAR object & active area. See Dar.to_sar for more information.
For a list of known standards, refer to the following tables: <https://docs.google.com/spreadsheets/d/1pzVHFusLCI7kys2GzK9BTk3w7G8zcLxgHs3DMsurF7g>_
Parameters:
-
(active_area¶int | Fraction) –The active image area.
-
(height¶int) –The height of the image.
-
(dar¶Fraction) –The DAR object.
Returns:
-
Self–A SAR object created using DAR and active image area information.
Source code in vstools/enums/other.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | |
from_clip classmethod ¶
from_clip(clip: HoldsPropValue) -> Self
Get the SAR from the clip's frame properties.
Parameters:
-
(clip¶HoldsPropValue) –Clip or frame that holds the frame properties.
Returns:
-
Self–A SAR object of the SAR properties from the given clip.
Source code in vstools/enums/other.py
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | |