import { Blend, BlendFunction, BlendFunctionOption, BlendOption } from './../enums'; /** * Options to be converted into {@link IBlendState} via {@link BlendState.convert} * * @public */ export interface BlendStateOptions { colorBlendFunction?: BlendFunctionOption; alphaBlendFunction?: BlendFunctionOption; colorSrcBlend?: BlendOption; alphaSrcBlend?: BlendOption; colorDstBlend?: BlendOption; alphaDstBlend?: BlendOption; constantR?: number; constantG?: number; constantB?: number; constantA?: number; enable?: boolean; } /** * An object with all blend state parameters * * @public */ export interface IBlendState { colorBlendFunction: BlendFunction; alphaBlendFunction: BlendFunction; colorSrcBlend: Blend; alphaSrcBlend: Blend; colorDstBlend: Blend; alphaDstBlend: Blend; constantR: number; constantG: number; constantB: number; constantA: number; enable: boolean; } /** * Represents a sub set of {@link IBlendState} * * @public */ export declare type BlendStateParams = Partial; /** * @public */ export declare class BlendState implements IBlendState { protected $colorBlendFunction: BlendFunction; protected $alphaBlendFunction: BlendFunction; protected $colorSrcBlend: Blend; protected $alphaSrcBlend: Blend; protected $colorDstBlend: Blend; protected $alphaDstBlend: Blend; protected $constantR: number; protected $constantG: number; protected $constantB: number; protected $constantA: number; protected $enable: boolean; protected $hasChanged: boolean; protected $changes: BlendStateParams; /** * Indicates whether the state has changes which are not committed to the GPU */ get isDirty(): boolean; /** * Gets a readable name of the color blend function */ get colorBlendFunctionName(): string; /** * Gets and sets the color blend function */ get colorBlendFunction(): BlendFunction; set colorBlendFunction(value: BlendFunction); /** * Gets a readable name of the alpha blend function */ get alphaBlendFunctionName(): string; /** * Gets and sets the alpha blend function */ get alphaBlendFunction(): BlendFunction; set alphaBlendFunction(value: BlendFunction); /** * Gets a readable name of the blend factor for the source color */ get colorSrcBlendName(): string; /** * Gets and sets the blend factor for the source color */ get colorSrcBlend(): Blend; set colorSrcBlend(value: Blend); /** * Gets a readable name of the blend factor for the source alpha */ get alphaSrcBlendName(): string; /** * Gets and sets the blend factor for the source alpha */ get alphaSrcBlend(): Blend; set alphaSrcBlend(value: Blend); /** * Gets a readable name of the blend factor for the destination color */ get colorDstBlendName(): string; /** * Gets and sets the blend factor for the destination color */ get colorDstBlend(): Blend; set colorDstBlend(value: Blend); /** * Gets a readable name of the blend factor for the destination alpha */ get alphaDstBlendName(): string; /** * Gets and sets the blend factor for the destination alpha */ get alphaDstBlend(): Blend; set alphaDstBlend(value: Blend); /** * Gets and sets the red component of the blend color */ get constantR(): number; set constantR(value: number); /** * Gets and sets the green component of the blend color */ get constantG(): number; set constantG(value: number); /** * Gets and sets the blue component of the blend color */ get constantB(): number; set constantB(value: number); /** * Gets and sets the alpha component of the blend color */ get constantA(): number; set constantA(value: number); /** * Enables or disables blending functionality */ get enable(): boolean; set enable(value: boolean); /** * Assigns multiple parameters to the current state */ assign(state: BlendStateParams): this; /** * Uploads all changes to the GPU * * @param state - State changes to be assigned before committing */ commit(state?: BlendStateParams): this; /** * Creates a copy of this state state */ copy(): IBlendState; /** * Creates a copy of this state and writes it into the target object * * @param target - Where the state should be written to */ copy(target: T): T & IBlendState; protected commitChanges(changes: Partial): void; protected clearChanges(): void; /** * Converts a state name or options into {@link BlendStateParams} * * @param state - The state name or state options to convert */ static convert(state: string | BlendStateOptions): BlendStateParams; /** * A default blend state where blending is disabled */ static readonly Default: Readonly; /** * A blend state with disabled blending */ static readonly None: Readonly; /** * A blend state for additive blending */ static readonly Additive: Readonly; /** * A blend state for pre multiplied alpha blending */ static readonly AlphaBlend: Readonly; /** * A blend state for non pre multiplied alpha blending */ static readonly NonPremultiplied: Readonly; } //# sourceMappingURL=BlendState.d.ts.map