Table of Contents

Class Image

Espaço de nomes
easyar
Assembly
EasyAR.Sense.dll

Image armazena dados de imagem, representando imagens na memória. Image fornece acesso aos dados brutos através de uma matriz de bytes, bem como uma interface para acessar informações como largura/altura. Em todas as versões do EasyAR Sense, você pode acessar os dados da imagem.

 No iOS, pode ser acessado assim
 ::

     #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);
     }

 No 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
Herança
Image
Implementa
Membros herdados

Construtores

Image(Buffer, PixelFormat, int, int)

public Image(Buffer buffer, PixelFormat format, int width, int height)

Parâmetros

buffer
format
width
height

Métodos

Clone()

public Image Clone()

CloneObject()

protected override object CloneObject()

buffer()

Retorna o buffer de dados da imagem. Use a API `Buffer`_ para acessar dados internos. Não modifique o conteúdo do `Buffer`_ obtido, pois pode estar em uso por outras threads.

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)

Parâmetros

buffer
format
width
height
pixelWidth
pixelHeight

format()

Retorna o formato da imagem.

public virtual PixelFormat format()

height()

Retorna a altura da imagem. Haverá padding de pixelHeight - height pixels abaixo dos dados da imagem.

public virtual int height()

pixelHeight()

Retorna a altura de pixel usada na codificação da imagem.

public virtual int pixelHeight()

pixelWidth()

Retorna a largura de pixel usada na codificação da imagem.

public virtual int pixelWidth()

width()

Retorna a largura da imagem. Haverá padding de pixelWidth - width pixels à direita dos dados da imagem.

public virtual int width()