C# 클래스 CrystalMpq.DataFormats.Surface

Represents a surface of image data.
상속: IDisposable, ICloneable
파일 보기 프로젝트 열기: sgraf812/crystalmpq 1 사용 예제들

공개 메소드들

메소드 설명
Clone ( ) : object
CopyToArgb ( SurfaceData surfaceData ) : void

Copies the contents of the surface to a buffer of same dimensions.

The destination buffer should use the ARGB format represented by ArgbColor. Some basic checks will be done to disallow invalid buffer informations. However, it is the responsibility of the caller to provide a valid destination buffer.

CreateStream ( ) : Stream

Creates a stream for accessing the surface data.

The returned stream can be used for reading the surface data, and, for some surface formats, to modify the surface data.

Dispose ( ) : void
Lock ( ) : SurfaceData

Locks the surface for direct read/write access.

Unlock must be called once direct buffer access is not needed anymore. Forgetting to unlock a locked surface is likely to prevent the buffer from being disposed, thus causing a memory leak. Neither Dispose nor Finalize will unlock the surface, for safety reasons.

Surface ( int width, int height, byte alphaBitCount, bool alphaPremultiplied = false ) : System

Initializes a new instance of the Surface class.

The following restriction is imposed on width and height: The size in bytes of the uncompressed ARGB data for a given surface must fit into an Int32.

ToArray ( ) : byte[]

Gets a copy of the buffer's contents.

Unlock ( ) : void

보호된 메소드들

메소드 설명
CopyToArgbInternal ( SurfaceData surfaceData ) : void
Dispose ( bool disposing ) : void

Releases unmanaged and - optionally - managed resources.

Implementation in the base class do nothing.

LockInternal ( int &stride ) : IntPtr

Locks the surface for direct read/write access.

Surface ( Surface surface ) : System

Initializes a new instance of the Surface class by copying data from another Surface.

The base implementation in Surface only copies the common surface characteristics. Copying the actual surface data needs to be done by subclasses overriding this constructor.

UnlockInternal ( ) : void
ValidateDimensions ( int width, int height ) : void

Validates the specified surface dimensions.

This method should throw an ArgumentOutOfRangeException if any of the two dimensions are not allowed. If the combination of width and height is not allowed, ArgumentException should be thrown. Note that the method will be called before object initialization. Thus, the instance should not be used at all from this method.

메소드 상세

Clone() 공개 메소드

public Clone ( ) : object
리턴 object

CopyToArgb() 공개 메소드

Copies the contents of the surface to a buffer of same dimensions.
The destination buffer should use the ARGB format represented by ArgbColor. Some basic checks will be done to disallow invalid buffer informations. However, it is the responsibility of the caller to provide a valid destination buffer.
The dimensions of the buffer specified by do not match those of the surface. The stride in does not match the width.
public CopyToArgb ( SurfaceData surfaceData ) : void
surfaceData SurfaceData Information on the destination buffer.
리턴 void

CopyToArgbInternal() 보호된 추상적인 메소드

protected abstract CopyToArgbInternal ( SurfaceData surfaceData ) : void
surfaceData SurfaceData
리턴 void

CreateStream() 공개 추상적인 메소드

Creates a stream for accessing the surface data.
The returned stream can be used for reading the surface data, and, for some surface formats, to modify the surface data.
public abstract CreateStream ( ) : Stream
리턴 Stream

Dispose() 공개 메소드

public Dispose ( ) : void
리턴 void

Dispose() 보호된 메소드

Releases unmanaged and - optionally - managed resources.
Implementation in the base class do nothing.
protected Dispose ( bool disposing ) : void
disposing bool true to release both managed and unmanaged resources; false to release only unmanaged resources.
리턴 void

Lock() 공개 메소드

Locks the surface for direct read/write access.
Unlock must be called once direct buffer access is not needed anymore. Forgetting to unlock a locked surface is likely to prevent the buffer from being disposed, thus causing a memory leak. Neither Dispose nor Finalize will unlock the surface, for safety reasons.
public Lock ( ) : SurfaceData
리턴 SurfaceData

LockInternal() 보호된 추상적인 메소드

Locks the surface for direct read/write access.
protected abstract LockInternal ( int &stride ) : IntPtr
stride int The stride.
리턴 System.IntPtr

Surface() 보호된 메소드

Initializes a new instance of the Surface class by copying data from another Surface.
The base implementation in Surface only copies the common surface characteristics. Copying the actual surface data needs to be done by subclasses overriding this constructor.
is null.
protected Surface ( Surface surface ) : System
surface Surface A reference surface which should be copied.
리턴 System

Surface() 공개 메소드

Initializes a new instance of the Surface class.
The following restriction is imposed on width and height: The size in bytes of the uncompressed ARGB data for a given surface must fit into an Int32.
Either or has a value that is not allowed. /// The dimensions specified by and are not allowed. /// - or - /// is true while is zero. /// - or - /// Another parameter verification has failed. ///
public Surface ( int width, int height, byte alphaBitCount, bool alphaPremultiplied = false ) : System
width int The surface width.
height int The surface height.
alphaBitCount byte The alpha bit count.
alphaPremultiplied bool If set to true, the surface uses premultiplied alpha.
리턴 System

ToArray() 공개 추상적인 메소드

Gets a copy of the buffer's contents.
public abstract ToArray ( ) : byte[]
리턴 byte[]

Unlock() 공개 메소드

public Unlock ( ) : void
리턴 void

UnlockInternal() 보호된 추상적인 메소드

protected abstract UnlockInternal ( ) : void
리턴 void

ValidateDimensions() 보호된 메소드

Validates the specified surface dimensions.
This method should throw an ArgumentOutOfRangeException if any of the two dimensions are not allowed. If the combination of width and height is not allowed, ArgumentException should be thrown. Note that the method will be called before object initialization. Thus, the instance should not be used at all from this method.
Either or has a value that is not allowed. The dimensions specified by and are not allowed.
protected ValidateDimensions ( int width, int height ) : void
width int The proposed surface width.
height int The proposed surface height.
리턴 void