forked from floraachy/ImageKnife
1.ArkTs整改7 pngTest和部分接口
Signed-off-by: zhoulisheng1 <zhoulisheng1@huawei.com>
This commit is contained in:
parent
2c2dacb367
commit
50116741ea
|
@ -71,10 +71,10 @@ struct PngjTestCasePage {
|
|||
if (!this.pngdecodeRun1) {
|
||||
this.pngdecodeRun1 = true;
|
||||
let pngj = new Pngj();
|
||||
pngj.readPngImageInfo(this.pngSource1, (sender, value) => {
|
||||
pngj.readPngImageInfo(this.pngSource1,{pngCallback: (sender, value) => {
|
||||
this.hint1 = JSON.stringify(value);
|
||||
this.pngdecodeRun1 = false;
|
||||
})
|
||||
}})
|
||||
|
||||
} else {
|
||||
this.hint7 = '已经在执行了,请稍等'
|
||||
|
@ -118,12 +118,12 @@ struct PngjTestCasePage {
|
|||
type: 'classic',
|
||||
name: 'readPngImageAsync'
|
||||
})
|
||||
pngj.readPngImageAsync(png_worker, this.pngSource1, (sender, value) => {
|
||||
pngj.readPngImageAsync(png_worker, this.pngSource1, {pngCallback: (sender, value) => {
|
||||
this.pngSource1 = sender
|
||||
this.hint2 = 'img with=' + value.width + ' img height=' + value.height
|
||||
+ ' img depth=' + value.depth + ' img ctype=' + value.ctype
|
||||
this.pngdecodeRun2 = false;
|
||||
})
|
||||
}})
|
||||
|
||||
} else {
|
||||
this.hint8 = '已经在执行了,请稍等'
|
||||
|
@ -163,7 +163,7 @@ struct PngjTestCasePage {
|
|||
type: 'classic',
|
||||
name: 'writePngWithStringAsync'
|
||||
})
|
||||
pngj.writePngWithStringAsync(png_worker, 'hello world', this.pngSource3, (sender, value) => {
|
||||
pngj.writePngWithStringAsync(png_worker, 'hello world', this.pngSource3, {pngCallback: (sender, value) => {
|
||||
this.pngSource3 = sender
|
||||
FileUtils.getInstance().createFileProcess(
|
||||
this.rootFolder + '/pngj',
|
||||
|
@ -172,7 +172,7 @@ struct PngjTestCasePage {
|
|||
let png1 = new Uint8Array(value)
|
||||
this.hint3 = 'png写入后长度' + png1.byteLength + '目录文件:' + this.rootFolder + '/pngj/newPng.png' + '保存后使用2进制查看数据是否新增'
|
||||
this.pngdecodeRun3 = false;
|
||||
})
|
||||
}})
|
||||
} else {
|
||||
this.hint9 = '已经在执行了,请稍等'
|
||||
}
|
||||
|
@ -212,7 +212,7 @@ struct PngjTestCasePage {
|
|||
type: 'classic',
|
||||
name: 'writePngAsync'
|
||||
})
|
||||
pngj.writePngAsync(png_worker, this.pngSource4, (sender, value) => {
|
||||
pngj.writePngAsync(png_worker, this.pngSource4,{pngCallback: (sender, value) => {
|
||||
this.pngSource4 = sender
|
||||
FileUtils.getInstance().createFileProcess(
|
||||
this.rootFolder + '/pngj',
|
||||
|
@ -221,7 +221,7 @@ struct PngjTestCasePage {
|
|||
let png2 = new Uint8Array(value)
|
||||
this.hint4 = 'png2未写入长度' + png2.byteLength + '目录文件:' + this.rootFolder + '/pngj/newPng2.png' + '保存后使用2进制查看数据是否新增'
|
||||
this.pngdecodeRun4 = false;
|
||||
})
|
||||
}})
|
||||
} else {
|
||||
this.hint10 = '已经在执行了,请稍等'
|
||||
}
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
*/
|
||||
|
||||
export class ArcPoint {
|
||||
private x: number;
|
||||
private y: number;
|
||||
private x: number = 0;
|
||||
private y: number = 0;
|
||||
|
||||
constructor(x: number, y: number) {
|
||||
this.y = y;
|
||||
|
|
|
@ -13,12 +13,12 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
export class PixelEntry {
|
||||
a: number;
|
||||
b: number;
|
||||
r: number;
|
||||
g: number;
|
||||
f: number;
|
||||
pixel: number;
|
||||
a: number = 0;
|
||||
b: number = 0;
|
||||
r: number = 0;
|
||||
g: number = 0;
|
||||
f: number = 0;
|
||||
pixel: number = 0;
|
||||
|
||||
public toString(): string {
|
||||
return "PixelEntry a:" + this.a + ";b:" + this.b + ";r:" + this.r + ";g:" + this.g + ";f:" + this.f;
|
||||
|
|
|
@ -14,5 +14,5 @@
|
|||
*/
|
||||
|
||||
export interface DataCallBack<T> {
|
||||
callback(data: T);
|
||||
callback:(data: T)=>void;
|
||||
}
|
|
@ -14,24 +14,24 @@
|
|||
*/
|
||||
|
||||
import {ImageKnifeData} from "../../imageknife/ImageKnifeData"
|
||||
|
||||
export class AllCacheInfo {
|
||||
memoryCacheInfo: {
|
||||
export interface MemoryCacheInfo{
|
||||
key: string,
|
||||
data: ImageKnifeData
|
||||
}
|
||||
|
||||
resourceCacheInfo: {
|
||||
}
|
||||
export interface ResourceCacheInfo{
|
||||
path: string,
|
||||
key: string
|
||||
}
|
||||
|
||||
dataCacheInfo: {
|
||||
}
|
||||
export interface DataCacheInfo{
|
||||
path: string,
|
||||
key: string
|
||||
}
|
||||
}
|
||||
export class AllCacheInfo {
|
||||
memoryCacheInfo: MemoryCacheInfo
|
||||
resourceCacheInfo: ResourceCacheInfo
|
||||
dataCacheInfo: DataCacheInfo
|
||||
}
|
||||
|
||||
export interface IAllCacheInfoCallback {
|
||||
(cacheInfo: AllCacheInfo);
|
||||
callback :(cacheInfo: AllCacheInfo)=>void;
|
||||
}
|
|
@ -121,7 +121,7 @@ export class RequestManager {
|
|||
key: SparkMD5.hashBinary(this.options.generateDataKey),
|
||||
path: this.mDiskCacheProxy.getCachePath() + SparkMD5.hashBinary(this.options.generateDataKey)
|
||||
}
|
||||
this.options.allCacheInfoCallback(allCacheInfo)
|
||||
this.options.allCacheInfoCallback.callback(allCacheInfo)
|
||||
}
|
||||
} catch (err) {
|
||||
LogUtil.log("after err =" + err)
|
||||
|
|
Loading…
Reference in New Issue