1/* 2 * Copyright (C) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15import { image } from "@kit.ImageKit"; 16 17interface pixelMapPots { 18 width: number, 19 height: number, 20 pixelFormat: number, 21 editable: number, 22 alphaType: number, 23 scaleMode: number 24} 25 26interface pixelMapProperty { 27 width: number; 28 height: number; 29 pixelFormat: number 30} 31 32type CallbackFunctionWithNumber = (param: number) => boolean; 33export const JsNativeToNapi: (a: number, b: number) => image.PixelMap; 34export const JsNapiToNative_ReturnProperty: (a: image.PixelMap) => pixelMapProperty; 35export const createPixelMap: (a: ArrayBuffer, b:pixelMapPots) => image.PixelMap; 36export const initNativePixelMap: (a: image.PixelMap, ...params: any[]) => number; 37export const createAlphaPixelMap: (a: image.PixelMap, ...params: any[]) => number; 38export const getBytesNumberPerRow: (a: image.PixelMap, ...params: any[]) => number; 39export const getIsEditable: (a: image.PixelMap, ...params: any[]) => number; 40export const isSupportAlpha: (a: image.PixelMap, ...params: any[]) => number; 41export const setAlphaAble: (a: image.PixelMap, ...params: any[]) => number; 42export const setDensity: (a: image.PixelMap, ...params: any[]) => number; 43export const getDensity: (a: image.PixelMap, ...params: any[]) => number; 44export const setOpacity: (a: image.PixelMap, ...params: any[]) => number; 45export const scale: (a: image.PixelMap, ...params: any[]) => number; 46export const translate: (a: image.PixelMap, ...params: any[]) => number; 47export const rotate: (a: image.PixelMap, ...params: any[]) => number; 48export const flip: (a: image.PixelMap, ...params: any[]) => number; 49export const crop: (a: image.PixelMap, ...params: any[]) => number; 50export const getImageInfo: (a: image.PixelMap, ...params: any[]) => number; 51export const accessPixels: (a: image.PixelMap, ...params: any[]) => number; 52export const unAccessPixels: (a: image.PixelMap, ...params: any[]) => number;