public class Captcha extends Object
| 构造器和说明 |
|---|
Captcha() |
| 限定符和类型 | 方法和说明 |
|---|---|
static int |
getBlockShift(BufferedImage shade,
BufferedImage block,
int y)
轮廓边线比对,根据透明度计算像素位移
|
static int |
getBlockShift(BufferedImage shade,
BufferedImage block,
int y,
int diff)
轮廓边线比对,根据颜色值计算像素位移
|
static int |
getBlockShift(String shadeStr,
String blockStr,
int y)
轮廓边线比对,根据透明度计算像素位移
|
static int |
getBlockShift(String shadeStr,
String blockStr,
int y,
int diff)
轮廓边线比对,根据颜色值计算像素位移
|
static BufferedImage |
getMaskImage(BufferedImage origin,
BufferedImage block,
Point p)
生成遮罩图案
|
static List<String> |
imageCutout(File templateFile,
File originFile,
File blockFile)
从资源图上根据模板尺寸切图
|
static byte[] |
imgDecode(String base64Str)
图片数据格式转换:解码为字节数组
|
static String |
imgEncode(byte[] bytes)
图片数据格式转换
|
static void |
main(String[] args)
* 以下为测试内容 * *
|
static Point |
randomPoint(int widthDiff,
int heightDiff)
随机生成位置坐标点
|
static void |
saveToFile(BufferedImage bufImg,
String name)
仅测试用
|
static void |
saveToFile(byte[] bytes,
String name)
仅测试用
|
static void |
setWaterMark(BufferedImage origin,
BufferedImage block,
int x,
int y,
int alpha)
增加透明水印(未使用)
|
static BufferedImage |
toImage(String base64)
图片数据格式转换
|
public static List<String> imageCutout(File templateFile, File originFile, File blockFile)
public static BufferedImage getMaskImage(BufferedImage origin, BufferedImage block, Point p)
public static void setWaterMark(BufferedImage origin, BufferedImage block, int x, int y, int alpha)
public static String imgEncode(byte[] bytes)
public static byte[] imgDecode(String base64Str)
public static BufferedImage toImage(String base64)
public static Point randomPoint(int widthDiff, int heightDiff)
public static int getBlockShift(String shadeStr, String blockStr, int y)
public static int getBlockShift(BufferedImage shade, BufferedImage block, int y)
public static int getBlockShift(String shadeStr, String blockStr, int y, int diff)
public static int getBlockShift(BufferedImage shade, BufferedImage block, int y, int diff)
public static void main(String[] args)
public static void saveToFile(BufferedImage bufImg, String name)
public static void saveToFile(byte[] bytes,
String name)
Copyright © 2024. All rights reserved.