@@ -18,19 +18,30 @@ public class GuiResolutionLevelParams implements Command {
1818 @ Parameter (label = "Down-size factor in z:" , min = "1" , persist = false )
1919 public int down_z ;
2020
21- @ Parameter (label = "Block size in pixels in x:" , min = "1" , persist = false )
21+ @ Parameter (label = "Block size in pixels in x:" , min = "1" , persist = false , callback = "reportBlockSize" )
2222 public int block_x ;
23- @ Parameter (label = "Block size in pixels in y:" , min = "1" , persist = false )
23+ @ Parameter (label = "Block size in pixels in y:" , min = "1" , persist = false , callback = "reportBlockSize" )
2424 public int block_y ;
25- @ Parameter (label = "Block size in pixels in z:" , min = "1" , persist = false )
25+ @ Parameter (label = "Block size in pixels in z:" , min = "1" , persist = false , callback = "reportBlockSize" )
2626 public int block_z ;
2727
28+ @ Parameter (visibility = ItemVisibility .MESSAGE , persist = false )
29+ public String sizeMessage ;
30+ //
31+ @ Parameter (persist = false )
32+ public int pxSizeInBytes = 2 ;
33+
2834 @ Parameter (persist = false )
2935 public int resLevelNumber = 999 ;
3036
3137 @ Parameter
3238 public PrefService prefs ;
3339
40+ public void reportBlockSize () {
41+ sizeMessage = "Ideal block size is just below 1024 kB, current is "
42+ +(block_x *block_y *block_z *pxSizeInBytes /1024 )+" kB." ;
43+ }
44+
3445 public void setFromPrefs () {
3546 if (resLevelNumber == 1 ) {
3647 headerMessage = "Provide blocks size for the full resolution (base) level:" ;
@@ -45,6 +56,7 @@ public void setFromPrefs() {
4556 block_x = prefs .getInt (GuiResolutionLevelParams .class , "level" +resLevelNumber +"_block_x" , 64 );
4657 block_y = prefs .getInt (GuiResolutionLevelParams .class , "level" +resLevelNumber +"_block_y" , 64 );
4758 block_z = prefs .getInt (GuiResolutionLevelParams .class , "level" +resLevelNumber +"_block_z" , 64 );
59+ reportBlockSize ();
4860 }
4961
5062 public void storeIntoPrefs () {
0 commit comments