修改demo
This commit is contained in:
parent
d2646b5ad4
commit
e79557cf7c
|
@ -126,6 +126,8 @@ struct DownSamplePage {
|
||||||
desiredPixelFormat: 3,
|
desiredPixelFormat: 3,
|
||||||
}
|
}
|
||||||
let imageInfo = await imageSource.getImageInfo()
|
let imageInfo = await imageSource.getImageInfo()
|
||||||
|
|
||||||
|
if (this.imageKnifeOption.downsampleOf !== DownsampleStrategy.NONE){
|
||||||
let reqSize =
|
let reqSize =
|
||||||
new Downsampler().calculateScaling(typeValue, imageInfo.size.width, imageInfo.size.height, 300,
|
new Downsampler().calculateScaling(typeValue, imageInfo.size.width, imageInfo.size.height, 300,
|
||||||
300, this.imageKnifeOption.downsampleOf)
|
300, this.imageKnifeOption.downsampleOf)
|
||||||
|
@ -136,6 +138,8 @@ struct DownSamplePage {
|
||||||
height: reqSize.height
|
height: reqSize.height
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 创建pixelMap
|
// 创建pixelMap
|
||||||
imageSource.createPixelMap(decodingOptions).then((pixelMap: image.PixelMap) => {
|
imageSource.createPixelMap(decodingOptions).then((pixelMap: image.PixelMap) => {
|
||||||
this.afterSampling = pixelMap.getPixelBytesNumber()
|
this.afterSampling = pixelMap.getPixelBytesNumber()
|
||||||
|
|
|
@ -28,7 +28,7 @@ export enum SampleSizeRounding {
|
||||||
//(质量优先)
|
//(质量优先)
|
||||||
QUALITY
|
QUALITY
|
||||||
}
|
}
|
||||||
|
//找出给定整数 i 中最高位的1(即最左边的1)所代表的值
|
||||||
export function highestOneBit(i: number): number {
|
export function highestOneBit(i: number): number {
|
||||||
i |= (i >> 1);
|
i |= (i >> 1);
|
||||||
i |= (i >> 2);
|
i |= (i >> 2);
|
||||||
|
|
Loading…
Reference in New Issue