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

package AllWatchSerialize;

import java.nio.*;
import java.lang.*;
import java.util.*;
import com.google.flatbuffers.*;

@SuppressWarnings("unused")
public final class Background extends Table {
  public static Background getRootAsBackground(ByteBuffer _bb) { return getRootAsBackground(_bb, new Background()); }
  public static Background getRootAsBackground(ByteBuffer _bb, Background obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
  public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; }
  public Background __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }

  public int backgroundColor() { int o = __offset(4); return o != 0 ? bb.getInt(o + bb_pos) : 0; }
  public int backgroundImage(int j) { int o = __offset(6); return o != 0 ? bb.get(__vector(o) + j * 1) & 0xFF : 0; }
  public int backgroundImageLength() { int o = __offset(6); return o != 0 ? __vector_len(o) : 0; }
  public ByteBuffer backgroundImageAsByteBuffer() { return __vector_as_bytebuffer(6, 1); }
  public ByteBuffer backgroundImageInByteBuffer(ByteBuffer _bb) { return __vector_in_bytebuffer(_bb, 6, 1); }

  public static int createBackground(FlatBufferBuilder builder,
      int backgroundColor,
      int backgroundImageOffset) {
    builder.startObject(2);
    Background.addBackgroundImage(builder, backgroundImageOffset);
    Background.addBackgroundColor(builder, backgroundColor);
    return Background.endBackground(builder);
  }

  public static void startBackground(FlatBufferBuilder builder) { builder.startObject(2); }
  public static void addBackgroundColor(FlatBufferBuilder builder, int backgroundColor) { builder.addInt(0, backgroundColor, 0); }
  public static void addBackgroundImage(FlatBufferBuilder builder, int backgroundImageOffset) { builder.addOffset(1, backgroundImageOffset, 0); }
  public static int createBackgroundImageVector(FlatBufferBuilder builder, byte[] data) { builder.startVector(1, data.length, 1); for (int i = data.length - 1; i >= 0; i--) builder.addByte(data[i]); return builder.endVector(); }
  public static void startBackgroundImageVector(FlatBufferBuilder builder, int numElems) { builder.startVector(1, numElems, 1); }
  public static int endBackground(FlatBufferBuilder builder) {
    int o = builder.endObject();
    return o;
  }
}

