Table of Contents

Class Buffer

네임스페이스
easyar
어셈블리
EasyAR.Sense.dll

Buffer 는 원시 바이트 배열을 저장하며 이미지 데이터에 접근하는 데 사용할 수 있습니다. Java API 에서는 `Image`_ 에서 buffer 를 얻은 다음 데이터를 Java 바이트 배열로 copy 할 수 있습니다. EasyAR Sense 의 모든 버전에서 이미지 데이터에 접근할 수 있습니다. `Image`_ 를 참조하세요.

public class Buffer : RefBase, IDisposable
상속
Buffer
구현
상속된 멤버

메서드

Clone()

public Buffer Clone()

copyFromByteArray(byte[])

public void copyFromByteArray(byte[] src)

매개 변수

src

copyFromByteArray(byte[], int, int, int)

public void copyFromByteArray(byte[] src, int srcIndex, int index, int length)

매개 변수

src
srcIndex
index
length

copyToByteArray(byte[])

public void copyToByteArray(byte[] dest)

매개 변수

dest

copyToByteArray(int, byte[], int, int)

public void copyToByteArray(int index, byte[] dest, int destIndex, int length)

매개 변수

index
dest
destIndex
length

create(int)

지정된 바이트 길이의 Buffer 를 만듭니다.

public static Buffer create(int size)

매개 변수

size

data()

원시 메모리 주소를 반환합니다.

public virtual IntPtr data()

memoryCopy(IntPtr, IntPtr, int)

원시 메모리를 복사합니다. 주로 메모리 작업이 불완전한 언어 또는 환경에서 사용됩니다.

public static void memoryCopy(IntPtr src, IntPtr dest, int length)

매개 변수

src
dest
length

partition(int, int)

하위 Buffer 를 만들고 원본 Buffer 를 참조합니다. Buffer 는 모든 하위 Buffer 가 해제된 후에만 해제됩니다.

public virtual Buffer partition(int index, int length)

매개 변수

index
length

size()

Buffer 의 바이트 길이입니다.

public virtual int size()

tryCopyFrom(IntPtr, int, int, int)

원시 메모리 주소에서 Buffer 로 데이터를 복사하려고 시도합니다. 복사에 성공하면 true 를, 그렇지 않으면 false 를 반환합니다. 실패 원인은 소스 데이터 범위 또는 대상 데이터 범위가 사용 가능한 범위를 초과하는 경우입니다.

public virtual bool tryCopyFrom(IntPtr src, int srcIndex, int index, int length)

매개 변수

src
srcIndex
index
length

tryCopyTo(int, IntPtr, int, int)

Buffer 에서 원시 메모리 주소로 데이터를 복사하려고 시도합니다. 복사에 성공하면 true 를, 그렇지 않으면 false 를 반환합니다. 실패 원인은 소스 데이터 범위 또는 대상 데이터 범위가 사용 가능한 범위를 초과하는 경우입니다.

public virtual bool tryCopyTo(int index, IntPtr dest, int destIndex, int length)

매개 변수

index
dest
destIndex
length

wrap(IntPtr, int, Action)

지정된 길이의 원시 메모리 블록을 래핑합니다. Buffer 가 완전히 해제되면 deleter 콜백이 호출되어 사용자 정의 메모리 폐기 동작을 실행합니다. deleter 는 thread-safe 해야 합니다.

public static Buffer wrap(IntPtr ptr, int size, Action deleter)

매개 변수

ptr
size
deleter

wrapByteArray(byte[])

public static Buffer wrapByteArray(byte[] bytes)

매개 변수

bytes

wrapByteArray(byte[], int, int)

public static Buffer wrapByteArray(byte[] bytes, int index, int length)

매개 변수

bytes
index
length

wrapByteArray(byte[], int, int, Action)

public static Buffer wrapByteArray(byte[] bytes, int index, int length, Action deleter)

매개 변수

bytes
index
length
deleter