@itwin/core-backend
Version:
iTwin.js backend components
58 lines • 3.17 kB
TypeScript
/** @packageDocumentation
* @module Elements
*/
import { Id64String } from "@itwin/core-bentley";
import { Base64EncodedString, Code, CodeScopeProps, ImageSourceFormat, TextureProps } from "@itwin/core-common";
import { DefinitionElement } from "./Element";
import { IModelDb } from "./IModelDb";
/** A [TextureProps]($common) in which the image data can be specified either as a base-64-encoded string or a Uint8Array.
* @see [[Texture]] constructor.
* @beta
*/
export interface TextureCreateProps extends Omit<TextureProps, "data"> {
data: Base64EncodedString | Uint8Array;
}
/** Defines a rendering texture that is associated with a Material and applied to surface geometry.
* @public @preview
*/
export declare class Texture extends DefinitionElement {
/** @internal */
static get className(): string;
format: ImageSourceFormat;
data: Uint8Array;
description?: string;
/** @beta */
protected constructor(props: TextureCreateProps, iModel: IModelDb);
toJSON(): TextureProps;
/** Create a Code for a Texture given a name that is meant to be unique within the scope of the specified DefinitionModel.
* @param iModel The IModelDb
* @param scopeModelId The Id of the DefinitionModel that contains the Texture and provides the scope for its name.
* @param name The Texture name
*/
static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, name: string): Code;
/** Create a texture with the given parameters.
* @param iModelDb The iModel to contain the texture.
* @param definitionModelId The [[DefinitionModel]] to contain the texture.
* @param name The name to serve as the texture's [Code]($common) value.
* @param format The format of the image data.
* @param data The image data in the format specified by `format`.
* @param description An optional description of the texture
* @returns The newly constructed Texture element.
* @throws [[IModelError]] if unable to create the element.
* @see [[insertTexture]] to insert a new texture into the iModel.
*/
static createTexture(iModelDb: IModelDb, definitionModelId: Id64String, name: string, format: ImageSourceFormat, data: Uint8Array | Base64EncodedString, description?: string): Texture;
/** Insert a new texture into a [[DefinitionModel]].
* @param iModelDb The iModel to contain the texture.
* @param definitionModelId The [[DefinitionModel]] to contain the texture.
* @param name The name to serve as the texture's [Code]($common) value.
* @param format The format of the image data.
* @param data The image data in the format specified by `format`.
* @param description An optional description of the texture
* @returns The Id of the newly-inserted texture element.
* @throws [[IModelError]] if unable to insert the element.
* @see [[insertTexture]] to insert a new texture into the iModel.
*/
static insertTexture(iModelDb: IModelDb, definitionModelId: Id64String, name: string, format: ImageSourceFormat, data: Uint8Array | Base64EncodedString, description?: string): Id64String;
}
//# sourceMappingURL=Texture.d.ts.map