GstVideo.VideoMetaTransformMatrix¶
Fields¶
Name |
Type |
Access |
Description |
|---|---|---|---|
in_info |
r/w |
the input |
|
in_rectangle |
r/w |
the input |
|
matrix |
[ |
r/w |
a 3x3 matrix representing an homographic transformation |
out_info |
r/w |
the output |
|
out_rectangle |
r/w |
the output |
Methods¶
class |
|
|
|
|
|
|
|
|
|
|
Details¶
- class GstVideo.VideoMetaTransformMatrix¶
Extra data passed to a video transform
Gst.MetaTransformFunctionsuch as: “gst-video-matrix”.The matrix represents a transformation that is applied to the content of in_rectangle, and its output is put inside out_rectangle. The coordinate system has it’s (0, 0) in the top-left corner of the rectangles and goes down and right from there..
It’s a programming error to have a singular matrix.
New in version 1.28.
- classmethod get_quark()[source]¶
- Returns:
a #GQuark
- Return type:
Get the #GQuark for the “gst-video-matrix” metadata transform operation.
New in version 1.28.
- init(in_info, in_rectangle, out_info, out_rectangle)[source]¶
- Parameters:
in_info (
GstVideo.VideoInfo) – TheGstVideo.VideoInfoof the input imagein_rectangle (
GstVideo.VideoRectangle) – the inputGstVideo.VideoRectangleout_info (
GstVideo.VideoInfo) – the outputGstVideo.VideoInfoout_rectangle (
GstVideo.VideoRectangle) – the outputGstVideo.VideoRectangle
Based on the rectangles, initializes the matrix to do a translation and scaling from in_rectangle to out_rectangle
New in version 1.28.
- point(x, y)[source]¶
- Parameters:
- Returns:
Falseif the point is outside of self.out_rectangle after the transformation has been applied- Return type:
Transforms the (x, y) point from the input coordinates to the output ones. The point’s coordinates are transformed by first applying the self.matrix to it using the top left (x, y) of self.in_rectangle as the origin, then translate it to use the top-left of self.out_rectangle as new origin.
New in version 1.28.
- point_clipped(x, y)[source]¶
- Parameters:
- Returns:
Falseif the point is outside of self.out_rectangle after the transformation has been applied- Return type:
Transforms the (x, y) point from the input coordinates to the output ones. The point’s coordinates are transformed by first applying the self.matrix to it using the top left (x, y) of self.in_rectangle as the origin, then translate it to use the top-left of self.out_rectangle as new origin.
New in version 1.28.
- rectangle(rect)[source]¶
- Parameters:
rect (
GstVideo.VideoRectangle) – a rectangle in the coordinate of the original image- Returns:
Falseis the output rectangle is not axis aligned- rect:
a rectangle in the coordinate of the original image
- Return type:
(
bool, rect:GstVideo.VideoRectangle)
Transforms rect from the input coordinates to the output ones. The point’s coordinates are transformed by first applying the self.matrix to it using the top left (x, y) of self.in_rectangle as the origin, then translate it to use the top-left of self.out_rectangle as new origin.
rect is always axis aligned at input and this function only returns axis aligned rectangles as output, otherwise it returns
False.Output rectangle could be in partially or totally outside of self.out_rectangle.
New in version 1.28.
- rectangle_clipped(rect)[source]¶
- Parameters:
rect (
GstVideo.VideoRectangle) – a rectangle in the coordinate of the original image- Returns:
Falseif the output rectangle is not axis aligned or if the rectangle is entirely outside of the out_rectangle.- rect:
a rectangle in the coordinate of the original image
- Return type:
(
bool, rect:GstVideo.VideoRectangle)
Transforms rect from the input coordinates to the output ones. The point’s coordinates are transformed by first applying the self.matrix to it using the top left (x, y) of self.in_rectangle as the origin, then translate it to use the top-left of self.out_rectangle as new origin.
rect is always axis aligned at input and this function only returns axis aligned rectangles as output, otherwise it returns
False.Output rectangle will be clipped to fit inside self.out_rectangle.
New in version 1.28.