Package jexer.backend
Interface SixelEncoder
-
- All Known Implementing Classes:
HQSixelEncoder
,LegacySixelEncoder
public interface SixelEncoder
SixelEncoder turns a BufferedImage into String of sixel image data.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
clearPalette()
Clear the sixel palette.void
emitPalette(java.lang.StringBuilder sb)
If the palette is shared for the entire terminal, emit it to a StringBuilder.int
getPaletteSize()
Get the number of colors in the sixel palette.boolean
hasSharedPalette()
Get the sixel shared palette option.void
reloadOptions()
Reload options from System properties.void
setPaletteSize(int paletteSize)
Set the number of colors in the sixel palette.void
setSharedPalette(boolean sharedPalette)
Set the sixel shared palette option.java.lang.String
toSixel(java.awt.image.BufferedImage bitmap)
Create a sixel string representing a bitmap.
-
-
-
Method Detail
-
reloadOptions
void reloadOptions()
Reload options from System properties.
-
toSixel
java.lang.String toSixel(java.awt.image.BufferedImage bitmap)
Create a sixel string representing a bitmap. The returned string does NOT include the DCS start or ST end sequences.- Parameters:
bitmap
- the bitmap data- Returns:
- the string to emit to an ANSI / ECMA-style terminal
-
emitPalette
void emitPalette(java.lang.StringBuilder sb)
If the palette is shared for the entire terminal, emit it to a StringBuilder.- Parameters:
sb
- the StringBuilder to write the shared palette to
-
hasSharedPalette
boolean hasSharedPalette()
Get the sixel shared palette option.- Returns:
- true if all sixel output is using the same palette that is set in one DCS sequence and used in later sequences
-
setSharedPalette
void setSharedPalette(boolean sharedPalette)
Set the sixel shared palette option.- Parameters:
sharedPalette
- if true, then all sixel output will use the same palette that is set in one DCS sequence and used in later sequences
-
getPaletteSize
int getPaletteSize()
Get the number of colors in the sixel palette.- Returns:
- the palette size
-
setPaletteSize
void setPaletteSize(int paletteSize)
Set the number of colors in the sixel palette.- Parameters:
paletteSize
- the new palette size
-
clearPalette
void clearPalette()
Clear the sixel palette. It will be regenerated on the next image encode.
-
-