interface_sdk-js/api/@ohos.graphics.uiEffect.d.ts
耿豪 14ed4931ee
update api/@ohos.graphics.uiEffect.d.ts.
Signed-off-by: 耿豪 <genghao13@huawei.com>
2024-05-30 09:49:35 +00:00

308 lines
7.0 KiB
TypeScript

/*
* Copyright (c) 2024 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file
* @kit ArkGraphics2D
*/
import { AsyncCallback } from './@ohos.base';
/**
* @namespace uiEffect
* @syscap SystemCapability.Graphics.Drawing
* @since 12
*/
declare namespace uiEffect {
/**
* The Filter for Component.
* @typedef Filter
* @syscap SystemCapability.Graphics.Drawing
* @since 12
*/
interface Filter {
/**
* Set the edge pixel stretch effect of the Component.
*
* @param { Array<number> } stretchSizes
* @param { TileMode } tileMode
* @returns { Filter }
* @syscap SystemCapability.Graphics.Drawing
* @systemapi
* @since 12
*/
pixelStretch(stretchSizes: Array<number>, tileMode: TileMode): Filter;
}
/**
* TileMode enumeration description
*
* @enum { number }
* @syscap SystemCapability.Graphics.Drawing
* @systemapi
* @since 12
*/
enum TileMode {
/**
* Clamp mode.
*
* @syscap SystemCapability.Graphics.Drawing
* @systemapi
* @since 12
*/
CLAMP = 0,
/**
* Repeat mode.
*
* @syscap SystemCapability.Graphics.Drawing
* @systemapi
* @since 12
*/
REPEAT = 1,
/**
* Mirror mode.
*
* @syscap SystemCapability.Graphics.Drawing
* @systemapi
* @since 12
*/
MIRROR = 2,
/**
* Decal mode.
*
* @syscap SystemCapability.Graphics.Drawing
* @systemapi
* @since 12
*/
DECAL = 3,
}
/**
* The VisualEffect of Component.
* @typedef VisualEffect
* @syscap SystemCapability.Graphics.Drawing
* @since 12
*/
interface VisualEffect {
/**
* A backgroundColorEffect effect is added to the Component.
* @param { BrightnessBlender } blender - The blender to blend backgroundColor.
* @returns { VisualEffect } VisualEffects for the current effect have been added.
* @syscap SystemCapability.Graphics.Drawing
* @systemapi
* @since 12
*/
backgroundColorBlender(blender: BrightnessBlender): VisualEffect;
}
/**
* The Blender of backgroundColorEffect.
* @typedef BrightnessBlender
* @syscap SystemCapability.Graphics.Drawing
* @systemapi
* @since 12
*/
interface BrightnessBlender {
/**
* Defines the brightness cubicRate.
*
* @type { number }
* @syscap SystemCapability.Graphics.Drawing
* @systemapi
* @since 12
*/
cubicRate: number;
/**
* Defines the brightness quadraticRate.
*
* @type { number }
* @syscap SystemCapability.Graphics.Drawing
* @systemapi
* @since 12
*/
quadraticRate: number;
/**
* Defines the brightness LinearRate.
*
* @type { number }
* @syscap SystemCapability.Graphics.Drawing
* @systemapi
* @since 12
*/
linearRate: number;
/**
* Defines the brightness degree.
*
* @type { number }
* @syscap SystemCapability.Graphics.Drawing
* @systemapi
* @since 12
*/
degree: number;
/**
* Defines the brightness saturation.
*
* @type { number }
* @syscap SystemCapability.Graphics.Drawing
* @systemapi
* @since 12
*/
saturation: number;
/**
* Defines the brightness positiveCoefficient.
*
* @type { [number, number, number] }
* @syscap SystemCapability.Graphics.Drawing
* @systemapi
* @since 12
*/
positiveCoefficient: [number, number, number];
/**
* Defines the brightness negativeCoefficient.
*
* @type { [number, number, number] }
* @syscap SystemCapability.Graphics.Drawing
* @systemapi
* @since 12
*/
negativeCoefficient: [number, number, number];
/**
* Defines the brightness fraction.
*
* @type { number }
* @syscap SystemCapability.Graphics.Drawing
* @systemapi
* @since 12
*/
fraction: number;
}
/**
* Create a Filter to add multiple effects to the component.
* @returns { Filter } Returns the head node of Filter.
* @syscap SystemCapability.Graphics.Drawing
* @since 12
*/
function createFilter(): Filter;
/**
* Create a VisualEffect to add multiple effects to the component.
* @returns { VisualEffect } Returns the head node of visualEffect.
* @syscap SystemCapability.Graphics.Drawing
* @since 12
*/
function createEffect(): VisualEffect;
/**
* Create a BrightnessBlender to add BrightnessBlender to the component.
* @param { BrightnessBlenderParam } param - The brightness blender parameters.
* @returns { BrightnessBlender } Returns the blender.
* @syscap SystemCapability.Graphics.Drawing
* @systemapi
* @since 12
*/
function createBrightnessBlender(param: BrightnessBlenderParam): BrightnessBlender;
}
/**
* The parameters of brightness blender.
* @typedef BrightnessBlenderParam
* @syscap SystemCapability.Graphics.Drawing
* @systemapi
* @since 12
*/
declare interface BrightnessBlenderParam {
/**
* Defines the brightness cubicRate.
*
* @type { number }
* @syscap SystemCapability.Graphics.Drawing
* @systemapi
* @since 12
*/
cubicRate: number;
/**
* Defines the brightness quadraticRate.
*
* @type { number }
* @syscap SystemCapability.Graphics.Drawing
* @systemapi
* @since 12
*/
quadraticRate: number;
/**
* Defines the brightness LinearRate.
*
* @type { number }
* @syscap SystemCapability.Graphics.Drawing
* @systemapi
* @since 12
*/
linearRate: number;
/**
* Defines the brightness degree.
*
* @type { number }
* @syscap SystemCapability.Graphics.Drawing
* @systemapi
* @since 12
*/
degree: number;
/**
* Defines the brightness saturation.
*
* @type { number }
* @syscap SystemCapability.Graphics.Drawing
* @systemapi
* @since 12
*/
saturation: number;
/**
* Defines the brightness positiveCoefficient.
*
* @type { [number, number, number] }
* @syscap SystemCapability.Graphics.Drawing
* @systemapi
* @since 12
*/
positiveCoefficient: [number, number, number];
/**
* Defines the brightness negativeCoefficient.
*
* @type { [number, number, number] }
* @syscap SystemCapability.Graphics.Drawing
* @systemapi
* @since 12
*/
negativeCoefficient: [number, number, number];
/**
* Defines the brightness fraction.
*
* @type { number }
* @syscap SystemCapability.Graphics.Drawing
* @systemapi
* @since 12
*/
fraction: number;
}
export default uiEffect;