onbon.bx06.utils
Class ImageBinary

java.lang.Object
  extended by onbon.bx06.utils.ImageBinary

public class ImageBinary
extends Object

图文点阵数据工具。


Constructor Summary
ImageBinary()
           
 
Method Summary
static byte[] blank(int width, int height, int targetX, Bx6GScreenProfile.ScreenColorType colorType, Bx6GScreenProfile.ScreenMatrixType matrixType)
          根据区域座标将图文转换成 BX05 使用的点阵数据。
static int calcWidthBytes(BufferedImage orig, int targetX, boolean fullColor)
           
static byte[] encode(BufferedImage orig, int targetX, Bx6GScreenProfile.ScreenColorType colorType, Bx6GScreenProfile.ScreenMatrixType matrixType)
          根据区域座标将图文转换成 BX05 使用的点阵数据。
static byte[] encode(File file, int targetX, Bx6GScreenProfile.ScreenColorType colorType, Bx6GScreenProfile.ScreenMatrixType matrixType)
          根据区域座标将图档转换成 BX06 使用的点阵数据。
static byte[] encode(File file, int targetX, int targetWidth, int targetHeight, Bx6GScreenProfile.ScreenColorType colorType, Bx6GScreenProfile.ScreenMatrixType matrixType)
          根据区域座标将图档转换成 BX06 使用的点阵数据。
static byte[] encode(InputStream is, int targetX, Bx6GScreenProfile.ScreenColorType colorType, Bx6GScreenProfile.ScreenMatrixType matrixType)
          根据区域座标将图档转换成 BX06 使用的点阵数据。
static byte[] encode(InputStream is, int targetX, int targetWidth, int targetHeight, Bx6GScreenProfile.ScreenColorType colorType, Bx6GScreenProfile.ScreenMatrixType matrixType)
          根据区域座标将图档转换成 BX06 使用的点阵数据。
static byte[] encodeFrame(BufferedImage image, Bx6GScreenProfile.ScreenColorType colorType, Bx6GScreenProfile.ScreenMatrixType matrixType)
          将图档转换成 BX06 使用的屏幕边框或区域边框使用的点阵数据。
static byte[] encodeFrame(File file, Bx6GScreenProfile.ScreenColorType colorType, Bx6GScreenProfile.ScreenMatrixType matrixType)
          将图档转换成 BX06 使用的屏幕边框或区域边框使用的点阵数据。
static byte[] encodeFrame(InputStream is, Bx6GScreenProfile.ScreenColorType colorType, Bx6GScreenProfile.ScreenMatrixType matrixType)
          将图档转换成 BX06 使用的屏幕边框或区域边框使用的点阵数据。
static int print(byte[] data, int width, int height)
           
static boolean savePNG(String filePath, BufferedImage image)
          将图档储存成 PNG 档案。
static BufferedImage scale(BufferedImage image, int targetWidth)
          缩放图档。
static BufferedImage scale(BufferedImage image, int targetWidth, int targetHeight)
          缩放图档。
static int validLen(BufferedImage image, Color background)
          計算有效長度。
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageBinary

public ImageBinary()
Method Detail

savePNG

public static boolean savePNG(String filePath,
                              BufferedImage image)
将图档储存成 PNG 档案。

Parameters:
filePath - 档案路径。
image - 图档。
Returns:
成功与否。

scale

public static BufferedImage scale(BufferedImage image,
                                  int targetWidth)
缩放图档。

Parameters:
image - 原始图档。
targetWidth - 水平缩放大小。
Returns:
缩放后的图档。

scale

public static BufferedImage scale(BufferedImage image,
                                  int targetWidth,
                                  int targetHeight)
缩放图档。

Parameters:
image - 图档。
targetWidth - 水平缩放大小。
targetHeight - 垂直缩放大小。
Returns:
缩放后的图档。

encodeFrame

public static byte[] encodeFrame(BufferedImage image,
                                 Bx6GScreenProfile.ScreenColorType colorType,
                                 Bx6GScreenProfile.ScreenMatrixType matrixType)
                          throws IOException
将图档转换成 BX06 使用的屏幕边框或区域边框使用的点阵数据。

Parameters:
image - 图案。
colorType - 显示屏类型。
matrixType - 点阵类型。
Returns:
点阵数据。
Throws:
IOException - 转换发生错误。

encodeFrame

public static byte[] encodeFrame(File file,
                                 Bx6GScreenProfile.ScreenColorType colorType,
                                 Bx6GScreenProfile.ScreenMatrixType matrixType)
                          throws IOException
将图档转换成 BX06 使用的屏幕边框或区域边框使用的点阵数据。

Parameters:
file - 档案。
colorType - 显示屏类型。
matrixType - 点阵类型。
Returns:
点阵数据。
Throws:
IOException - 转换发生错误。

encodeFrame

public static byte[] encodeFrame(InputStream is,
                                 Bx6GScreenProfile.ScreenColorType colorType,
                                 Bx6GScreenProfile.ScreenMatrixType matrixType)
                          throws IOException
将图档转换成 BX06 使用的屏幕边框或区域边框使用的点阵数据。

Parameters:
is - 档案。
colorType - 显示屏类型。
matrixType - 点阵类型。
Returns:
点阵数据。
Throws:
IOException - 转换发生错误。

encode

public static byte[] encode(File file,
                            int targetX,
                            Bx6GScreenProfile.ScreenColorType colorType,
                            Bx6GScreenProfile.ScreenMatrixType matrixType)
                     throws IOException
根据区域座标将图档转换成 BX06 使用的点阵数据。

Parameters:
file - 档案。
targetX - 图案显示在屏模的 X 座标。
colorType - 显示屏类型。
matrixType - 点阵类型。
Returns:
点阵数据。
Throws:
IOException - 转换发生错误。

encode

public static byte[] encode(InputStream is,
                            int targetX,
                            Bx6GScreenProfile.ScreenColorType colorType,
                            Bx6GScreenProfile.ScreenMatrixType matrixType)
                     throws IOException
根据区域座标将图档转换成 BX06 使用的点阵数据。

Parameters:
is - 档案。
targetX - 图案显示在屏模的 X 座标。
colorType - 显示屏类型。
matrixType - 点阵类型。
Returns:
点阵数据。
Throws:
IOException - 转换发生错误。

encode

public static byte[] encode(File file,
                            int targetX,
                            int targetWidth,
                            int targetHeight,
                            Bx6GScreenProfile.ScreenColorType colorType,
                            Bx6GScreenProfile.ScreenMatrixType matrixType)
                     throws IOException
根据区域座标将图档转换成 BX06 使用的点阵数据。

Parameters:
file - 档案。
targetX - 图案显示在屏模的 X 座标。
targetWidth - 投射宽度。
targetHeight - 投射高度。
colorType - 显示屏类型。
matrixType - 点阵类型。
Returns:
点阵数据。
Throws:
IOException - 转换发生错误。

encode

public static byte[] encode(InputStream is,
                            int targetX,
                            int targetWidth,
                            int targetHeight,
                            Bx6GScreenProfile.ScreenColorType colorType,
                            Bx6GScreenProfile.ScreenMatrixType matrixType)
                     throws IOException
根据区域座标将图档转换成 BX06 使用的点阵数据。

Parameters:
is - 档案。
targetX - 图案显示在屏模的 X 座标。
targetWidth - 投射宽度。
targetHeight - 投射高度。
colorType - 显示屏类型。
matrixType - 点阵类型。
Returns:
点阵数据。
Throws:
IOException - 转换发生错误。

print

public static int print(byte[] data,
                        int width,
                        int height)

validLen

public static int validLen(BufferedImage image,
                           Color background)
計算有效長度。

Parameters:
image - 图案。
background - 背景色。
Returns:
有效長度。

calcWidthBytes

public static int calcWidthBytes(BufferedImage orig,
                                 int targetX,
                                 boolean fullColor)

blank

public static byte[] blank(int width,
                           int height,
                           int targetX,
                           Bx6GScreenProfile.ScreenColorType colorType,
                           Bx6GScreenProfile.ScreenMatrixType matrixType)
根据区域座标将图文转换成 BX05 使用的点阵数据。

Parameters:
width - 寬度。
height - 高度。
targetX - 图案显示在屏模的 X 座标。
colorType - 显示屏类型。
matrixType - 点阵类型。
Returns:
点阵数据。

encode

public static byte[] encode(BufferedImage orig,
                            int targetX,
                            Bx6GScreenProfile.ScreenColorType colorType,
                            Bx6GScreenProfile.ScreenMatrixType matrixType)
根据区域座标将图文转换成 BX05 使用的点阵数据。

Parameters:
orig - 图案。
targetX - 图案显示在屏模的 X 座标。
colorType - 顏色模式。
matrixType - 显示屏类型。
Returns:
点阵数据。


Copyright © 2020 onbon. All rights reserved.