@@ -33,16 +33,14 @@ int main(int argc, char** argv)
3333{
3434 cxxopts::Options options (" cimbar video encoder" , " Draw a bunch of weird static on the screen!" );
3535
36- unsigned colorBits = cimbar::Config::color_bits ();
3736 unsigned compressionLevel = cimbar::Config::compression_level ();
38- unsigned ecc = cimbar::Config::ecc_bytes ();
3937 unsigned defaultFps = 15 ;
38+ unsigned defaultPadding = 32 ;
4039 options.add_options ()
4140 (" i,in" , " Source file" , cxxopts::value<vector<string>>())
42- (" c,colorbits" , " Color bits. [0-3]" , cxxopts::value<int >()->default_value (turbo::str::str (colorBits)))
43- (" e,ecc" , " ECC level" , cxxopts::value<unsigned >()->default_value (turbo::str::str (ecc)))
4441 (" f,fps" , " Target FPS" , cxxopts::value<unsigned >()->default_value (turbo::str::str (defaultFps)))
45- (" m,mode" , " Select a cimbar mode. B is new to 0.6.x. 4C is the 0.5.x config. [B,Bm,Bu,4C]" , cxxopts::value<string>()->default_value (" 4C" ))
42+ (" m,mode" , " Select a cimbar mode. B modes are new to 0.6.x. 4C is the 0.5.x config. [B,Bm,Bu,4C]" , cxxopts::value<string>()->default_value (" B" ))
43+ (" p,padding" , " Black padding around image in pixels." , cxxopts::value<unsigned >()->default_value (turbo::str::str (defaultPadding)))
4644 (" z,compression" , " Compression level. 0 == no compression." , cxxopts::value<int >()->default_value (turbo::str::str (compressionLevel)))
4745 (" h,help" , " Print usage" )
4846 ;
@@ -58,10 +56,7 @@ int main(int argc, char** argv)
5856 }
5957
6058 vector<string> infiles = result[" in" ].as <vector<string>>();
61-
62- colorBits = std::min (3 , result[" colorbits" ].as <int >());
6359 compressionLevel = result[" compression" ].as <int >();
64- ecc = result[" ecc" ].as <unsigned >();
6560
6661 unsigned config_mode = 68 ;
6762 if (result.count (" mode" ))
@@ -74,20 +69,25 @@ int main(int argc, char** argv)
7469 else if (mode == " Bm" or mode == " BM" )
7570 config_mode = 67 ;
7671 }
72+ cimbar::Config::update (config_mode);
73+
74+ unsigned padding = result[" padding" ].as <unsigned >();
75+ if (padding == 0 )
76+ padding = defaultPadding;
7777
7878 unsigned fps = result[" fps" ].as <unsigned >();
7979 if (fps == 0 )
8080 fps = defaultFps;
8181 unsigned delay = 1000 / fps;
8282
83- int window_size_x = cimbar::Config::image_size_x () + 32 ;
84- int window_size_y = cimbar::Config::image_size_y () + 32 ;
83+ int window_size_x = cimbar::Config::image_size_x ();
84+ int window_size_y = cimbar::Config::image_size_y ();
8585 if (cimbare_init_window (window_size_x, window_size_y) < 0 )
8686 {
8787 std::cerr << " failed to create window :(" << std::endl;
8888 return 70 ;
8989 }
90- cimbare_auto_scale_window ();
90+ cimbare_auto_scale_window (padding );
9191 cimbare_configure (config_mode, compressionLevel);
9292
9393 std::chrono::time_point start = std::chrono::high_resolution_clock::now ();
0 commit comments