-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
45 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
module_camera/src/main/java/com/ailiwean/core/able/XQRScanFastAble.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package com.ailiwean.core.able; | ||
|
||
import android.os.Handler; | ||
import android.os.Message; | ||
|
||
import com.ailiwean.core.Config; | ||
import com.ailiwean.core.helper.ScanHelper; | ||
import com.ailiwean.core.zxing.core.PlanarYUVLuminanceSource; | ||
import com.ailiwean.core.zxing.core.Result; | ||
|
||
/** | ||
* @Package: com.ailiwean.core.able | ||
* @ClassName: XQRScanFast | ||
* @Description: | ||
* @Author: SWY | ||
* @CreateDate: 2020/7/21 2:09 PM | ||
*/ | ||
class XQRScanFastAble extends PixsValuesAble { | ||
|
||
protected Result result; | ||
|
||
public XQRScanFastAble(Handler handler) { | ||
super(handler); | ||
} | ||
|
||
@Override | ||
protected void needParseDeploy(PlanarYUVLuminanceSource source) { | ||
if (result != null) | ||
return; | ||
result = toLaunchParse(source.getGlobaBinary()); | ||
if (result != null) { | ||
Message.obtain(handler, Config.SCAN_RESULT, covertResult(result)).sendToTarget(); | ||
} | ||
} | ||
|
||
protected com.ailiwean.core.Result covertResult(Result result) { | ||
com.ailiwean.core.Result result_ = new com.ailiwean.core.Result(); | ||
result_.setText(result.getText()); | ||
result_.setPointF(ScanHelper.rotatePoint(result.getResultPoints())); | ||
return result_; | ||
} | ||
|
||
} |