修改demo
This commit is contained in:
parent
d2646b5ad4
commit
e79557cf7c
|
@ -126,16 +126,20 @@ struct DownSamplePage {
|
||||||
desiredPixelFormat: 3,
|
desiredPixelFormat: 3,
|
||||||
}
|
}
|
||||||
let imageInfo = await imageSource.getImageInfo()
|
let imageInfo = await imageSource.getImageInfo()
|
||||||
let reqSize =
|
|
||||||
new Downsampler().calculateScaling(typeValue, imageInfo.size.width, imageInfo.size.height, 300,
|
if (this.imageKnifeOption.downsampleOf !== DownsampleStrategy.NONE){
|
||||||
300, this.imageKnifeOption.downsampleOf)
|
let reqSize =
|
||||||
decodingOptions = {
|
new Downsampler().calculateScaling(typeValue, imageInfo.size.width, imageInfo.size.height, 300,
|
||||||
editable: true,
|
300, this.imageKnifeOption.downsampleOf)
|
||||||
desiredSize: {
|
decodingOptions = {
|
||||||
width: reqSize.width,
|
editable: true,
|
||||||
height: reqSize.height
|
desiredSize: {
|
||||||
|
width: reqSize.width,
|
||||||
|
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