Grid¶
mg_grid ¶
mg_grid(self, height=300, rows=3, columns=3, padding=0, margin=0, target_name=None, overwrite=True, return_array=False)
Generates frame strip video preview using ffmpeg.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
height
|
int
|
Frame height, width is adjusted automatically to keep the correct aspect ratio. Defaults to 300. |
300
|
rows
|
int
|
Number of rows of the grid. Defaults to 3. |
3
|
columns
|
int
|
Number of columns of the grid. Defaults to 3. |
3
|
padding
|
int
|
Padding size between the frames. Defaults to 0. |
0
|
margin
|
int
|
Margin size for the grid. Defaults to 0. |
0
|
target_name
|
[type]
|
Target output name for the grid image. Defaults to None. |
None
|
overwrite
|
bool
|
Whether to allow overwriting existing files or to automatically increment target filenames to avoid overwriting. Defaults to True. |
True
|
return_array
|
bool
|
Whether to return an array of not. If set to False the function writes the grid image to disk. Defaults to False. |
False
|
Returns:
| Name | Type | Description |
|---|---|---|
MgImage |
An MgImage object referring to the internal grid image. |
Source code in musicalgestures/_grid.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | |