import type { Fill, NormalizedFill, PipelineImage } from 'modern-idoc'; import type { AnimatedTexture } from '../../resources'; import type { Element2D } from './Element2D'; import { CoreObject } from '../../../core'; import { Texture2D } from '../../resources'; export interface Element2DFill extends NormalizedFill { } export declare class Element2DFill extends CoreObject implements NormalizedFill { protected _parent: Element2D; enabled: boolean; color?: NormalizedFill['color']; image?: NormalizedFill['image']; linearGradient?: NormalizedFill['linearGradient']; radialGradient?: NormalizedFill['radialGradient']; cropRect?: NormalizedFill['cropRect']; stretchRect?: NormalizedFill['stretchRect']; dpi?: NormalizedFill['dpi']; rotateWithShape?: NormalizedFill['rotateWithShape']; tile?: NormalizedFill['tile']; opacity?: NormalizedFill['opacity']; /** 图片处理管线;图片加载后交由注入的解析器烘焙到运行时纹理,不持久化 */ imagePipelines?: NormalizedFill['imagePipelines']; texture?: Texture2D; animatedTexture?: AnimatedTexture; constructor(_parent: Element2D); protected _setProperties(properties?: NormalizedFill): this; setProperties(properties?: Fill): this; protected _updateProperty(key: string, value: any, oldValue: any): void; loadTexture(): Promise; /** * 把原图经 `imagePipelines` 烘焙成一张运行时纹理(无管线 / 无解析器 / gif 时跳过)。 * 始终从 image 独立解码像素喂给管线,不读 `this.texture.source`(那张 ImageBitmap * 由纹理管线持有、会经 premultiply 上传/GC 而被消费)。结果按 `url + 管线` 缓存复用。 */ protected _applyImagePipelines(url: string): Promise; protected _imagePipelineKey(imagePipelines: NonNullable): string; /** 从 image 独立解码为中立像素结构(不读 GPU 纹理 source) */ protected _decodePipelineSource(url: string): Promise; protected _pipelineImageToCanvas(image: PipelineImage): HTMLCanvasElement | undefined; protected _updateTexture(): Promise; isValid(): boolean; /** Resolve `@token` theme colors lazily on draw, same as outline / text do. */ protected _resolveThemeColor(value: T): T | string; draw(): void; protected _getFrameCurrentTime(): number; updateFrameIndex(): this; process(_delta: number): void; }