image-wasm-for-war3
Advanced tools
Comparing version 2.0.0-alpha.2 to 2.0.0
{ | ||
"name": "image-wasm-for-war3", | ||
"version": "2.0.0-alpha.2", | ||
"version": "2.0.0", | ||
"description": "image process by wasm", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -55,3 +55,3 @@ "use strict"; | ||
const jpegHeaderSize = view.getUint32(this.blpHeader.size, true); | ||
const jpegHeader = new Uint8Array(buffer, this.blpHeader.size + 4, jpegHeaderSize); | ||
const jpegHeader = this.buffer.slice(this.blpHeader.size + 4, this.blpHeader.size + 4 + jpegHeaderSize); | ||
this.jpegHeader = { | ||
@@ -72,3 +72,3 @@ size: jpegHeaderSize, | ||
} | ||
getMimapData(index = 0) { | ||
async getMimapData(index = 0) { | ||
if (index >= this.mipmapsCount) { | ||
@@ -97,7 +97,7 @@ throw new Error(`index [${index}] out of range ${this.mipmapsCount}`); | ||
// bgra | ||
const palette = new Uint8Array(this.buffer, this.blpHeader.size, 256 * 4); // 调色板 | ||
const palette = this.buffer.slice(this.blpHeader.size, this.blpHeader.size + 256 * 4); // 调色板 | ||
const size = width * height; | ||
const sourcePixels = new Uint8Array(buffer, 0, size); // 原始像素 | ||
const sourcePixels = buffer.slice(0, size); // 原始像素 | ||
const out = new Uint8Array(size * 4); | ||
const alpha = new Uint8Array(buffer, size); // alpha通道 | ||
const alpha = buffer.slice(size); // alpha通道 | ||
switch (this.headerValue.alphaBits) { | ||
@@ -104,0 +104,0 @@ case 0: |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
2698920
1