Class ShearCaptcha
java.lang.Object
com.sure.tool.captcha.AbstractCaptcha
com.sure.tool.captcha.ShearCaptcha
- All Implemented Interfaces:
Captcha
扭曲(错切)验证码,参考 Hutool 的
ShearCaptcha 设计。- Since:
- 0.1.0
- Author:
- suretool
-
Field Summary
Fields inherited from class AbstractCaptcha
BASE_CHAR -
Constructor Summary
ConstructorsConstructorDescriptionShearCaptcha(int width, int height, int codeCount, int interfereCount) 创建扭曲验证码。 -
Method Summary
Modifier and TypeMethodDescriptionprotected void错切变换钩子,默认不变换,ShearCaptcha覆盖。protected void干扰绘制,由子类实现。Methods inherited from class AbstractCaptcha
drawRandomCircles, drawRandomLines, getCode, getCodeBase64, getHeight, getImageBase64, getImageBytes, getInterfereCount, getWidth, randomCode, randomColor, verify, write, write
-
Constructor Details
-
ShearCaptcha
public ShearCaptcha(int width, int height, int codeCount, int interfereCount) 创建扭曲验证码。- Parameters:
width- 图片宽度height- 图片高度codeCount- 字符个数interfereCount- 干扰线数量
-
-
Method Details
-
applyShear
Description copied from class:AbstractCaptcha错切变换钩子,默认不变换,ShearCaptcha覆盖。- Overrides:
applyShearin classAbstractCaptcha- Parameters:
g- 画笔
-
drawInterfere
Description copied from class:AbstractCaptcha干扰绘制,由子类实现。- Specified by:
drawInterferein classAbstractCaptcha- Parameters:
g- 画笔
-