Image speichert Bilddaten und stellt ein Bild im Arbeitsspeicher dar.
Image bietet Zugriff auf Rohdaten als Byte-Array sowie Schnittstellen für Informationen wie Breite/Höhe.
In allen EasyAR Sense-Versionen können Sie auf Bilddaten zugreifen.
In iOS erfolgt der Zugriff so:
#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]);
// bytes hier verwenden
free(bytes);
}
In 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);
// bytes hier verwenden
b.dispose();
i.dispose();
inputFrame.dispose();
outputFrame.dispose();
}
void easyar_Image__ctor(easyar_Buffer * buffer, easyar_PixelFormat format, int width, int height, easyar_Image * * Return)
Image(std::shared_ptr<Buffer> buffer, PixelFormat format, int width, int height)
public Image(@Nonnull Buffer buffer, int format, int width, int height)
constructor(buffer: Buffer, format: Int, width: Int, height: Int)
+ (easyar_Image *) create:(easyar_Buffer *)buffer format:(easyar_PixelFormat)format width:(int)width height:(int)height
public convenience init(_ buffer: Buffer, _ format: PixelFormat, _ width: Int32, _ height: Int32)
public Image(Buffer buffer, PixelFormat format, int width, int height)
void easyar_Image_buffer(const easyar_Image * This, easyar_Buffer * * Return)
std::shared_ptr<Buffer> buffer()
public @Nonnull Buffer buffer()
- (easyar_Buffer *)buffer
public func buffer() -> Buffer
public virtual Buffer buffer()
void easyar_Image_create(easyar_Buffer * buffer, easyar_PixelFormat format, int width, int height, int pixelWidth, int pixelHeight, easyar_Image * * Return)
static std::shared_ptr<Image> create(std::shared_ptr<Buffer> buffer, PixelFormat format, int width, int height, int pixelWidth, int pixelHeight)
public static @Nonnull Image create(@Nonnull Buffer buffer, int format, int width, int height, int pixelWidth, int pixelHeight)
companion object fun create(buffer: Buffer, format: Int, width: Int, height: Int, pixelWidth: Int, pixelHeight: Int): Image
+ (easyar_Image *)create:(easyar_Buffer *)buffer format:(easyar_PixelFormat)format width:(int)width height:(int)height pixelWidth:(int)pixelWidth pixelHeight:(int)pixelHeight
public static func create(_ buffer: Buffer, _ format: PixelFormat, _ width: Int32, _ height: Int32, _ pixelWidth: Int32, _ pixelHeight: Int32) -> Image
public static Image create(Buffer buffer, PixelFormat format, int width, int height, int pixelWidth, int pixelHeight)