Functions Index :: J :: JointPixelType
Module:
Definition:
JointPixelType(string clips, bool "lowercase")
Description:
Returns the most common (ie with maximum occurence) pixel type of a clip array.
The function first honors total RGB/YUV occurence and then specific occurences of RGB/YUV subtypes.
In addition, when equal number of specific RGB/YUV subtypes is encountered, it favors YV12 over YUY2 and RGB32 over RGB24, as well as YUY2 over RGB32 (when total RGB == total YUV).
Thus:
- If most clips are in RGB/YUV it returns the RGB/YUV pixel_type with the maximum occurence (favoring YV12 and RGB32 when YUV/RGB subtypes' occurences are equal in number).
- If RGB clips == YUV clips, the specific subtype with the maximum occurence is returned (favoring by this order: YV12 > YUY2 > RGB32 > RGB24 when all subtypes have the same occurence).
Arguments:
clips: The clip array.
lowercase (Optional, defaults to false): If true then the returned string is in lowercase.
Examples:
# assuming ar is a clip array with 3 RGB32, 1 RGB24
# and 3YUY2 clips (7 clips in total):
pt = JointPixelType(ar) # pt == "RGB32"
# assuming ar2 is a clip array with 3 RGB32, 1 RGB24
# 2 YV12 and 3 YUY2 clips (9 clips in total):
pt2 = JointPixelType(ar2) # pt2 == "YUY2"
# assuming ar3 is a clip array with 3 RGB32, 1 RGB24
# 3 YV12 and 1 YUY2 clips (8 clips in total):
pt3 = JointPixelType(ar3) # pt3 == "YV12"
# assuming ar4 is a clip array with 3 RGB32, 1 RGB24
# 2 YV12 and 2 YUY2 clips (8 clips in total):
pt4 = JointPixelType(ar4) # pt4 == "RGB32"