engine.readTexture.d.ts 1.6 KB

12345678910111213141516171819
  1. import type { InternalTexture } from "../../Materials/Textures/internalTexture";
  2. import type { Nullable } from "../../types";
  3. declare module "../../Engines/thinEngine" {
  4. interface ThinEngine {
  5. /** @internal */
  6. _readTexturePixels(texture: InternalTexture, width: number, height: number, faceIndex?: number, level?: number, buffer?: Nullable<ArrayBufferView>, flushRenderer?: boolean, noDataConversion?: boolean, x?: number, y?: number): Promise<ArrayBufferView>;
  7. /** @internal */
  8. _readTexturePixelsSync(texture: InternalTexture, width: number, height: number, faceIndex?: number, level?: number, buffer?: Nullable<ArrayBufferView>, flushRenderer?: boolean, noDataConversion?: boolean, x?: number, y?: number): ArrayBufferView;
  9. }
  10. }
  11. /**
  12. * Allocate a typed array depending on a texture type. Optionally can copy existing data in the buffer.
  13. * @param type type of the texture
  14. * @param sizeOrDstBuffer size of the array OR an existing buffer that will be used as the destination of the copy (if copyBuffer is provided)
  15. * @param sizeInBytes true if the size of the array is given in bytes, false if it is the number of elements of the array
  16. * @param copyBuffer if provided, buffer to copy into the destination buffer (either a newly allocated buffer if sizeOrDstBuffer is a number or use sizeOrDstBuffer as the destination buffer otherwise)
  17. * @returns the allocated buffer or sizeOrDstBuffer if the latter is an ArrayBuffer
  18. */
  19. export declare function allocateAndCopyTypedBuffer(type: number, sizeOrDstBuffer: number | ArrayBuffer, sizeInBytes?: boolean, copyBuffer?: ArrayBuffer): ArrayBufferView;