org.refcodes.mixin.ColumnWidthAccessor
, org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthBuilder<AsciiArtBuilder>
, org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthMutator
, org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthProperty
, FontAccessor
, FontAccessor.FontBuilder<AsciiArtBuilder>
, FontAccessor.FontMutator
, FontAccessor.FontProperty
, FontFamilyAccessor
, FontFamilyAccessor.FontFamilyBuilder<AsciiArtBuilder>
, FontFamilyAccessor.FontFamilyMutator
, FontFamilyAccessor.FontFamilyProperty
, FontNameAccessor
, FontNameAccessor.FontNameBuilder<AsciiArtBuilder>
, FontNameAccessor.FontNameMutator
, FontNameAccessor.FontNameProperty
, FontSizeAccessor
, FontSizeAccessor.FontSizeBuilder<AsciiArtBuilder>
, FontSizeAccessor.FontSizeMutator
, FontSizeAccessor.FontSizeProperty
, FontStyleAccessor
, FontStyleAccessor.FontStyleBuilder<AsciiArtBuilder>
, FontStyleAccessor.FontStyleMutator
, FontStyleAccessor.FontStyleProperty
, Text<AsciiArtBuilder>
, TextAccessor
, TextAccessor.TextBuilder<AsciiArtBuilder>
, TextAccessor.TextMutator
, TextAccessor.TextProperty
, TextAccessor.TextProvider
public class AsciiArtBuilder extends Object implements Text<AsciiArtBuilder>, FontAccessor.FontProperty, FontAccessor.FontBuilder<AsciiArtBuilder>, FontFamilyAccessor.FontFamilyProperty, FontFamilyAccessor.FontFamilyBuilder<AsciiArtBuilder>, FontStyleAccessor.FontStyleProperty, FontStyleAccessor.FontStyleBuilder<AsciiArtBuilder>, FontSizeAccessor.FontSizeProperty, FontSizeAccessor.FontSizeBuilder<AsciiArtBuilder>, FontNameAccessor.FontNameProperty, FontNameAccessor.FontNameBuilder<AsciiArtBuilder>, org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthBuilder<AsciiArtBuilder>, org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthProperty
AsciiArtBuilder
is represented by an array of
String
instances "visualizing" a given text (rendered with the given
Font
) or image as so called ASCII_HEADER_ASCII_BODY art.
ASCII_HEADER_ASCII_BODY characters are used as "pixels" when "paining" the
text or image into the String
array. Different
ASCII_HEADER_ASCII_BODY characters represent different levels of brightness
for a "pixel".org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthBuilder<B extends org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthBuilder<B>>, org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthMutator, org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthProperty
FontAccessor.FontBuilder<B extends FontAccessor.FontBuilder<B>>, FontAccessor.FontMutator, FontAccessor.FontProperty
FontFamilyAccessor.FontFamilyBuilder<B extends FontFamilyAccessor.FontFamilyBuilder<B>>, FontFamilyAccessor.FontFamilyMutator, FontFamilyAccessor.FontFamilyProperty
FontNameAccessor.FontNameBuilder<B extends FontNameAccessor.FontNameBuilder<B>>, FontNameAccessor.FontNameMutator, FontNameAccessor.FontNameProperty
FontSizeAccessor.FontSizeBuilder<B extends FontSizeAccessor.FontSizeBuilder<B>>, FontSizeAccessor.FontSizeMutator, FontSizeAccessor.FontSizeProperty
FontStyleAccessor.FontStyleBuilder<B extends FontStyleAccessor.FontStyleBuilder<B>>, FontStyleAccessor.FontStyleMutator, FontStyleAccessor.FontStyleProperty
TextAccessor.TextBuilder<B extends TextAccessor.TextBuilder<B>>, TextAccessor.TextMutator, TextAccessor.TextProperty, TextAccessor.TextProvider
Constructor | Description |
---|---|
AsciiArtBuilder() |
Modifier and Type | Method | Description |
---|---|---|
static String[] |
asAsciiArt(int aWidth,
Font aFont,
AsciiArtMode aAsciiArtMode,
char[] aPalette,
String... aLines) |
Produces ASCII-Art from the provided arguments.
|
static String[] |
asAsciiArt(int aWidth,
Font aFont,
AsciiArtMode aAsciiArtMode,
String[] aLines,
char... aPalette) |
Produces ASCII-Art from the provided arguments.
|
static String[] |
asAsciiArt(File aImageFile,
int aWidth,
AsciiArtMode aAsciiArtMode,
PixmapRatioMode aPixmapRatioMode,
char... aPalette) |
Produces ASCII-Art from the provided arguments.
|
static String[] |
asAsciiArt(String aText,
int aWidth,
Font aFont,
AsciiArtMode aAsciiArtMode,
char... aPalette) |
Produces ASCII-Art from the provided arguments.
|
static String[] |
asAsciiArt(org.refcodes.graphical.RgbPixmap aPixmap,
int aWidth,
AsciiArtMode aAsciiArtMode,
PixmapRatioMode aPixmapRatioMode,
char... aPalette) |
Produces ASCII-Art from the provided arguments.
|
static String[] |
asSimpleBanner(String aText,
int aWidth,
AsciiArtMode aAsciiArtMode,
char... aPalette) |
Fallback in case creating the ASCII-Art banner failed (can happen in the
GraalVM with poor AWT support for rendering fonts.
|
AsciiArtMode |
getAsciiArtMode() |
Retrieves the ASCII-Art mode from the ASCII-Art mode property.
|
org.refcodes.data.AsciiColorPalette |
getAsciiColorPalette() |
Retrieves the ASCII_HEADER_ASCII_BODY color palette from the
ASCII_HEADER_ASCII_BODY color palette property.
|
char[] |
getAsciiColors() |
Retrieves the ASCII_HEADER_ASCII_BODY colors from the
ASCII_HEADER_ASCII_BODY colors property.
|
int |
getColumnWidth() |
|
Font |
getFont() |
Retrieves the font from the font property.
|
FontFamily |
getFontFamily() |
Retrieves the font family from the font family property.
|
String |
getFontName() |
Retrieves the font name from the font name property.
|
int |
getFontSize() |
Retrieves the font style from the font style property.
|
FontStyle |
getFontStyle() |
Retrieves the font style from the font style property.
|
PixmapRatioMode |
getPixmapRatioMode() |
Retrieves the
Pixmap ratio mode from the Pixmap ratio
mode property. |
org.refcodes.graphical.RgbPixmap |
getRgbPixmap() |
Retrieves the
Pixmap from the Pixmap property. |
String[] |
getText() |
Retrieves the text from the text property.
|
void |
setAsciiArtMode(AsciiArtMode aAsciiArtMode) |
Sets the ASCII-Art mode for the ASCII_HEADER_ASCII_BODY art mode
property.
|
void |
setAsciiColorPalette(org.refcodes.data.AsciiColorPalette aAsciiColorPalette) |
Sets the ASCII_HEADER_ASCII_BODY color palette for the
ASCII_HEADER_ASCII_BODY color palette property.
|
void |
setAsciiColors(char... aAsciiColors) |
Sets the ASCII_HEADER_ASCII_BODY colors for the ASCII_HEADER_ASCII_BODY
colors property.
|
void |
setAsciiColors(String aAsciiColors) |
Sets the ASCII_HEADER_ASCII_BODY colors for the ASCII_HEADER_ASCII_BODY
colors property.
|
void |
setColumnWidth(int aColumnWidth) |
|
void |
setFont(Font aFont) |
Sets the font for the font property.
|
void |
setFontFamily(FontFamily aFontName) |
Sets the font family for the font family property.
|
void |
setFontName(String aFontName) |
Sets the font name for the font name property.
|
void |
setFontSize(int aFontSize) |
Sets the font style for the font style property.
|
void |
setFontStyle(FontStyle aFontStyle) |
Sets the font style for the font style property.
|
void |
setImageFile(File aImageFile) |
Sets the image file for the
Pixmap property. |
void |
setPixmapRatioMode(PixmapRatioMode aPixmapRatioMode) |
Sets the
Pixmap ratio mode for the Pixmap ratio mode
property. |
void |
setRgbPixmap(org.refcodes.graphical.RgbPixmap aPixmap) |
Sets the
Pixmap for the Pixmap property. |
void |
setText(String... aText) |
Sets the text for the text property.
|
protected static char |
toAscii(int aRgbValue) |
Converts an RGB value to an ASCII_HEADER_ASCII_BODY character from a
palette if characters as provided.
|
protected static char |
toAscii(int aRgbValue,
char[] aPalette) |
Converts an RGB value to an ASCII_HEADER_ASCII_BODY character from a
palette if characters as provided.
|
protected static String[] |
toAsciiArt(String aText,
int aWidth,
String aFontName,
int aFontStyle) |
|
protected static String[] |
toAsciiArt(String aText,
int aWidth,
String aFontName,
int aFontStyle,
char[] aPalette) |
|
protected static String[] |
toAsciiArt(String aText,
int aWidth,
Font aFont,
char[] aPalette) |
|
protected static String[] |
toAsciiArt(String aText,
Font aFont) |
|
protected static String[] |
toAsciiArt(String aText,
Font aFont,
char[] aPalette) |
|
protected static String[] |
toAsciiArt(org.refcodes.graphical.RgbPixmap aPixmap,
char[] aPalette) |
To ascii art.
|
protected static String[] |
toInverseAsciiArt(String aText,
int aWidth,
String aFontName,
int aFontStyle) |
Same as
toAsciiArt(org.refcodes.graphical.RgbPixmap,char[]) with inverted colors (black = white, dark =
bright, bright = dark, white = black). |
protected static String[] |
toInverseAsciiArt(String aText,
int aWidth,
String aFontName,
int aFontStyle,
char[] aPalette) |
Same as
toAsciiArt(org.refcodes.graphical.RgbPixmap,char[]) with inverted colors (black = white, dark =
bright, bright = dark, white = black). |
protected static String[] |
toInverseAsciiArt(String aText,
int aWidth,
Font aFont,
char[] aPalette) |
Same as
toAsciiArt(org.refcodes.graphical.RgbPixmap,char[]) with inverted colors (black = white, dark =
bright, bright = dark, white = black). |
protected static String[] |
toInverseAsciiArt(String aText,
Font aFont) |
Same as
toAsciiArt(org.refcodes.graphical.RgbPixmap,char[]) with inverted colors (black = white, dark =
bright, bright = dark, white = black). |
protected static String[] |
toInverseAsciiArt(String aText,
Font aFont,
char[] aPalette) |
Same as
toAsciiArt(org.refcodes.graphical.RgbPixmap,char[]) with inverted colors (black = white, dark =
bright, bright = dark, white = black). |
protected static String[] |
toInverseAsciiArt(org.refcodes.graphical.RgbPixmap aPixmap,
char[] aPalette) |
To inverse ascii art.
|
String |
toString() |
The
String being build by the builder upon the settings of
the attributes. |
String |
toString(String... aText) |
Race condition safe shortcut for using
Text.withText(String...)
followed by TextAccessor.TextProvider.toString() . |
String |
toString(File aImageFile) |
Race condition safe shortcut for using
withImageFile(File)
followed by toString() . |
String |
toString(org.refcodes.graphical.RgbPixmap aPixmap) |
Race condition safe shortcut for using
withRgbPixmap(RgbPixmap)
followed by toString() . |
String[] |
toStrings() |
The
String s being build by the builder upon the settings of
the attributes. |
String[] |
toStrings(File aImageFile) |
Race condition safe shortcut for using
withImageFile(File)
followed by toStrings() . |
String[] |
toStrings(String... aText) |
Race condition safe shortcut for using
Text.withText(String...)
followed by TextAccessor.TextProvider.toStrings() . |
String[] |
toStrings(org.refcodes.graphical.RgbPixmap aPixmap) |
Race condition safe shortcut for using
withRgbPixmap(RgbPixmap)
followed by toStrings() . |
AsciiArtBuilder |
withAsciiArtMode(AsciiArtMode aAsciiArtMode) |
Sets the ASCII-Art mode for the ASCII_HEADER_ASCII_BODY art mode
property.
|
AsciiArtBuilder |
withAsciiColorPalette(org.refcodes.data.AsciiColorPalette aAsciiColorPalette) |
Sets the ASCII_HEADER_ASCII_BODY color palette for the
ASCII_HEADER_ASCII_BODY color palette property.
|
AsciiArtBuilder |
withAsciiColors(char... aAsciiColors) |
Sets the ASCII_HEADER_ASCII_BODY colors for the ASCII_HEADER_ASCII_BODY
colors property.
|
AsciiArtBuilder |
withAsciiColors(String aAsciiColors) |
Sets the ASCII_HEADER_ASCII_BODY colors for the ASCII_HEADER_ASCII_BODY
colors property.
|
AsciiArtBuilder |
withColumnWidth(int aColumnWidth) |
|
AsciiArtBuilder |
withFont(Font aFont) |
Sets the font for the font property.
|
AsciiArtBuilder |
withFontFamily(FontFamily aFontName) |
Sets the font family for the font family property.
|
AsciiArtBuilder |
withFontName(String aFontName) |
Sets the font name for the font name property.
|
AsciiArtBuilder |
withFontSize(int aFontSize) |
Sets the font style for the font style property.
|
AsciiArtBuilder |
withFontStyle(FontStyle aFontStyle) |
Sets the font style for the font style property.
|
AsciiArtBuilder |
withImageFile(File aImageFile) |
Sets the image file for the
Pixmap property. |
AsciiArtBuilder |
withPixmapRatioMode(PixmapRatioMode aPixmapRatioMode) |
Sets the
Pixmap ratio mode for the Pixmap ratio mode
property. |
AsciiArtBuilder |
withRgbPixmap(org.refcodes.graphical.RgbPixmap aPixmap) |
Sets the
Pixmap for the Pixmap property. |
B |
withText(String... aText) |
With text.
|
B |
withText(Collection<String> aText) |
With text.
|
letColumnWidth
letFont
letFontFamily
letFontName
letFontSize
letFontStyle
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getText
withText
setText, setText
letText, letText
toString
public PixmapRatioMode getPixmapRatioMode()
Pixmap
ratio mode from the Pixmap
ratio
mode property.Pixmap
ratio mode stored by the Pixmap
ratio
mode property.public void setPixmapRatioMode(PixmapRatioMode aPixmapRatioMode)
Pixmap
ratio mode for the Pixmap
ratio mode
property.aPixmapRatioMode
- The Pixmap
ratio mode to be stored by the
text strip mode property.public org.refcodes.graphical.RgbPixmap getRgbPixmap()
Pixmap
from the Pixmap
property.Pixmap
stored by the Pixmap
property.public AsciiArtBuilder withColumnWidth(int aColumnWidth)
withColumnWidth
in interface org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthBuilder<AsciiArtBuilder>
public void setColumnWidth(int aColumnWidth)
setColumnWidth
in interface org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthMutator
public int getColumnWidth()
getColumnWidth
in interface org.refcodes.mixin.ColumnWidthAccessor
public Font getFont()
getFont
in interface FontAccessor
public void setFont(Font aFont)
setFont
in interface FontAccessor.FontMutator
aFont
- The font to be stored by the font property.public AsciiArtBuilder withFont(Font aFont)
withFont
in interface FontAccessor.FontBuilder<AsciiArtBuilder>
aFont
- The font to be stored by the font property.public AsciiArtMode getAsciiArtMode()
public void setAsciiArtMode(AsciiArtMode aAsciiArtMode)
aAsciiArtMode
- The ASCII-Art mode to be stored by the text strip
mode property.public char[] getAsciiColors()
public void setAsciiColors(char... aAsciiColors)
aAsciiColors
- The ASCII_HEADER_ASCII_BODY colors to be stored by
the ASCII_HEADER_ASCII_BODY colors property.public org.refcodes.data.AsciiColorPalette getAsciiColorPalette()
public void setAsciiColorPalette(org.refcodes.data.AsciiColorPalette aAsciiColorPalette)
aAsciiColorPalette
- The ASCII_HEADER_ASCII_BODY color palette to be
stored by the ASCII_HEADER_ASCII_BODY color palette property.public FontFamily getFontFamily()
getFontFamily
in interface FontFamilyAccessor
public void setFontFamily(FontFamily aFontName)
setFontFamily
in interface FontFamilyAccessor.FontFamilyMutator
aFontName
- The font family to be stored by the font family
property.public AsciiArtBuilder withFontFamily(FontFamily aFontName)
withFontFamily
in interface FontFamilyAccessor.FontFamilyBuilder<AsciiArtBuilder>
aFontName
- The font family to be stored by the font family
property.public FontStyle getFontStyle()
getFontStyle
in interface FontStyleAccessor
public void setFontStyle(FontStyle aFontStyle)
setFontStyle
in interface FontStyleAccessor.FontStyleMutator
aFontStyle
- The font style to be stored by the font style
property.public AsciiArtBuilder withFontStyle(FontStyle aFontStyle)
withFontStyle
in interface FontStyleAccessor.FontStyleBuilder<AsciiArtBuilder>
aFontStyle
- The font style to be stored by the font style
property.public int getFontSize()
getFontSize
in interface FontSizeAccessor
public void setFontSize(int aFontSize)
setFontSize
in interface FontSizeAccessor.FontSizeMutator
aFontSize
- The font style to be stored by the font style
property.public AsciiArtBuilder withFontSize(int aFontSize)
withFontSize
in interface FontSizeAccessor.FontSizeBuilder<AsciiArtBuilder>
aFontSize
- The font style to be stored by the font style
property.public String getFontName()
getFontName
in interface FontNameAccessor
public void setFontName(String aFontName)
setFontName
in interface FontNameAccessor.FontNameMutator
aFontName
- The font name to be stored by the font name
property.public AsciiArtBuilder withFontName(String aFontName)
withFontName
in interface FontNameAccessor.FontNameBuilder<AsciiArtBuilder>
aFontName
- The font name to be stored by the font name
property.public void setRgbPixmap(org.refcodes.graphical.RgbPixmap aPixmap)
Pixmap
for the Pixmap
property.aPixmap
- The Pixmap
to be stored by the Pixmap
property.public String[] toStrings()
String
s being build by the builder upon the settings of
the attributes.toStrings
in interface TextAccessor.TextProvider
String
arraypublic String[] toStrings(String... aText)
Text.withText(String...)
followed by TextAccessor.TextProvider.toStrings()
. Implementation requirements: This
method must not(!) be implemented by calling Text.withText(String...)
followed by TextAccessor.TextProvider.toStrings()
(do not change the text property) as
this would not be thread safe!toStrings
in interface Text<AsciiArtBuilder>
aText
- The text to be processed.String
arraypublic String toString(org.refcodes.graphical.RgbPixmap aPixmap)
withRgbPixmap(RgbPixmap)
followed by toString()
. Implementation requirements: This method
must not(!) be implemented by calling withRgbPixmap(RgbPixmap)
followed by toString()
(do not change the Pixmap
property) as this would not be thread safe!aPixmap
- The Pixmap
to be converted to ASCII-Art.String
public String[] toStrings(org.refcodes.graphical.RgbPixmap aPixmap)
withRgbPixmap(RgbPixmap)
followed by toStrings()
. Implementation requirements: This
method must not(!) be implemented by calling
withRgbPixmap(RgbPixmap)
followed by toStrings()
(do
not change the Pixmap
property) as this would not be thread safe!aPixmap
- The Pixmap
to be converted to ASCII-Art.String
arraypublic AsciiArtBuilder withAsciiArtMode(AsciiArtMode aAsciiArtMode)
aAsciiArtMode
- The ASCII-Art mode to be stored by the text strip
mode property.public AsciiArtBuilder withPixmapRatioMode(PixmapRatioMode aPixmapRatioMode)
Pixmap
ratio mode for the Pixmap
ratio mode
property.aPixmapRatioMode
- The Pixmap
ratio mode to be stored by the
text strip mode property.public AsciiArtBuilder withAsciiColors(char... aAsciiColors)
aAsciiColors
- The ASCII_HEADER_ASCII_BODY colors to be stored by
the ASCII_HEADER_ASCII_BODY colors property.public void setAsciiColors(String aAsciiColors)
aAsciiColors
- The ASCII_HEADER_ASCII_BODY colors to be stored by
the ASCII_HEADER_ASCII_BODY colors property.public AsciiArtBuilder withAsciiColors(String aAsciiColors)
aAsciiColors
- The ASCII_HEADER_ASCII_BODY colors to be stored by
the ASCII_HEADER_ASCII_BODY colors property.public AsciiArtBuilder withAsciiColorPalette(org.refcodes.data.AsciiColorPalette aAsciiColorPalette)
aAsciiColorPalette
- The ASCII_HEADER_ASCII_BODY color palette to be
stored by the ASCII_HEADER_ASCII_BODY color palette property.public AsciiArtBuilder withRgbPixmap(org.refcodes.graphical.RgbPixmap aPixmap)
Pixmap
for the Pixmap
property.aPixmap
- The Pixmap
to be stored by the Pixmap
property.public void setImageFile(File aImageFile) throws IOException
Pixmap
property.aImageFile
- The file from which to retrieve the Pixmap
which is to be stored by the Pixmap
property.IOException
- in case the file was not found.public AsciiArtBuilder withImageFile(File aImageFile) throws IOException
Pixmap
property.aImageFile
- The image file for the Pixmap
to be stored by
the Pixmap
property.IOException
- in case the file was not found.public String toString(File aImageFile) throws IOException
withImageFile(File)
followed by toString()
. Implementation requirements: This method
must not(!) be implemented by calling withImageFile(File)
followed by toString()
(do not change the Pixmap
property) as this would not be thread safe!aImageFile
- The image file to be converted to ASCII-Art.String
IOException
- in case the file was not foundpublic String[] toStrings(File aImageFile) throws IOException
withImageFile(File)
followed by toStrings()
. Implementation requirements: This
method must not(!) be implemented by calling withImageFile(File)
followed by toStrings()
(do not change the Pixmap
property) as this would not be thread safe!aImageFile
- The image file to be converted to ASCII-Art.String
arrayIOException
- in case the file was not found or the like.public static String[] asAsciiArt(int aWidth, Font aFont, AsciiArtMode aAsciiArtMode, String[] aLines, char... aPalette)
aWidth
- The width for the resulting ASCII-Art.aFont
- The Font
to use for printing ASCII-Art.aAsciiArtMode
- The AsciiArtMode
specifies whether to invert
the resulting ASCII-Art or not.aLines
- The text lines to convert to ASCII-Art.aPalette
- The Character
set used as ASCII-Art color
palette.public static String[] asAsciiArt(int aWidth, Font aFont, AsciiArtMode aAsciiArtMode, char[] aPalette, String... aLines)
aWidth
- The width for the resulting ASCII-Art.aFont
- The Font
to use for printing ASCII-Art.aAsciiArtMode
- The AsciiArtMode
specifies whether to invert
the resulting ASCII-Art or not.aPalette
- The Character
set used as ASCII-Art color
palette.aLines
- The text lines to convert to ASCII-Art.public static String[] asAsciiArt(String aText, int aWidth, Font aFont, AsciiArtMode aAsciiArtMode, char... aPalette)
aText
- The text to convert to ASCII-Art.aWidth
- The width for the resulting ASCII-Art.aFont
- The Font
to use for printing ASCII-Art.aAsciiArtMode
- The AsciiArtMode
specifies whether to invert
the resulting ASCII-Art or not.aPalette
- The Character
set used as ASCII-Art color
palette.public static String[] asSimpleBanner(String aText, int aWidth, AsciiArtMode aAsciiArtMode, char... aPalette)
aText
- The text to convert to ASCII-Art.aWidth
- The width for the resulting ASCII-Art.aAsciiArtMode
- The AsciiArtMode
specifies whether to invert
the resulting ASCII-Art or not.aPalette
- The Character
set used as ASCII-Art color
palette.public static String[] asAsciiArt(File aImageFile, int aWidth, AsciiArtMode aAsciiArtMode, PixmapRatioMode aPixmapRatioMode, char... aPalette) throws IOException
aImageFile
- The image file to be converted to ASCII-Art.aWidth
- The width for the resulting ASCII-Art.aAsciiArtMode
- The AsciiArtMode
specifies whether to invert
the resulting ASCII-Art or not.aPixmapRatioMode
- The PixmapRatioMode
describes how to
scale the Pixmap
ratio for ASCII-Art as a
Character
on the screen does not have a ratio of 1:1 (in
comparison to a pixel which usually has a ration of 1:1).aPalette
- The Character
set used as ASCII-Art color
palette.IOException
- in case the file was not found or the like.public static String[] asAsciiArt(org.refcodes.graphical.RgbPixmap aPixmap, int aWidth, AsciiArtMode aAsciiArtMode, PixmapRatioMode aPixmapRatioMode, char... aPalette)
aPixmap
- The Pixmap
which to convert to ASCII-Art.aWidth
- The width for the resulting ASCII-Art.aAsciiArtMode
- The AsciiArtMode
specifies whether to invert
the resulting ASCII-Art or not.aPixmapRatioMode
- The PixmapRatioMode
describes how to
scale the Pixmap
ratio for ASCII-Art as a
Character
on the screen does not have a ratio of 1:1 (in
comparison to a pixel which usually has a ration of 1:1).aPalette
- The Character
set used as ASCII-Art color
palette.protected static String[] toAsciiArt(org.refcodes.graphical.RgbPixmap aPixmap, char[] aPalette)
aPixmap
- the pixmapaPalette
- the paletteprotected static String[] toInverseAsciiArt(org.refcodes.graphical.RgbPixmap aPixmap, char[] aPalette)
aPixmap
- the pixmapaPalette
- the paletteprotected static String[] toAsciiArt(String aText, int aWidth, String aFontName, int aFontStyle, char[] aPalette)
String
instances containing the
given text as so called ASCII-Art rendered with the given Font
name and Font
Style
to fit into the given width.aText
- The text to be rendered as ASCII-Art.aWidth
- the widthaFontName
- The Font
name to be used when rendering to
ASCII-Art.aFontStyle
- The Font
style to be used when rendering to
ASCII-Art.aPalette
- The character palate to use when converting an RGB value
to an ASCII_HEADER_ASCII_BODY character. The first character
represents white, the last character represents black, the
characters in between are gradients from white to black.String
instances, when printed out in the
order as returned, visualize the provided text in the given
Font
as ASCII-Art.protected static String[] toAsciiArt(String aText, int aWidth, Font aFont, char[] aPalette)
String
instances containing the
given text as so called ASCII-Art rendered with the given Font
name and Font
Style
to fit into the given width.aText
- The text to be rendered as ASCII-Art.aWidth
- the widthaFont
- the fontaPalette
- The character palate to use when converting an RGB value
to an ASCII_HEADER_ASCII_BODY character. The first character
represents white, the last character represents black, the
characters in between are gradients from white to black.String
instances, when printed out in the
order as returned, visualize the provided text in the given
Font
as ASCII-Art.protected static String[] toInverseAsciiArt(String aText, int aWidth, String aFontName, int aFontStyle, char[] aPalette)
toAsciiArt(org.refcodes.graphical.RgbPixmap,char[])
with inverted colors (black = white, dark =
bright, bright = dark, white = black).aText
- The text to be rendered as ASCII-Art.aWidth
- the widthaFontName
- The Font
name to be used when rendering to
ASCII-Art.aFontStyle
- The Font
style to be used when rendering to
ASCII-Art.aPalette
- The character palate to use when converting an RGB value
to an ASCII_HEADER_ASCII_BODY character. The first character
represents white, the last character represents black, the
characters in between are gradients from white to black.String
instances, when printed out in the
order as returned, visualize the provided text in the given
Font
as ASCII-Art.protected static String[] toInverseAsciiArt(String aText, int aWidth, Font aFont, char[] aPalette)
toAsciiArt(org.refcodes.graphical.RgbPixmap,char[])
with inverted colors (black = white, dark =
bright, bright = dark, white = black).aText
- The text to be rendered as ASCII-Art.aWidth
- the widthaFont
- The Font
to be used when rendering to ASCII-Art.aPalette
- The character palate to use when converting an RGB value
to an ASCII_HEADER_ASCII_BODY character. The first character
represents white, the last character represents black, the
characters in between are gradients from white to black.String
instances, when printed out in the
order as returned, visualize the provided text in the given
Font
as ASCII-Art.protected static String[] toAsciiArt(String aText, int aWidth, String aFontName, int aFontStyle)
String
instances containing the
given text as so called ASCII-Art rendered with the given Font
name and Font
Style
to fit into the given width.aText
- The text to be rendered as ASCII-Art.aWidth
- the widthaFontName
- The Font
name to be used when rendering to
ASCII-Art.aFontStyle
- The Font
style to be used when rendering to
ASCII-Art.String
instances, when printed out in the
order as returned, visualize the provided text in the given
Font
as ASCII-Art.protected static String[] toInverseAsciiArt(String aText, int aWidth, String aFontName, int aFontStyle)
toAsciiArt(org.refcodes.graphical.RgbPixmap,char[])
with inverted colors (black = white, dark =
bright, bright = dark, white = black).aText
- The text to be rendered as ASCII-Art.aWidth
- the widthaFontName
- The Font
name to be used when rendering to
ASCII-Art.aFontStyle
- The Font
style to be used when rendering to
ASCII-Art.String
instances, when printed out in the
order as returned, visualize the provided text in the given
Font
as ASCII-Art.protected static String[] toInverseAsciiArt(String aText, Font aFont)
toAsciiArt(org.refcodes.graphical.RgbPixmap,char[])
with inverted colors (black = white, dark =
bright, bright = dark, white = black).protected static String[] toAsciiArt(String aText, Font aFont, char[] aPalette)
String
instances containing the
given text rendered with the given Font
as so called ASCII-Art.aText
- The text to be rendered as ASCII-Art.aFont
- The Font
to render the ASCII-Art.aPalette
- The character palate to use when converting an RGB value
to an ASCII_HEADER_ASCII_BODY character. The first character
represents white, the last character represents black, the
characters in between are gradients from white to black.String
instances, when printed out in the
order as returned, visualize the provided text in the given
Font
as ASCII-Art.protected static String[] toInverseAsciiArt(String aText, Font aFont, char[] aPalette)
toAsciiArt(org.refcodes.graphical.RgbPixmap,char[])
with inverted colors (black = white, dark =
bright, bright = dark, white = black).aText
- The text to be rendered as ASCII-Art.aFont
- The Font
to render the ASCII-Art.aPalette
- The character palate to use when converting an RGB value
to an ASCII_HEADER_ASCII_BODY character. The first character
represents white, the last character represents black, the
characters in between are gradients from white to black.String
instances, when printed out in the
order as returned, visualize the provided text in the given
Font
as ASCII-Art.protected static char toAscii(int aRgbValue, char[] aPalette)
aRgbValue
- The RGB value to be converted to an
ASCII_HEADER_ASCII_BODY character.aPalette
- The character palate to use when converting an RGB value
to an ASCII_HEADER_ASCII_BODY character. The first character
represents white, the last character represents black, the
characters in between are gradients from white to black.protected static char toAscii(int aRgbValue)
aRgbValue
- The RGB value to be converted to an
ASCII_HEADER_ASCII_BODY character.public String[] getText()
getText
in interface TextAccessor
public void setText(String... aText)
setText
in interface TextAccessor.TextMutator
aText
- The text to be stored by the text property.public B withText(String... aText)
public B withText(Collection<String> aText)
withText
in interface TextAccessor.TextBuilder<B extends Text<B>>
aText
- the textpublic String toString()
String
being build by the builder upon the settings of
the attributes. In case more then one line has been set as input and
the functionality of the builder is applied to each line in separate,
then this method returns all of them lines concatenated with a line
break between each of them (implementation depended).toString
in interface TextAccessor.TextProvider
toString
in class Object
String
public String toString(String... aText)
Text.withText(String...)
followed by TextAccessor.TextProvider.toString()
. Implementation requirements: This method
must not(!) be implemented by calling Text.withText(String...)
followed by TextAccessor.TextProvider.toString()
(do not change the text property) as this
would not be thread safe!Copyright © 2021. All rights reserved.