import type { NobjcObject } from "objc-js";
import type { _NSDictionary } from "../Foundation/NSDictionary.js";
import type { _NSObject } from "../Foundation/NSObject.js";
import type { _NSSecureCoding } from "../Foundation/NSSecureCoding.js";
import type { _NSString } from "../Foundation/NSString.js";
export declare class _IOSurface extends _NSObject {
    static alloc(): _IOSurface;
    static new(): _IOSurface;
    init(): _IOSurface;
    /** Create a new IOSurface */
    initWithProperties$(properties: _NSDictionary): _IOSurface | null;
    /**
     * "Lock" or "Unlock" a IOSurface for reading or writing. The term "lock" is used loosely in this context, and is simply used along with the "unlock" information to put a bound on CPU access to the raw IOSurface data. If the seed parameter is non-NULL, IOSurfaceLock() will store the buffer's internal modification seed value at the time you made the lock call. You can compare this value to a value returned previously to determine of the contents of the buffer has been changed since the last lock. In the case of IOSurfaceUnlock(), the seed value returned will be the internal seed value at the time of the unlock. If you locked the buffer for writing, this value will be incremented as the unlock is performed and the new value will be returned. See the IOSurfacePropertyKeyLock enums for more information. Note: Locking and unlocking a IOSurface is not a particularly cheap operation, so care should be taken to avoid the calls whenever possible. The seed values are particularly useful for keeping a cache of the buffer contents.
     */
    lockWithOptions$seed$(options: NobjcObject, seed: NobjcObject | null): number;
    unlockWithOptions$seed$(options: NobjcObject, seed: NobjcObject | null): number;
    /**
     * These properties return information about a particular plane of a IOSurface. They will raise if called on non-planar surfaces or if the index value is not less than the number of planes.
     */
    widthOfPlaneAtIndex$(planeIndex: number): number;
    heightOfPlaneAtIndex$(planeIndex: number): number;
    bytesPerRowOfPlaneAtIndex$(planeIndex: number): number;
    bytesPerElementOfPlaneAtIndex$(planeIndex: number): number;
    elementWidthOfPlaneAtIndex$(planeIndex: number): number;
    elementHeightOfPlaneAtIndex$(planeIndex: number): number;
    baseAddressOfPlaneAtIndex$(planeIndex: number): NobjcObject;
    /**
     * These calls let you attach property list types to a IOSurface buffer. These calls are expensive (they essentially must serialize the data into the kernel) and thus should be avoided whenever possible. Note: These functions can not be used to change the underlying surface properties.
     */
    setAttachment$forKey$(anObject: NobjcObject, key: _NSString): void;
    attachmentForKey$(key: _NSString): NobjcObject | null;
    removeAttachmentForKey$(key: _NSString): void;
    setAllAttachments$(dict: _NSDictionary): void;
    allAttachments(): _NSDictionary | null;
    removeAllAttachments(): void;
    incrementUseCount(): void;
    decrementUseCount(): void;
    /** See comments in IOSurfaceAPI.h */
    setPurgeable$oldState$(newState: NobjcObject, oldState: NobjcObject | null): number;
    /** The total allocation size of the IOSurface */
    allocationSize(): number;
    /** Basic surface layout information */
    width(): number;
    height(): number;
    baseAddress(): NobjcObject;
    pixelFormat(): number;
    /** Note: These properties may not return well-defined values for planar surfaces */
    bytesPerRow(): number;
    bytesPerElement(): number;
    elementWidth(): number;
    elementHeight(): number;
    surfaceID(): number;
    /**
     * This will return the current seed value of the buffer and is a cheap property to read to see if the contents of the buffer have changed since the last lock/unlock.
     */
    seed(): number;
    /**
     * Return the number of planes in this buffer. Will be 0 if the surface is non-planar
     */
    planeCount(): number;
    /**
     * There are cases where it is useful to know whether or not an IOSurface buffer is considered to be "in use" by other users of the same IOSurface. In particular, CoreVideo and other APIs make use of the IOSurface use count facility to know when it is safe to recycle an IOSurface backed CVPixelBuffer object. This is particularly important when IOSurface objects are being shared across process boundaries and the normal mechanisms one might use would not be viable. The IOSurface use count is similar in concept to any other reference counting scheme. When the global use count of an IOSurface goes to zero, it is no longer considered "in use". When it is anything other than zero, then the IOSurface is still "in use" by someone and therefore anyone attempting to maintain a pool of IOSurfaces to be recycled should not reclaim that IOSurface. Note that IOSurface maintains both a per-process and an internal system wide usage count. In the current implementation, when the per-process usage count goes from zero to one, the system wide usage count is incremented by one. When the per-process usage count drops back to zero (either via explicit decrement calls or the process terminates), the global usage count is decremented by one.
     */
    inUse(): boolean;
    /**
     * The localUseCount property returns the local per-process usage count for an IOSurface. This call is only provided for logging/debugging purposes and should never be used to determine whether an IOSurface is considered to be "in use". The isInUse property is the only call that should be used for that purpose.
     */
    localUseCount(): number;
    /**
     * This property returns YES if it is legal to choose an OpenGL or Metal pixel format with a bytes per pixel value that is different than the bytesPerElement value(s) of this IOSurface. Returns NO if the bytes per pixel value must be an exact match.
     */
    allowsPixelSizeCasting(): boolean;
}
export interface _IOSurface extends _NSSecureCoding {
}
