// automatically generated by the FlatBuffers compiler, do not modify

/**
 * @const
 * @namespace
 */
var Dim = Dim || {};

/**
 * @constructor
 */
Dim.UByteArray = function() {
  /**
   * @type {flatbuffers.ByteBuffer}
   */
  this.bb = null;

  /**
   * @type {number}
   */
  this.bb_pos = 0;
};

/**
 * @param {number} i
 * @param {flatbuffers.ByteBuffer} bb
 * @returns {Dim.UByteArray}
 */
Dim.UByteArray.prototype.__init = function(i, bb) {
  this.bb_pos = i;
  this.bb = bb;
  return this;
};

/**
 * @param {flatbuffers.ByteBuffer} bb
 * @param {Dim.UByteArray=} obj
 * @returns {Dim.UByteArray}
 */
Dim.UByteArray.getRootAsUByteArray = function(bb, obj) {
  return (obj || new Dim.UByteArray).__init(bb.readInt32(bb.position()) + bb.position(), bb);
};

/**
 * @param {number} index
 * @returns {number}
 */
Dim.UByteArray.prototype.data = function(index) {
  var offset = this.bb.__offset(this.bb_pos, 4);
  return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
};

/**
 * @returns {number}
 */
Dim.UByteArray.prototype.dataLength = function() {
  var offset = this.bb.__offset(this.bb_pos, 4);
  return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
};

/**
 * @returns {Uint8Array}
 */
Dim.UByteArray.prototype.dataArray = function() {
  var offset = this.bb.__offset(this.bb_pos, 4);
  return offset ? new Uint8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
};

/**
 * @param {flatbuffers.Builder} builder
 */
Dim.UByteArray.startUByteArray = function(builder) {
  builder.startObject(1);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} dataOffset
 */
Dim.UByteArray.addData = function(builder, dataOffset) {
  builder.addFieldOffset(0, dataOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {Array.<number>} data
 * @returns {flatbuffers.Offset}
 */
Dim.UByteArray.createDataVector = function(builder, data) {
  builder.startVector(1, data.length, 1);
  for (var i = data.length - 1; i >= 0; i--) {
    builder.addInt8(data[i]);
  }
  return builder.endVector();
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} numElems
 */
Dim.UByteArray.startDataVector = function(builder, numElems) {
  builder.startVector(1, numElems, 1);
};

/**
 * @param {flatbuffers.Builder} builder
 * @returns {flatbuffers.Offset}
 */
Dim.UByteArray.endUByteArray = function(builder) {
  var offset = builder.endObject();
  return offset;
};

/**
 * @constructor
 */
Dim.FloatArray = function() {
  /**
   * @type {flatbuffers.ByteBuffer}
   */
  this.bb = null;

  /**
   * @type {number}
   */
  this.bb_pos = 0;
};

/**
 * @param {number} i
 * @param {flatbuffers.ByteBuffer} bb
 * @returns {Dim.FloatArray}
 */
Dim.FloatArray.prototype.__init = function(i, bb) {
  this.bb_pos = i;
  this.bb = bb;
  return this;
};

/**
 * @param {flatbuffers.ByteBuffer} bb
 * @param {Dim.FloatArray=} obj
 * @returns {Dim.FloatArray}
 */
Dim.FloatArray.getRootAsFloatArray = function(bb, obj) {
  return (obj || new Dim.FloatArray).__init(bb.readInt32(bb.position()) + bb.position(), bb);
};

/**
 * @param {number} index
 * @returns {number}
 */
Dim.FloatArray.prototype.data = function(index) {
  var offset = this.bb.__offset(this.bb_pos, 4);
  return offset ? this.bb.readFloat32(this.bb.__vector(this.bb_pos + offset) + index * 4) : 0;
};

/**
 * @returns {number}
 */
Dim.FloatArray.prototype.dataLength = function() {
  var offset = this.bb.__offset(this.bb_pos, 4);
  return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
};

/**
 * @returns {Float32Array}
 */
Dim.FloatArray.prototype.dataArray = function() {
  var offset = this.bb.__offset(this.bb_pos, 4);
  return offset ? new Float32Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
};

/**
 * @param {flatbuffers.Builder} builder
 */
Dim.FloatArray.startFloatArray = function(builder) {
  builder.startObject(1);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} dataOffset
 */
Dim.FloatArray.addData = function(builder, dataOffset) {
  builder.addFieldOffset(0, dataOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {Array.<number>} data
 * @returns {flatbuffers.Offset}
 */
Dim.FloatArray.createDataVector = function(builder, data) {
  builder.startVector(4, data.length, 4);
  for (var i = data.length - 1; i >= 0; i--) {
    builder.addFloat32(data[i]);
  }
  return builder.endVector();
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} numElems
 */
Dim.FloatArray.startDataVector = function(builder, numElems) {
  builder.startVector(4, numElems, 4);
};

/**
 * @param {flatbuffers.Builder} builder
 * @returns {flatbuffers.Offset}
 */
Dim.FloatArray.endFloatArray = function(builder) {
  var offset = builder.endObject();
  return offset;
};

/**
 * @constructor
 */
Dim.Coordinates2D = function() {
  /**
   * @type {flatbuffers.ByteBuffer}
   */
  this.bb = null;

  /**
   * @type {number}
   */
  this.bb_pos = 0;
};

/**
 * @param {number} i
 * @param {flatbuffers.ByteBuffer} bb
 * @returns {Dim.Coordinates2D}
 */
Dim.Coordinates2D.prototype.__init = function(i, bb) {
  this.bb_pos = i;
  this.bb = bb;
  return this;
};

/**
 * @param {flatbuffers.ByteBuffer} bb
 * @param {Dim.Coordinates2D=} obj
 * @returns {Dim.Coordinates2D}
 */
Dim.Coordinates2D.getRootAsCoordinates2D = function(bb, obj) {
  return (obj || new Dim.Coordinates2D).__init(bb.readInt32(bb.position()) + bb.position(), bb);
};

/**
 * @param {Dim.FloatArray=} obj
 * @returns {Dim.FloatArray|null}
 */
Dim.Coordinates2D.prototype.x = function(obj) {
  var offset = this.bb.__offset(this.bb_pos, 4);
  return offset ? (obj || new Dim.FloatArray).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
};

/**
 * @param {Dim.FloatArray=} obj
 * @returns {Dim.FloatArray|null}
 */
Dim.Coordinates2D.prototype.y = function(obj) {
  var offset = this.bb.__offset(this.bb_pos, 6);
  return offset ? (obj || new Dim.FloatArray).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
};

/**
 * @param {flatbuffers.Builder} builder
 */
Dim.Coordinates2D.startCoordinates2D = function(builder) {
  builder.startObject(2);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} xOffset
 */
Dim.Coordinates2D.addX = function(builder, xOffset) {
  builder.addFieldOffset(0, xOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} yOffset
 */
Dim.Coordinates2D.addY = function(builder, yOffset) {
  builder.addFieldOffset(1, yOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @returns {flatbuffers.Offset}
 */
Dim.Coordinates2D.endCoordinates2D = function(builder) {
  var offset = builder.endObject();
  return offset;
};

/**
 * @constructor
 */
Dim.RGBTripleArray = function() {
  /**
   * @type {flatbuffers.ByteBuffer}
   */
  this.bb = null;

  /**
   * @type {number}
   */
  this.bb_pos = 0;
};

/**
 * @param {number} i
 * @param {flatbuffers.ByteBuffer} bb
 * @returns {Dim.RGBTripleArray}
 */
Dim.RGBTripleArray.prototype.__init = function(i, bb) {
  this.bb_pos = i;
  this.bb = bb;
  return this;
};

/**
 * @param {flatbuffers.ByteBuffer} bb
 * @param {Dim.RGBTripleArray=} obj
 * @returns {Dim.RGBTripleArray}
 */
Dim.RGBTripleArray.getRootAsRGBTripleArray = function(bb, obj) {
  return (obj || new Dim.RGBTripleArray).__init(bb.readInt32(bb.position()) + bb.position(), bb);
};

/**
 * @param {Dim.UByteArray=} obj
 * @returns {Dim.UByteArray|null}
 */
Dim.RGBTripleArray.prototype.r = function(obj) {
  var offset = this.bb.__offset(this.bb_pos, 4);
  return offset ? (obj || new Dim.UByteArray).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
};

/**
 * @param {Dim.UByteArray=} obj
 * @returns {Dim.UByteArray|null}
 */
Dim.RGBTripleArray.prototype.g = function(obj) {
  var offset = this.bb.__offset(this.bb_pos, 6);
  return offset ? (obj || new Dim.UByteArray).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
};

/**
 * @param {Dim.UByteArray=} obj
 * @returns {Dim.UByteArray|null}
 */
Dim.RGBTripleArray.prototype.b = function(obj) {
  var offset = this.bb.__offset(this.bb_pos, 8);
  return offset ? (obj || new Dim.UByteArray).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
};

/**
 * @param {flatbuffers.Builder} builder
 */
Dim.RGBTripleArray.startRGBTripleArray = function(builder) {
  builder.startObject(3);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} rOffset
 */
Dim.RGBTripleArray.addR = function(builder, rOffset) {
  builder.addFieldOffset(0, rOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} gOffset
 */
Dim.RGBTripleArray.addG = function(builder, gOffset) {
  builder.addFieldOffset(1, gOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} bOffset
 */
Dim.RGBTripleArray.addB = function(builder, bOffset) {
  builder.addFieldOffset(2, bOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @returns {flatbuffers.Offset}
 */
Dim.RGBTripleArray.endRGBTripleArray = function(builder) {
  var offset = builder.endObject();
  return offset;
};

/**
 * @constructor
 */
Dim.ColorArray1D = function() {
  /**
   * @type {flatbuffers.ByteBuffer}
   */
  this.bb = null;

  /**
   * @type {number}
   */
  this.bb_pos = 0;
};

/**
 * @param {number} i
 * @param {flatbuffers.ByteBuffer} bb
 * @returns {Dim.ColorArray1D}
 */
Dim.ColorArray1D.prototype.__init = function(i, bb) {
  this.bb_pos = i;
  this.bb = bb;
  return this;
};

/**
 * @param {flatbuffers.ByteBuffer} bb
 * @param {Dim.ColorArray1D=} obj
 * @returns {Dim.ColorArray1D}
 */
Dim.ColorArray1D.getRootAsColorArray1D = function(bb, obj) {
  return (obj || new Dim.ColorArray1D).__init(bb.readInt32(bb.position()) + bb.position(), bb);
};

/**
 * @param {Dim.UByteArray=} obj
 * @returns {Dim.UByteArray|null}
 */
Dim.ColorArray1D.prototype.color = function(obj) {
  var offset = this.bb.__offset(this.bb_pos, 4);
  return offset ? (obj || new Dim.UByteArray).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
};

/**
 * @param {flatbuffers.Builder} builder
 */
Dim.ColorArray1D.startColorArray1D = function(builder) {
  builder.startObject(1);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} colorOffset
 */
Dim.ColorArray1D.addColor = function(builder, colorOffset) {
  builder.addFieldOffset(0, colorOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @returns {flatbuffers.Offset}
 */
Dim.ColorArray1D.endColorArray1D = function(builder) {
  var offset = builder.endObject();
  return offset;
};

/**
 * @constructor
 */
Dim.Dim = function() {
  /**
   * @type {flatbuffers.ByteBuffer}
   */
  this.bb = null;

  /**
   * @type {number}
   */
  this.bb_pos = 0;
};

/**
 * @param {number} i
 * @param {flatbuffers.ByteBuffer} bb
 * @returns {Dim.Dim}
 */
Dim.Dim.prototype.__init = function(i, bb) {
  this.bb_pos = i;
  this.bb = bb;
  return this;
};

/**
 * @param {flatbuffers.ByteBuffer} bb
 * @param {Dim.Dim=} obj
 * @returns {Dim.Dim}
 */
Dim.Dim.getRootAsDim = function(bb, obj) {
  return (obj || new Dim.Dim).__init(bb.readInt32(bb.position()) + bb.position(), bb);
};

/**
 * @param {Dim.UByteArray=} obj
 * @returns {Dim.UByteArray|null}
 */
Dim.Dim.prototype.ubyteArray = function(obj) {
  var offset = this.bb.__offset(this.bb_pos, 4);
  return offset ? (obj || new Dim.UByteArray).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
};

/**
 * @param {Dim.FloatArray=} obj
 * @returns {Dim.FloatArray|null}
 */
Dim.Dim.prototype.floatArray = function(obj) {
  var offset = this.bb.__offset(this.bb_pos, 6);
  return offset ? (obj || new Dim.FloatArray).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
};

/**
 * @param {Dim.Coordinates2D=} obj
 * @returns {Dim.Coordinates2D|null}
 */
Dim.Dim.prototype.coordinates2D = function(obj) {
  var offset = this.bb.__offset(this.bb_pos, 8);
  return offset ? (obj || new Dim.Coordinates2D).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
};

/**
 * @param {Dim.ColorArray1D=} obj
 * @returns {Dim.ColorArray1D|null}
 */
Dim.Dim.prototype.colorArray1D = function(obj) {
  var offset = this.bb.__offset(this.bb_pos, 10);
  return offset ? (obj || new Dim.ColorArray1D).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
};

/**
 * @param {Dim.RGBTripleArray=} obj
 * @returns {Dim.RGBTripleArray|null}
 */
Dim.Dim.prototype.rgbTripleArray = function(obj) {
  var offset = this.bb.__offset(this.bb_pos, 12);
  return offset ? (obj || new Dim.RGBTripleArray).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
};

/**
 * @param {flatbuffers.Builder} builder
 */
Dim.Dim.startDim = function(builder) {
  builder.startObject(5);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} ubyteArrayOffset
 */
Dim.Dim.addUbyteArray = function(builder, ubyteArrayOffset) {
  builder.addFieldOffset(0, ubyteArrayOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} floatArrayOffset
 */
Dim.Dim.addFloatArray = function(builder, floatArrayOffset) {
  builder.addFieldOffset(1, floatArrayOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} coordinates2DOffset
 */
Dim.Dim.addCoordinates2D = function(builder, coordinates2DOffset) {
  builder.addFieldOffset(2, coordinates2DOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} colorArray1DOffset
 */
Dim.Dim.addColorArray1D = function(builder, colorArray1DOffset) {
  builder.addFieldOffset(3, colorArray1DOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} rgbTripleArrayOffset
 */
Dim.Dim.addRgbTripleArray = function(builder, rgbTripleArrayOffset) {
  builder.addFieldOffset(4, rgbTripleArrayOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @returns {flatbuffers.Offset}
 */
Dim.Dim.endDim = function(builder) {
  var offset = builder.endObject();
  return offset;
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} offset
 */
Dim.Dim.finishDimBuffer = function(builder, offset) {
  builder.finish(offset);
};

// Exports for ECMAScript6 Modules
export {Dim};
