mirror of
https://gitlab.com/AutumnMeowMeow/jexer
synced 2024-09-19 11:50:19 -06:00
Allow use of direct-map if sampling would have touched all pixels
This commit is contained in:
parent
952c4dd243
commit
b26fc17e42
1 changed files with 4 additions and 1 deletions
|
@ -705,7 +705,10 @@ public class HQSixelEncoder implements SixelEncoder {
|
|||
// Sample the colors. We will be taking SAMPLE_SIZE'd pixel
|
||||
// bands uniformly through the image data, with numColors bands.
|
||||
final int SAMPLE_SIZE = 16;
|
||||
int stride = Math.max(0, totalPixels / numColors);
|
||||
int stride = 0;
|
||||
if (totalPixels > SAMPLE_SIZE * numColors) {
|
||||
stride = Math.max(0, totalPixels / numColors);
|
||||
}
|
||||
if (verbosity >= 1) {
|
||||
System.err.printf("Sampling %d pixels per color stride=%d\n",
|
||||
SAMPLE_SIZE, stride);
|
||||
|
|
Loading…
Reference in a new issue