public class BdmpHandle extends Object
因为当前类可能需要手动输入到指定环境, 因此当前类中的代码, 以及其调用到的代码不使用任何其它非JRE官方jar包
created in 2020/5/19
| 限定符 | 构造器和说明 |
|---|---|
private |
BdmpHandle() |
| 限定符和类型 | 方法和说明 |
|---|---|
static boolean |
convertBdmpToFile(String picPath,
String saveDirPath)
将路径指向的 Bdmp 转换为文件并存储到指定文件夹
|
static BufferedImage |
convertFileToBdmp(File file,
int rowPxNum,
int pixelSideLength,
int margin,
byte powerOf2)
生成图片宽度为 2 * borderLength +
|
static void |
convertFileToBdmp(String filePath,
int rowPxNum,
int pxWidth,
int margin,
byte powerOf2) |
static void |
convertFileToBdmp(String filePath,
String savePath,
int rowPxNum,
int pxWidth,
int margin,
byte powerOf2) |
public static BufferedImage convertFileToBdmp(File file, int rowPxNum, int pixelSideLength, int margin, byte powerOf2) throws IOException
file - 转换文件路径rowPxNum - 一行像素个数pixelSideLength - 像素宽度margin - margin长度,powerOf2 - 2的指数幂, 可选值为 1, 2, 4, 8, 以及8的倍数,
像素颜色类型为 2 ^ powerOf2 个,
如果为 1, 像素颜色为 2种, 每 1 个bit作为一个像素,
如果为 2, 像素颜色为 4种, 每 2 个bit作为一个像素存储.
如果为 4, 像素颜色为 16种, 每 4 个bit作为一个像素存储.
如果为 8, 像素颜色为256种, 每 8 个bit作为一个像素存储.
如果为8n, 像素颜色为 2 ^ 8n 种, 每 8n 个bit作为一个像素存储.IOException - 写入文件和读取文件流异常public static void convertFileToBdmp(String filePath, String savePath, int rowPxNum, int pxWidth, int margin, byte powerOf2) throws IOException
filePath - 文件路径savePath - 存储路径rowPxNum - 一行像素个数pxWidth - 像素宽度margin - margin长度powerOf2 - 2的指数幂, 可选值为 1, 2, 4, 8, 以及8的倍数,
像素颜色类型为 2 ^ powerOf2 个,
如果为 1, 像素颜色为 2种, 每 1 个bit作为一个像素,
如果为 2, 像素颜色为 4种, 每 2 个bit作为一个像素存储.
如果为 4, 像素颜色为 16种, 每 4 个bit作为一个像素存储.
如果为 8, 像素颜色为256种, 每 8 个bit作为一个像素存储.
如果为8n, 像素颜色为 2 ^ 8n 种, 每 8n 个bit作为一个像素存储.IOException - 写入文件和读取文件流异常public static void convertFileToBdmp(String filePath, int rowPxNum, int pxWidth, int margin, byte powerOf2) throws IOException
filePath - 文件路径rowPxNum - 一行像素个数pxWidth - 像素宽度margin - margin长度powerOf2 - 2的指数幂, 可选值为 1, 2, 4, 8, 以及8的倍数,
像素颜色类型为 2 ^ powerOf2 个,
如果为 1, 像素颜色为 2种, 每 1 个bit作为一个像素,
如果为 2, 像素颜色为 4种, 每 2 个bit作为一个像素存储.
如果为 4, 像素颜色为 16种, 每 4 个bit作为一个像素存储.
如果为 8, 像素颜色为256种, 每 8 个bit作为一个像素存储.
如果为8n, 像素颜色为 2 ^ 8n 种, 每 8n 个bit作为一个像素存储.IOException - 写入文件和读取文件流异常public static boolean convertBdmpToFile(String picPath, String saveDirPath) throws IOException
picPath - Bdmp 图片路径saveDirPath - 解析后的文件存储路径IOExceptionCopyright © 2021. All rights reserved.