Class IdentiColorHelper
- java.lang.Object
-
- com.h2tcoin.takamakachain.utils.simpleWallet.panels.support.identicon.IdentiColorHelper
-
public class IdentiColorHelper extends Object
/c1 color of top left corner /c2 color of top right corner /c3 color of bottom left corner /c4 color of central image ....../----c1----------------\ /----c2----------------\ /----c3----------------\ /-C1-\ /-C2-\ /-C3-\ /-C4-\ ....../q\/q\/q\/q\/q\/q\/q\/q\ |/q\/q\/q\/q\/q\/q\/q\/q\ |/q\/q\/q\/q\/q\/q\/q\/q\| | a5907fa2fc0fcb336d648805be46da11ab850e5c44934279c921a855ed50825a9ba7e13e893934a2c5ba14d82a08ccdf- Author:
- giovanni.antino@h2tcoin.com
-
-
Constructor Summary
Constructors Constructor Description IdentiColorHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Color
bgColorFromHex(String hex)
static int
cfh(String cc)
channel from hexstatic int[][]
clone(int[][] matrix)
static void
createIdentiMatrix(String hex)
static Color
fgColorFromHex(String hex)
static int[][]
get128by128SquareBlockHIRND(String hex)
static int[][]
get256by256SquareBlockHIRND(String hex)
static int[][]
get32by32SquareBlock(String hex)
static int[][]
get64by64SquareBlockHIRND(String hex)
static int[][]
get64by64SquareBlockSIM(String hex)
static String
getAvatarBase64URL256(String value)
static BufferedImage
getAvatarByHex(String hex)
static BufferedImage
getAvatarByString128(String value)
static Icon
getAvatarByString128Icon(String value)
static BufferedImage
getAvatarByString256(String value)
static Icon
getAvatarByString256Icon(String value)
static Color[][]
getIdenticon256(String hex)
static String
getRawAvatar256(String value)
static int[]
getRotation(String hex)
static void
main(String[] args)
static int[][]
merge4Square(int[][] topLeft, int[][] topRight, int[][] bottomRight, int[][] bottomLeft)
static int[][]
mirrorHorizontal(int[][] matrix)
static int[][]
mirrorHplusV(int[][] matrix)
static int[][]
mirrorVertical(int[][] matrix)
static Color[][]
pixelToColorSquareMatrix(Color fg, Color bg, int[][] m)
static void
printMatrix(int[][] m)
static BufferedImage
scale(BufferedImage bi, float scale)
-
-
-
Method Detail
-
cfh
public static int cfh(String cc)
channel from hex- Parameters:
cc
- channel in hex "ff"- Returns:
- channel in int ff evaluate to 255
-
getRotation
public static int[] getRotation(String hex)
-
clone
public static int[][] clone(int[][] matrix)
-
mirrorVertical
public static int[][] mirrorVertical(int[][] matrix)
-
mirrorHorizontal
public static int[][] mirrorHorizontal(int[][] matrix)
-
mirrorHplusV
public static int[][] mirrorHplusV(int[][] matrix)
-
get32by32SquareBlock
public static int[][] get32by32SquareBlock(String hex)
- Parameters:
hex
- 3 char hex string- Returns:
- 32x32 mirrored matrix
-
get64by64SquareBlockSIM
public static int[][] get64by64SquareBlockSIM(String hex)
- Parameters:
hex
-- Returns:
-
get64by64SquareBlockHIRND
public static int[][] get64by64SquareBlockHIRND(String hex)
- Parameters:
hex
- 12 char- Returns:
-
get128by128SquareBlockHIRND
public static int[][] get128by128SquareBlockHIRND(String hex)
- Parameters:
hex
- 12 char- Returns:
-
get256by256SquareBlockHIRND
public static int[][] get256by256SquareBlockHIRND(String hex)
- Parameters:
hex
- 60 char hex- Returns:
-
merge4Square
public static int[][] merge4Square(int[][] topLeft, int[][] topRight, int[][] bottomRight, int[][] bottomLeft)
-
scale
public static BufferedImage scale(BufferedImage bi, float scale)
-
getAvatarByString128
public static BufferedImage getAvatarByString128(String value)
-
getAvatarByString256
public static BufferedImage getAvatarByString256(String value)
-
getAvatarBase64URL256
public static String getAvatarBase64URL256(String value)
- Parameters:
value
- address qtesla or ed- Returns:
- 256*256 identicon base64url png
-
getAvatarByHex
public static BufferedImage getAvatarByHex(String hex)
-
pixelToColorSquareMatrix
public static Color[][] pixelToColorSquareMatrix(Color fg, Color bg, int[][] m)
-
createIdentiMatrix
public static void createIdentiMatrix(String hex)
-
main
public static void main(String[] args)
-
printMatrix
public static void printMatrix(int[][] m)
-
-