import type { NobjcObject } from "objc-js";
import type { _MTLBuffer } from "./MTLBuffer.js";
import type { _MTLDevice } from "./MTLDevice.js";
import type { _MTLResource } from "./MTLResource.js";
import type { _MTLSharedTextureHandle } from "./MTLSharedTextureHandle.js";
import type { _MTLTextureViewDescriptor } from "./MTLTextureViewDescriptor.js";
import type { MTLRegion } from "../structs/MTLRegion.js";
import type { MTLResourceID } from "../structs/MTLResourceID.js";
import type { MTLTextureSwizzleChannels } from "../structs/MTLTextureSwizzleChannels.js";
import type { NSRange } from "../structs/NSRange.js";
import type { MTLPixelFormat } from "./MTLPixelFormat.js";
import type { MTLTextureCompressionType } from "./MTLTextureCompressionType.js";
import type { MTLTextureSparseTier } from "./MTLTextureSparseTier.js";
import type { MTLTextureType } from "./MTLTextureType.js";
import type { MTLTextureUsage } from "./MTLTextureUsage.js";
export interface _MTLTexture extends _MTLResource {
    /**
     * @method getBytes:bytesPerRow:bytesPerImage:fromRegion:mipmapLevel:slice: @abstract Copies a block of pixels from a texture slice into the application's memory.
     */
    getBytes$bytesPerRow$bytesPerImage$fromRegion$mipmapLevel$slice$?(pixelBytes: Uint8Array, bytesPerRow: number, bytesPerImage: number, region: MTLRegion, level: number, slice: number): void;
    /**
     * @method replaceRegion:mipmapLevel:slice:withBytes:bytesPerRow:bytesPerImage: @abstract Copy a block of pixel data from the caller's pointer into a texture slice.
     */
    replaceRegion$mipmapLevel$slice$withBytes$bytesPerRow$bytesPerImage$?(region: MTLRegion, level: number, slice: number, pixelBytes: Uint8Array, bytesPerRow: number, bytesPerImage: number): void;
    /**
     * @method getBytes:bytesPerRow:fromRegion:mipmapLevel: @abstract Convenience for getBytes:bytesPerRow:bytesPerImage:fromRegion:mipmapLevel:slice: that doesn't require slice related arguments
     */
    getBytes$bytesPerRow$fromRegion$mipmapLevel$?(pixelBytes: Uint8Array, bytesPerRow: number, region: MTLRegion, level: number): void;
    /**
     * @method replaceRegion:mipmapLevel:withBytes:bytesPerRow: @abstract Convenience for replaceRegion:mipmapLevel:slice:withBytes:bytesPerRow:bytesPerImage: that doesn't require slice related arguments
     */
    replaceRegion$mipmapLevel$withBytes$bytesPerRow$?(region: MTLRegion, level: number, pixelBytes: Uint8Array, bytesPerRow: number): void;
    /**
     * @method newTextureViewWithPixelFormat: @abstract Create a new texture which shares the same storage as the source texture, but with a different (but compatible) pixel format.
     */
    newTextureViewWithPixelFormat$?(pixelFormat: MTLPixelFormat): _MTLTexture | null;
    /**
     * @method newTextureViewWithPixelFormat:textureType:levels:slices: @abstract Create a new texture which shares the same storage as the source texture, but with a different (but compatible) pixel format, texture type, levels and slices.
     */
    newTextureViewWithPixelFormat$textureType$levels$slices$?(pixelFormat: MTLPixelFormat, textureType: MTLTextureType, levelRange: NSRange, sliceRange: NSRange): _MTLTexture | null;
    /**
     * @method newSharedTextureHandle @abstract Create a new texture handle, that can be shared across process addres space boundaries.
     */
    newSharedTextureHandle?(): _MTLSharedTextureHandle | null;
    /**
     * @method newTextureViewWithDescriptor: @abstract Create a new texture which shares the same storage as the source texture, but with different (but compatible) properties specified by the descriptor
     */
    newTextureViewWithDescriptor$?(descriptor: _MTLTextureViewDescriptor): _MTLTexture | null;
    /**
     * @method newRemoteTextureViewForDevice: @abstract On Metal devices that support peer to peer transfers, this method is used to create a remote texture view on another device within the peer group. The receiver must use MTLStorageModePrivate or be backed by an IOSurface.
     */
    newRemoteTextureViewForDevice$?(device: _MTLDevice): _MTLTexture | null;
    /**
     * @method newTextureViewWithPixelFormat:textureType:levels:slices:swizzle: @abstract Create a new texture which shares the same storage as the source texture, but with a different (but compatible) pixel format, texture type, levels, slices and swizzle.
     */
    newTextureViewWithPixelFormat$textureType$levels$slices$swizzle$?(pixelFormat: MTLPixelFormat, textureType: MTLTextureType, levelRange: NSRange, sliceRange: NSRange, swizzle: MTLTextureSwizzleChannels): _MTLTexture | null;
    /**
     * @property rootResource @abstract The resource this texture was created from. It may be a texture or a buffer. If this texture is not reusing storage of another MTLResource, then nil is returned.
     * @deprecated Use parentTexture or buffer instead
     */
    rootResource?(): _MTLResource | null;
    /**
     * @property parentTexture @abstract The texture this texture view was created from, or nil if this is not a texture view or it was not created from a texture.
     */
    parentTexture?(): _MTLTexture | null;
    /**
     * @property parentRelativeLevel @abstract The base level of the texture this texture view was created from, or 0 if this is not a texture view.
     */
    parentRelativeLevel?(): number;
    /**
     * @property parentRelativeSlice @abstract The base slice of the texture this texture view was created from, or 0 if this is not a texture view.
     */
    parentRelativeSlice?(): number;
    /**
     * @property buffer @abstract The buffer this texture view was created from, or nil if this is not a texture view or it was not created from a buffer.
     */
    buffer?(): _MTLBuffer | null;
    /**
     * @property bufferOffset @abstract The offset of the buffer this texture view was created from, or 0 if this is not a texture view.
     */
    bufferOffset?(): number;
    /**
     * @property bufferBytesPerRow @abstract The bytesPerRow of the buffer this texture view was created from, or 0 if this is not a texture view.
     */
    bufferBytesPerRow?(): number;
    /**
     * @property iosurface @abstract If this texture was created from an IOSurface, this returns a reference to that IOSurface. iosurface is nil if this texture was not created from an IOSurface.
     */
    iosurface?(): NobjcObject;
    /**
     * @property iosurfacePlane @abstract If this texture was created from an IOSurface, this returns the plane of the IOSurface from which the texture was created. iosurfacePlane is 0 if this texture was not created from an IOSurface.
     */
    iosurfacePlane?(): number;
    /** @property type @abstract The type of this texture. */
    textureType?(): MTLTextureType;
    /**
     * @property pixelFormat @abstract The MTLPixelFormat that is used to interpret this texture's contents.
     */
    pixelFormat?(): MTLPixelFormat;
    /** @property width @abstract The width of the MTLTexture instance in pixels. */
    width?(): number;
    /**
     * @property height @abstract The height of the MTLTexture instance in pixels. @discussion. height is 1 if the texture is 1D.
     */
    height?(): number;
    /**
     * @property depth @abstract The depth of this MTLTexture instance in pixels. @discussion If this MTLTexture is not a 3D texture, the depth is 1
     */
    depth?(): number;
    /**
     * @property mipmapLevelCount @abstract The number of mipmap levels in each slice of this MTLTexture.
     */
    mipmapLevelCount?(): number;
    /**
     * @property sampleCount @abstract The number of samples in each pixel of this MTLTexture. @discussion If this texture is any type other than 2DMultisample, samples is 1.
     */
    sampleCount?(): number;
    /**
     * @property arrayLength @abstract The number of array elements in this MTLTexture. @discussion For non-Array texture types, arrayLength is 1.
     */
    arrayLength?(): number;
    /** @property usage @abstract Description of texture usage. */
    usage?(): MTLTextureUsage;
    /**
     * @property shareable @abstract If YES, this texture can be shared with other processes. @discussion Texture can be shared across process addres space boundaries through use of sharedTextureHandle and XPC.
     */
    shareable?(): boolean;
    /**
     * @property framebufferOnly @abstract If YES, this texture can only be used with a MTLAttachmentDescriptor, and cannot be used as a texture argument for MTLRenderCommandEncoder, MTLBlitCommandEncoder, or MTLComputeCommandEncoder. Furthermore, when this property's value is YES, readPixels/writePixels may not be used with this texture. @discussion Textures obtained from CAMetalDrawables may have this property set to YES, depending on the value of frameBufferOnly passed to their parent CAMetalLayer. Textures created directly by the application will not have any restrictions.
     */
    framebufferOnly?(): boolean;
    /**
     * @property firstMipmapInTail @abstract For sparse textures this property returns index of first mipmap that is packed in tail. Mapping this mipmap level will map all subsequent mipmap levels.
     */
    firstMipmapInTail?(): number;
    /**
     * @property tailSizeInBytes @abstract Amount of memory in bytes required to map sparse texture tail.
     */
    tailSizeInBytes?(): number;
    isSparse?(): boolean;
    /**
     * @property allowGPUOptimizedContents @abstract Allow GPU-optimization for the contents texture. The default value is true. @discussion Useful for opting-out of GPU-optimization when implicit optimization (e.g. RT writes) is regressing CPU-read-back performance. See the documentation for optimizeContentsForGPUAccess: and optimizeContentsForCPUAccess: APIs.
     */
    allowGPUOptimizedContents?(): boolean;
    /**
     * @property compressionType @abstract Returns the compression type of the texture @discussion See the compressionType property on MTLTextureDescriptor
     */
    compressionType?(): MTLTextureCompressionType;
    /**
     * @property gpuResourceID @abstract Handle of the GPU resource suitable for storing in an Argument Buffer
     */
    gpuResourceID?(): MTLResourceID;
    /**
     * @property remoteStorageTexture @abstract For Metal texture objects that are remote views, this returns the texture associated with the storage on the originating device.
     */
    remoteStorageTexture?(): _MTLTexture;
    /**
     * @property swizzle @abstract The channel swizzle used when reading or sampling from this texture
     */
    swizzle?(): MTLTextureSwizzleChannels;
    /** @property sparseTextureTier @abstract Query support tier for sparse textures. */
    sparseTextureTier?(): MTLTextureSparseTier;
}
