Table of Contents

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)

パラメーター

buffer
format
width
height

メソッド

Clone()

public Image Clone()

CloneObject()

protected override object CloneObject()

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)

パラメーター

buffer
format
width
height
pixelWidth
pixelHeight

format()

画像フォーマットを返します。

public virtual PixelFormat format()

height()

画像の高さを返します。画像データの下方には pixelHeight-height ピクセルのパディングがあります。

public virtual int height()

pixelHeight()

画像エンコード時に使用されるピクセル高さを返します。

public virtual int pixelHeight()

pixelWidth()

画像エンコード時に使用されるピクセル幅を返します。

public virtual int pixelWidth()

width()

画像の幅を返します。画像データの右側には pixelWidth-width ピクセルのパディングがあります。

public virtual int width()