Table of Contents

Class Image

Espacio de nombres
easyar
Ensayo
EasyAR.Sense.dll

Image almacena datos de imagen, utilizados para representar imágenes en la memoria. Image proporciona acceso a los datos originales en forma de arreglo de bytes, y también ofrece una interfaz para acceder a información como ancho (width) y alto (height). En todas las versiones de EasyAR Sense, puedes acceder a los datos de imagen.

 En iOS, puedes acceder así:
 ::

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

 En 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
Herencia
Image
Implementa
Miembros heredados

Constructores

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()

Devuelve el búfer de datos de la imagen. Puedes usar la API `Buffer`_ para acceder a los datos internos. No debes modificar el contenido del búfer `Buffer`_ obtenido, porque este contenido puede estar siendo utilizado en otros hilos.

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()

Devuelve el formato de la imagen.

public virtual PixelFormat format()

height()

Devuelve la altura de la imagen. Habrá un relleno (padding) de pixelHeight - height píxeles debajo de los datos de la imagen.

public virtual int height()

pixelHeight()

Devuelve la altura en píxeles utilizada al codificar la imagen.

public virtual int pixelHeight()

pixelWidth()

Devuelve el ancho en píxeles utilizado al codificar la imagen.

public virtual int pixelWidth()

width()

Devuelve el ancho de la imagen. Habrá un relleno (padding) de pixelWidth - width píxeles a la derecha de los datos de la imagen.

public virtual int width()