Warning: session_start(): open(/var/lib/php/sessions/sess_ge9odcok94e8tm4um66kphstc9, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
sclass G22SnPSelector > MetaWithChangeListeners is Swingable {
settable new SnPSettings settings;
// show powers of two in pixelRows selector or all numbers?
settableWithVar bool powerOfTwoPixelRows = true;
settable int maxPixelRows = 512;
JLabel lblColors;
SnPSettings get() { ret settings; }
cachedVisualize {
var colors = jspinner(settings.colors, 2, 256);
main onChange(colors, -> {
settings.colors = intFromSpinner(colors);
change();
});
var pixelRows = jListSpinner(pixelRowsList(), settings.pixelRows);
main onChange(pixelRows, -> {
settings.pixelRows = intFromSpinner(pixelRows);
change();
});
varPowerOfTwoPixelRows().onChange(->
spinnerSetNumberList(pixelRows, pixelRowsList());
var menuItem = jLiveValueCheckBoxMenuItem("Only show powers of two", varPowerOfTwoPixelRows());
swing {
new JPopupMenu menu;
menu.add(menuItem);
pixelRows.setComponentPopupMenu(menu);
}
lblColors = jSimpleLabel(" colors @ ");
bindChangeListenerToComponent(this, lblColors,
-> toolTip(lblColors, makeToolTip()));
ret hstack(
colors,
lblColors,
pixelRows,
jlabel(" p"));
}
L pixelRowsList() {
ret powerOfTwoPixelRows
? powersOfTwoUpTo(maxPixelRows)
: virtualCountList_incl(1, maxPixelRows);
}
S makeToolTip() {
long pixels = area(sixteenToNine_p(settings.pixelRows));
int colorBits = numberOfBitsNeededToRepresentNOptions(settings.colors);
int bytes = iceil_div(pixels*colorBits, 8);
ret "Information per frame: " + nBytes(bytes) +" (assuming a 16:9 aspect ratio)";
}
}