Class Image
- 네임스페이스
- easyar
- 어셈블리
- EasyAR.Sense.dll
Image는 이미지 데이터를 저장하며, 메모리 내 이미지를 나타냅니다. Image는 원시 데이터에 대한 접근을 바이트 배열 방식으로 제공하며, width/height 등의 정보에 접근하는 인터페이스도 제공합니다. EasyAR Sense의 모든 버전에서 이미지 데이터에 접근할 수 있습니다.
iOS에서는 다음과 같이 접근할 수 있습니다
::
#import <easyar/buffer.oc.h>
#import <easyar/image.oc.h>
easyar_OutputFrame * outputFrame = [outputFrameBuffer peek];
if (outputFrame != nil) {
easyar_Image * i = [[outputFrame inputFrame] image];
easyar_Buffer * b = [i buffer];
char * bytes = calloc([b size], 1);
memcpy(bytes, [b data], [b size]);
// use bytes here
free(bytes);
}
Android에서는,
::
import cn.easyar.*;
OutputFrame outputFrame = outputFrameBuffer.peek();
if (outputFrame != null) {
InputFrame inputFrame = outputFrame.inputFrame();
Image i = inputFrame.image();
Buffer b = i.buffer();
byte[] bytes = new byte[b.size()];
b.copyToByteArray(0, bytes, 0, bytes.length);
// use bytes here
b.dispose();
i.dispose();
inputFrame.dispose();
outputFrame.dispose();
}
</p>
public class Image : RefBase, IDisposable
- 상속
-
Image
- 구현
- 상속된 멤버
생성자
Image(Buffer, PixelFormat, int, int)
public Image(Buffer buffer, PixelFormat format, int width, int height)
매개 변수
bufferformatwidthheight
메서드
Clone()
public Image Clone()
buffer()
이미지 내 데이터 버퍼를 반환합니다. `Buffer`_ API를 사용해 내부 데이터에 접근할 수 있습니다. 획득한 `Buffer`_ 데이터의 내용은 다른 스레드에서 사용 중일 수 있으므로 수정해서는 안 됩니다.
public virtual Buffer buffer()
create(Buffer, PixelFormat, int, int, int, int)
public static Image create(Buffer buffer, PixelFormat format, int width, int height, int pixelWidth, int pixelHeight)
매개 변수
bufferformatwidthheightpixelWidthpixelHeight
format()
이미지 형식을 반환합니다.
public virtual PixelFormat format()
height()
이미지 높이를 반환합니다. 이미지 데이터 아래에 pixelHeight - height 픽셀의 padding이 있습니다.
public virtual int height()
pixelHeight()
이미지 인코딩에서 사용하는 픽셀 높이를 반환합니다.
public virtual int pixelHeight()
pixelWidth()
이미지 인코딩에 사용되는 픽셀 너비를 반환합니다.
public virtual int pixelWidth()
width()
이미지 너비를 반환합니다. 이미지 데이터의 오른쪽에 pixelWidth - width 픽셀의 padding이 있습니다.
public virtual int width()