From 36485c10b4028f3490e9d904af76c6c52aa9789e Mon Sep 17 00:00:00 2001
From: CPunisher <1343316114@qq.com>
Date: Thu, 14 May 2020 20:07:09 +0800
Subject: [PATCH] [Style res image]
---
src/components/app/PartStyles.js | 1 -
src/components/renderer/RendererResImage.js | 88 +++++++++++++++++++++
src/containers/style/StyleListViewer.js | 3 +-
src/reducers/index.js | 2 -
src/utils/util.js | 37 ++++++++-
5 files changed, 126 insertions(+), 5 deletions(-)
create mode 100644 src/components/renderer/RendererResImage.js
diff --git a/src/components/app/PartStyles.js b/src/components/app/PartStyles.js
index dee3f7b..5d5ce6c 100644
--- a/src/components/app/PartStyles.js
+++ b/src/components/app/PartStyles.js
@@ -9,7 +9,6 @@ const PartStyles = ({ setParamInfo }) => {
}, [])
const styleList = React.createElement(StyleListViewer({setParamInfo}))
- console.log(loaded)
return (
diff --git a/src/components/renderer/RendererResImage.js b/src/components/renderer/RendererResImage.js
new file mode 100644
index 0000000..d976b80
--- /dev/null
+++ b/src/components/renderer/RendererResImage.js
@@ -0,0 +1,88 @@
+import React, {useEffect, useState} from "react";
+import {getGrayPointList, rand} from "../../utils/util";
+import {ParamTypes} from "../../constant/ParamTypes";
+import {getTypeTable, QRPointType} from "../../utils/qrcodeHandler";
+
+function listPoints(qrcode, params) {
+ if (!qrcode) return []
+
+ const nCount = qrcode.getModuleCount();
+ const typeTable = getTypeTable(qrcode);
+ const pointList = new Array(nCount);
+
+ let id = 0;
+ for (let x = 0; x < nCount; x++) {
+ for (let y = 0; y < nCount; y++) {
+ const posX = 3 * x + 1, posY = 3 * y + 1;
+ if (typeTable[x][y] == QRPointType.ALIGN_CENTER || typeTable[x][y] == QRPointType.ALIGN_OTHER || typeTable[x][y] == QRPointType.TIMING) {
+ if (qrcode.isDark(x, y)) {
+ pointList.push(