Table of Contents

Class Image

Namespace
easyar
Assembly
EasyAR.Sense.dll

Image stores image data and is used to represent an image in memory. Image provides access to raw data as a byte array, and also provides interfaces for accessing information such as width/height. In all versions of EasyAR Sense, you can access image data. On iOS, you can access it like this :: #import #import 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); } On 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(); }

public class Image : RefBase, IDisposable
Inheritance
Image
Implements
Inherited Members

Methods

Clone()

public Image Clone()

buffer()

Returns the data buffer in the image. The `Buffer`_ API can be used to access internal data. The contents of the obtained `Buffer`_ should not be modified, because they may be used in other 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)

Parameters

buffer
format
width
height
pixelWidth
pixelHeight

format()

Returns the image format.

public virtual PixelFormat format()

height()

Returns the image height. There will be pixelHeight - height pixels of padding below the image data.

public virtual int height()

pixelHeight()

Returns the pixel height used when encoding the image.

public virtual int pixelHeight()

pixelWidth()

Returns the pixel width used when encoding the image.

public virtual int pixelWidth()

width()

Returns the image width. There will be pixelWidth - width pixels of padding on the right side of the image data.

public virtual int width()