File tree Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -152,6 +152,8 @@ dovi_tool <SUBCOMMAND> --help
152
152
153
153
**Flags**:
154
154
- `-t`, `--title` The title to set at the top of the plot
155
+ - `-s`, `--start` Set frame range start
156
+ - `-e`, `--end` Set frame range end (inclusive)
155
157
156
158
**Example**:
157
159
```console
Original file line number Diff line number Diff line change @@ -33,4 +33,10 @@ pub struct PlotArgs {
33
33
34
34
#[ arg( long, short = 't' , help = "Title to use at the top" ) ]
35
35
pub title : Option < String > ,
36
+
37
+ #[ arg( long, short = 's' , help = "Set frame range start" ) ]
38
+ pub start : Option < usize > ,
39
+
40
+ #[ arg( long, short = 'e' , help = "Set frame range end (inclusive)" ) ]
41
+ pub end : Option < usize > ,
36
42
}
Original file line number Diff line number Diff line change @@ -54,6 +54,8 @@ impl Plotter {
54
54
input_pos,
55
55
output,
56
56
title,
57
+ start : start_arg,
58
+ end : end_arg,
57
59
} = args;
58
60
59
61
let output = output. unwrap_or ( PathBuf :: from ( "L1_plot.png" ) ) ;
@@ -63,7 +65,12 @@ impl Plotter {
63
65
let plotter = Plotter { input } ;
64
66
65
67
println ! ( "Parsing RPU file..." ) ;
66
- let rpus = parse_rpu_file ( plotter. input ) ?;
68
+ let orig_rpus = parse_rpu_file ( plotter. input ) ?;
69
+
70
+ // inclusive range, end must be last RPU index
71
+ let start = start_arg. unwrap_or ( 0 ) ;
72
+ let end = end_arg. unwrap_or ( orig_rpus. len ( ) - 1 ) ;
73
+ let rpus = & orig_rpus[ start..=end] ;
67
74
68
75
let x_spec = 0 ..rpus. len ( ) ;
69
76
@@ -74,7 +81,7 @@ impl Plotter {
74
81
. titled ( & title, ( "sans-serif" , 40 ) ) ?;
75
82
76
83
println ! ( "Plotting..." ) ;
77
- let summary = RpusListSummary :: new ( & rpus) ?;
84
+ let summary = RpusListSummary :: new ( rpus) ?;
78
85
79
86
let mut chart = ChartBuilder :: on ( & root)
80
87
. x_label_area_size ( 60 )
You can’t perform that action at this time.
0 commit comments