Skip to content

InscoperAPI/Build/Java/com.inscoper.api/com/inscoper/api/Image.java

Packages

Name
com.inscoper.api

Classes

Name
class com.inscoper.api.Image
Image class represents an image with associated metadata.

Source code

/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (https://www.swig.org).
 * Version 4.3.1
 *
 * Do not make changes to this file unless you know what you are doing - modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package com.inscoper.api;
import com.inscoper.api.logging.*;

public class Image {
  private transient long swigCPtr;
  private transient boolean swigCMemOwn;

  protected Image(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  protected static long getCPtr(Image obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void swigSetCMemOwn(boolean own) {
    swigCMemOwn = own;
  }

  @SuppressWarnings({"deprecation", "removal"})
  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        InscoperJNI.delete_Image(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public Image(UCharVector imageData, MetadataMap metadata) {
    this(InscoperJNI.new_Image(UCharVector.getCPtr(imageData), imageData, MetadataMap.getCPtr(metadata), metadata), true);
  }

  public long getPixelSize() throws com.inscoper.api.InscoperException {
    return InscoperJNI.Image_getPixelSize(swigCPtr, this);
  }

  public long getBitDepth() throws com.inscoper.api.InscoperException {
    return InscoperJNI.Image_getBitDepth(swigCPtr, this);
  }

  public long getWidth() throws com.inscoper.api.InscoperException {
    return InscoperJNI.Image_getWidth(swigCPtr, this);
  }

  public long getHeight() throws com.inscoper.api.InscoperException {
    return InscoperJNI.Image_getHeight(swigCPtr, this);
  }

  public EPixelType getPixelType() {
    return EPixelType.swigToEnum(InscoperJNI.Image_getPixelType(swigCPtr, this));
  }

  public Object getImageData() {
   return InscoperJNI.Image_getImageData(swigCPtr, this);
}

  public boolean hasMetadata(String name) {
    return InscoperJNI.Image_hasMetadata(swigCPtr, this, name);
  }

  public void addMetadata(String name, Metadata value) {
    InscoperJNI.Image_addMetadata(swigCPtr, this, name, Metadata.getCPtr(value), value);
  }

  public void removeMetadata(String name) throws com.inscoper.api.InscoperException {
    InscoperJNI.Image_removeMetadata(swigCPtr, this, name);
  }

  public MetadataMap getMetadata() {
    return new MetadataMap(InscoperJNI.Image_getMetadata__SWIG_0(swigCPtr, this), false);
  }

  public Metadata getMetadata(String key) throws com.inscoper.api.InscoperException {
    return new Metadata(InscoperJNI.Image_getMetadata__SWIG_1(swigCPtr, this, key), true);
  }

  public void setMetadata(MetadataMap metadata) {
    InscoperJNI.Image_setMetadata(swigCPtr, this, MetadataMap.getCPtr(metadata), metadata);
  }

}

Updated on 2026-09-03 at 12:14:19 +0200