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


#ifndef FLATBUFFERS_GENERATED_USERDEFINE_MNN_H_
#define FLATBUFFERS_GENERATED_USERDEFINE_MNN_H_


#include "Tensor_generated.h"
#include "Type_generated.h"

namespace MNN {

struct TensorConvertInfo;
struct TensorConvertInfoT;

struct GridSample;
struct GridSampleT;

struct CvtColorParam;
struct CvtColorParamT;

inline const flatbuffers::TypeTable *TensorConvertInfoTypeTable();

inline const flatbuffers::TypeTable *GridSampleTypeTable();

inline const flatbuffers::TypeTable *CvtColorParamTypeTable();

enum SampleMode {
  SampleMode_BILINEAR = 0,
  SampleMode_NEAREST = 1,
  SampleMode_MIN = SampleMode_BILINEAR,
  SampleMode_MAX = SampleMode_NEAREST
};

inline const SampleMode (&EnumValuesSampleMode())[2] {
  static const SampleMode values[] = {
    SampleMode_BILINEAR,
    SampleMode_NEAREST
  };
  return values;
}

inline const char * const *EnumNamesSampleMode() {
  static const char * const names[] = {
    "BILINEAR",
    "NEAREST",
    nullptr
  };
  return names;
}

inline const char *EnumNameSampleMode(SampleMode e) {
  if (e < SampleMode_BILINEAR || e > SampleMode_NEAREST) return "";
  const size_t index = static_cast<int>(e);
  return EnumNamesSampleMode()[index];
}

enum BorderMode {
  BorderMode_ZEROS = 0,
  BorderMode_CLAMP = 1,
  BorderMode_REFLECTION = 2,
  BorderMode_MIN = BorderMode_ZEROS,
  BorderMode_MAX = BorderMode_REFLECTION
};

inline const BorderMode (&EnumValuesBorderMode())[3] {
  static const BorderMode values[] = {
    BorderMode_ZEROS,
    BorderMode_CLAMP,
    BorderMode_REFLECTION
  };
  return values;
}

inline const char * const *EnumNamesBorderMode() {
  static const char * const names[] = {
    "ZEROS",
    "CLAMP",
    "REFLECTION",
    nullptr
  };
  return names;
}

inline const char *EnumNameBorderMode(BorderMode e) {
  if (e < BorderMode_ZEROS || e > BorderMode_REFLECTION) return "";
  const size_t index = static_cast<int>(e);
  return EnumNamesBorderMode()[index];
}

enum ImageFormatType {
  ImageFormatType_RGBA = 0,
  ImageFormatType_RGB = 1,
  ImageFormatType_BGR = 2,
  ImageFormatType_GRAY = 3,
  ImageFormatType_BGRA = 4,
  ImageFormatType_YCrCb = 5,
  ImageFormatType_YUV = 6,
  ImageFormatType_HSV = 7,
  ImageFormatType_XYZ = 8,
  ImageFormatType_BGR555 = 9,
  ImageFormatType_BGR565 = 10,
  ImageFormatType_YUV_NV21 = 11,
  ImageFormatType_YUV_NV12 = 12,
  ImageFormatType_YUV_I420 = 13,
  ImageFormatType_HSV_FULL = 14,
  ImageFormatType_MIN = ImageFormatType_RGBA,
  ImageFormatType_MAX = ImageFormatType_HSV_FULL
};

inline const ImageFormatType (&EnumValuesImageFormatType())[15] {
  static const ImageFormatType values[] = {
    ImageFormatType_RGBA,
    ImageFormatType_RGB,
    ImageFormatType_BGR,
    ImageFormatType_GRAY,
    ImageFormatType_BGRA,
    ImageFormatType_YCrCb,
    ImageFormatType_YUV,
    ImageFormatType_HSV,
    ImageFormatType_XYZ,
    ImageFormatType_BGR555,
    ImageFormatType_BGR565,
    ImageFormatType_YUV_NV21,
    ImageFormatType_YUV_NV12,
    ImageFormatType_YUV_I420,
    ImageFormatType_HSV_FULL
  };
  return values;
}

inline const char * const *EnumNamesImageFormatType() {
  static const char * const names[] = {
    "RGBA",
    "RGB",
    "BGR",
    "GRAY",
    "BGRA",
    "YCrCb",
    "YUV",
    "HSV",
    "XYZ",
    "BGR555",
    "BGR565",
    "YUV_NV21",
    "YUV_NV12",
    "YUV_I420",
    "HSV_FULL",
    nullptr
  };
  return names;
}

inline const char *EnumNameImageFormatType(ImageFormatType e) {
  if (e < ImageFormatType_RGBA || e > ImageFormatType_HSV_FULL) return "";
  const size_t index = static_cast<int>(e);
  return EnumNamesImageFormatType()[index];
}

struct TensorConvertInfoT : public flatbuffers::NativeTable {
  typedef TensorConvertInfo TableType;
  MNN_DATA_FORMAT source;
  MNN_DATA_FORMAT dest;
  TensorConvertInfoT()
      : source(MNN_DATA_FORMAT_NCHW),
        dest(MNN_DATA_FORMAT_NCHW) {
  }
};

struct TensorConvertInfo FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
  typedef TensorConvertInfoT NativeTableType;
  static const flatbuffers::TypeTable *MiniReflectTypeTable() {
    return TensorConvertInfoTypeTable();
  }
  MNN_DATA_FORMAT source() const {
    return static_cast<MNN_DATA_FORMAT>(GetField<int8_t>(4, 0));
  }
  MNN_DATA_FORMAT dest() const {
    return static_cast<MNN_DATA_FORMAT>(GetField<int8_t>(6, 0));
  }
  bool Verify(flatbuffers::Verifier &verifier) const {
    return VerifyTableStart(verifier) &&
           VerifyField<int8_t>(verifier, 4) &&
           VerifyField<int8_t>(verifier, 6) &&
           verifier.EndTable();
  }
  TensorConvertInfoT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
  void UnPackTo(TensorConvertInfoT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
  static flatbuffers::Offset<TensorConvertInfo> Pack(flatbuffers::FlatBufferBuilder &_fbb, const TensorConvertInfoT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
};

struct TensorConvertInfoBuilder {
  flatbuffers::FlatBufferBuilder &fbb_;
  flatbuffers::uoffset_t start_;
  void add_source(MNN_DATA_FORMAT source) {
    fbb_.AddElement<int8_t>(4, static_cast<int8_t>(source), 0);
  }
  void add_dest(MNN_DATA_FORMAT dest) {
    fbb_.AddElement<int8_t>(6, static_cast<int8_t>(dest), 0);
  }
  explicit TensorConvertInfoBuilder(flatbuffers::FlatBufferBuilder &_fbb)
        : fbb_(_fbb) {
    start_ = fbb_.StartTable();
  }
  TensorConvertInfoBuilder &operator=(const TensorConvertInfoBuilder &);
  flatbuffers::Offset<TensorConvertInfo> Finish() {
    const auto end = fbb_.EndTable(start_);
    auto o = flatbuffers::Offset<TensorConvertInfo>(end);
    return o;
  }
};

inline flatbuffers::Offset<TensorConvertInfo> CreateTensorConvertInfo(
    flatbuffers::FlatBufferBuilder &_fbb,
    MNN_DATA_FORMAT source = MNN_DATA_FORMAT_NCHW,
    MNN_DATA_FORMAT dest = MNN_DATA_FORMAT_NCHW) {
  TensorConvertInfoBuilder builder_(_fbb);
  builder_.add_dest(dest);
  builder_.add_source(source);
  return builder_.Finish();
}

flatbuffers::Offset<TensorConvertInfo> CreateTensorConvertInfo(flatbuffers::FlatBufferBuilder &_fbb, const TensorConvertInfoT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);

struct GridSampleT : public flatbuffers::NativeTable {
  typedef GridSample TableType;
  SampleMode mode;
  BorderMode paddingMode;
  bool alignCorners;
  GridSampleT()
      : mode(SampleMode_BILINEAR),
        paddingMode(BorderMode_ZEROS),
        alignCorners(false) {
  }
};

struct GridSample FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
  typedef GridSampleT NativeTableType;
  static const flatbuffers::TypeTable *MiniReflectTypeTable() {
    return GridSampleTypeTable();
  }
  SampleMode mode() const {
    return static_cast<SampleMode>(GetField<int8_t>(4, 0));
  }
  BorderMode paddingMode() const {
    return static_cast<BorderMode>(GetField<int8_t>(6, 0));
  }
  bool alignCorners() const {
    return GetField<uint8_t>(8, 0) != 0;
  }
  bool Verify(flatbuffers::Verifier &verifier) const {
    return VerifyTableStart(verifier) &&
           VerifyField<int8_t>(verifier, 4) &&
           VerifyField<int8_t>(verifier, 6) &&
           VerifyField<uint8_t>(verifier, 8) &&
           verifier.EndTable();
  }
  GridSampleT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
  void UnPackTo(GridSampleT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
  static flatbuffers::Offset<GridSample> Pack(flatbuffers::FlatBufferBuilder &_fbb, const GridSampleT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
};

struct GridSampleBuilder {
  flatbuffers::FlatBufferBuilder &fbb_;
  flatbuffers::uoffset_t start_;
  void add_mode(SampleMode mode) {
    fbb_.AddElement<int8_t>(4, static_cast<int8_t>(mode), 0);
  }
  void add_paddingMode(BorderMode paddingMode) {
    fbb_.AddElement<int8_t>(6, static_cast<int8_t>(paddingMode), 0);
  }
  void add_alignCorners(bool alignCorners) {
    fbb_.AddElement<uint8_t>(8, static_cast<uint8_t>(alignCorners), 0);
  }
  explicit GridSampleBuilder(flatbuffers::FlatBufferBuilder &_fbb)
        : fbb_(_fbb) {
    start_ = fbb_.StartTable();
  }
  GridSampleBuilder &operator=(const GridSampleBuilder &);
  flatbuffers::Offset<GridSample> Finish() {
    const auto end = fbb_.EndTable(start_);
    auto o = flatbuffers::Offset<GridSample>(end);
    return o;
  }
};

inline flatbuffers::Offset<GridSample> CreateGridSample(
    flatbuffers::FlatBufferBuilder &_fbb,
    SampleMode mode = SampleMode_BILINEAR,
    BorderMode paddingMode = BorderMode_ZEROS,
    bool alignCorners = false) {
  GridSampleBuilder builder_(_fbb);
  builder_.add_alignCorners(alignCorners);
  builder_.add_paddingMode(paddingMode);
  builder_.add_mode(mode);
  return builder_.Finish();
}

flatbuffers::Offset<GridSample> CreateGridSample(flatbuffers::FlatBufferBuilder &_fbb, const GridSampleT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);

struct CvtColorParamT : public flatbuffers::NativeTable {
  typedef CvtColorParam TableType;
  ImageFormatType sourceFormat;
  ImageFormatType destFormat;
  int32_t uvDownMode;
  CvtColorParamT()
      : sourceFormat(ImageFormatType_RGB),
        destFormat(ImageFormatType_YUV_NV12),
        uvDownMode(0) {
  }
};

struct CvtColorParam FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
  typedef CvtColorParamT NativeTableType;
  static const flatbuffers::TypeTable *MiniReflectTypeTable() {
    return CvtColorParamTypeTable();
  }
  ImageFormatType sourceFormat() const {
    return static_cast<ImageFormatType>(GetField<int32_t>(4, 1));
  }
  ImageFormatType destFormat() const {
    return static_cast<ImageFormatType>(GetField<int32_t>(6, 12));
  }
  int32_t uvDownMode() const {
    return GetField<int32_t>(8, 0);
  }
  bool Verify(flatbuffers::Verifier &verifier) const {
    return VerifyTableStart(verifier) &&
           VerifyField<int32_t>(verifier, 4) &&
           VerifyField<int32_t>(verifier, 6) &&
           VerifyField<int32_t>(verifier, 8) &&
           verifier.EndTable();
  }
  CvtColorParamT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
  void UnPackTo(CvtColorParamT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
  static flatbuffers::Offset<CvtColorParam> Pack(flatbuffers::FlatBufferBuilder &_fbb, const CvtColorParamT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
};

struct CvtColorParamBuilder {
  flatbuffers::FlatBufferBuilder &fbb_;
  flatbuffers::uoffset_t start_;
  void add_sourceFormat(ImageFormatType sourceFormat) {
    fbb_.AddElement<int32_t>(4, static_cast<int32_t>(sourceFormat), 1);
  }
  void add_destFormat(ImageFormatType destFormat) {
    fbb_.AddElement<int32_t>(6, static_cast<int32_t>(destFormat), 12);
  }
  void add_uvDownMode(int32_t uvDownMode) {
    fbb_.AddElement<int32_t>(8, uvDownMode, 0);
  }
  explicit CvtColorParamBuilder(flatbuffers::FlatBufferBuilder &_fbb)
        : fbb_(_fbb) {
    start_ = fbb_.StartTable();
  }
  CvtColorParamBuilder &operator=(const CvtColorParamBuilder &);
  flatbuffers::Offset<CvtColorParam> Finish() {
    const auto end = fbb_.EndTable(start_);
    auto o = flatbuffers::Offset<CvtColorParam>(end);
    return o;
  }
};

inline flatbuffers::Offset<CvtColorParam> CreateCvtColorParam(
    flatbuffers::FlatBufferBuilder &_fbb,
    ImageFormatType sourceFormat = ImageFormatType_RGB,
    ImageFormatType destFormat = ImageFormatType_YUV_NV12,
    int32_t uvDownMode = 0) {
  CvtColorParamBuilder builder_(_fbb);
  builder_.add_uvDownMode(uvDownMode);
  builder_.add_destFormat(destFormat);
  builder_.add_sourceFormat(sourceFormat);
  return builder_.Finish();
}

flatbuffers::Offset<CvtColorParam> CreateCvtColorParam(flatbuffers::FlatBufferBuilder &_fbb, const CvtColorParamT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);

inline TensorConvertInfoT *TensorConvertInfo::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
  auto _o = new TensorConvertInfoT();
  UnPackTo(_o, _resolver);
  return _o;
}

inline void TensorConvertInfo::UnPackTo(TensorConvertInfoT *_o, const flatbuffers::resolver_function_t *_resolver) const {
  (void)_o;
  (void)_resolver;
  { auto _e = source(); _o->source = _e; };
  { auto _e = dest(); _o->dest = _e; };
}

inline flatbuffers::Offset<TensorConvertInfo> TensorConvertInfo::Pack(flatbuffers::FlatBufferBuilder &_fbb, const TensorConvertInfoT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
  return CreateTensorConvertInfo(_fbb, _o, _rehasher);
}

inline flatbuffers::Offset<TensorConvertInfo> CreateTensorConvertInfo(flatbuffers::FlatBufferBuilder &_fbb, const TensorConvertInfoT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
  (void)_rehasher;
  (void)_o;
  struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const TensorConvertInfoT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
  auto _source = _o->source;
  auto _dest = _o->dest;
  return MNN::CreateTensorConvertInfo(
      _fbb,
      _source,
      _dest);
}

inline GridSampleT *GridSample::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
  auto _o = new GridSampleT();
  UnPackTo(_o, _resolver);
  return _o;
}

inline void GridSample::UnPackTo(GridSampleT *_o, const flatbuffers::resolver_function_t *_resolver) const {
  (void)_o;
  (void)_resolver;
  { auto _e = mode(); _o->mode = _e; };
  { auto _e = paddingMode(); _o->paddingMode = _e; };
  { auto _e = alignCorners(); _o->alignCorners = _e; };
}

inline flatbuffers::Offset<GridSample> GridSample::Pack(flatbuffers::FlatBufferBuilder &_fbb, const GridSampleT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
  return CreateGridSample(_fbb, _o, _rehasher);
}

inline flatbuffers::Offset<GridSample> CreateGridSample(flatbuffers::FlatBufferBuilder &_fbb, const GridSampleT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
  (void)_rehasher;
  (void)_o;
  struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const GridSampleT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
  auto _mode = _o->mode;
  auto _paddingMode = _o->paddingMode;
  auto _alignCorners = _o->alignCorners;
  return MNN::CreateGridSample(
      _fbb,
      _mode,
      _paddingMode,
      _alignCorners);
}

inline CvtColorParamT *CvtColorParam::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
  auto _o = new CvtColorParamT();
  UnPackTo(_o, _resolver);
  return _o;
}

inline void CvtColorParam::UnPackTo(CvtColorParamT *_o, const flatbuffers::resolver_function_t *_resolver) const {
  (void)_o;
  (void)_resolver;
  { auto _e = sourceFormat(); _o->sourceFormat = _e; };
  { auto _e = destFormat(); _o->destFormat = _e; };
  { auto _e = uvDownMode(); _o->uvDownMode = _e; };
}

inline flatbuffers::Offset<CvtColorParam> CvtColorParam::Pack(flatbuffers::FlatBufferBuilder &_fbb, const CvtColorParamT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
  return CreateCvtColorParam(_fbb, _o, _rehasher);
}

inline flatbuffers::Offset<CvtColorParam> CreateCvtColorParam(flatbuffers::FlatBufferBuilder &_fbb, const CvtColorParamT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
  (void)_rehasher;
  (void)_o;
  struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const CvtColorParamT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
  auto _sourceFormat = _o->sourceFormat;
  auto _destFormat = _o->destFormat;
  auto _uvDownMode = _o->uvDownMode;
  return MNN::CreateCvtColorParam(
      _fbb,
      _sourceFormat,
      _destFormat,
      _uvDownMode);
}

inline const flatbuffers::TypeTable *SampleModeTypeTable() {
  static const flatbuffers::TypeCode type_codes[] = {
    { flatbuffers::ET_CHAR, 0, 0 },
    { flatbuffers::ET_CHAR, 0, 0 }
  };
  static const flatbuffers::TypeFunction type_refs[] = {
    SampleModeTypeTable
  };
  static const char * const names[] = {
    "BILINEAR",
    "NEAREST"
  };
  static const flatbuffers::TypeTable tt = {
    flatbuffers::ST_ENUM, 2, type_codes, type_refs, nullptr, names
  };
  return &tt;
}

inline const flatbuffers::TypeTable *BorderModeTypeTable() {
  static const flatbuffers::TypeCode type_codes[] = {
    { flatbuffers::ET_CHAR, 0, 0 },
    { flatbuffers::ET_CHAR, 0, 0 },
    { flatbuffers::ET_CHAR, 0, 0 }
  };
  static const flatbuffers::TypeFunction type_refs[] = {
    BorderModeTypeTable
  };
  static const char * const names[] = {
    "ZEROS",
    "CLAMP",
    "REFLECTION"
  };
  static const flatbuffers::TypeTable tt = {
    flatbuffers::ST_ENUM, 3, type_codes, type_refs, nullptr, names
  };
  return &tt;
}

inline const flatbuffers::TypeTable *ImageFormatTypeTypeTable() {
  static const flatbuffers::TypeCode type_codes[] = {
    { flatbuffers::ET_INT, 0, 0 },
    { flatbuffers::ET_INT, 0, 0 },
    { flatbuffers::ET_INT, 0, 0 },
    { flatbuffers::ET_INT, 0, 0 },
    { flatbuffers::ET_INT, 0, 0 },
    { flatbuffers::ET_INT, 0, 0 },
    { flatbuffers::ET_INT, 0, 0 },
    { flatbuffers::ET_INT, 0, 0 },
    { flatbuffers::ET_INT, 0, 0 },
    { flatbuffers::ET_INT, 0, 0 },
    { flatbuffers::ET_INT, 0, 0 },
    { flatbuffers::ET_INT, 0, 0 },
    { flatbuffers::ET_INT, 0, 0 },
    { flatbuffers::ET_INT, 0, 0 },
    { flatbuffers::ET_INT, 0, 0 }
  };
  static const flatbuffers::TypeFunction type_refs[] = {
    ImageFormatTypeTypeTable
  };
  static const char * const names[] = {
    "RGBA",
    "RGB",
    "BGR",
    "GRAY",
    "BGRA",
    "YCrCb",
    "YUV",
    "HSV",
    "XYZ",
    "BGR555",
    "BGR565",
    "YUV_NV21",
    "YUV_NV12",
    "YUV_I420",
    "HSV_FULL"
  };
  static const flatbuffers::TypeTable tt = {
    flatbuffers::ST_ENUM, 15, type_codes, type_refs, nullptr, names
  };
  return &tt;
}

inline const flatbuffers::TypeTable *TensorConvertInfoTypeTable() {
  static const flatbuffers::TypeCode type_codes[] = {
    { flatbuffers::ET_CHAR, 0, 0 },
    { flatbuffers::ET_CHAR, 0, 0 }
  };
  static const flatbuffers::TypeFunction type_refs[] = {
    MNN_DATA_FORMATTypeTable
  };
  static const char * const names[] = {
    "source",
    "dest"
  };
  static const flatbuffers::TypeTable tt = {
    flatbuffers::ST_TABLE, 2, type_codes, type_refs, nullptr, names
  };
  return &tt;
}

inline const flatbuffers::TypeTable *GridSampleTypeTable() {
  static const flatbuffers::TypeCode type_codes[] = {
    { flatbuffers::ET_CHAR, 0, 0 },
    { flatbuffers::ET_CHAR, 0, 1 },
    { flatbuffers::ET_BOOL, 0, -1 }
  };
  static const flatbuffers::TypeFunction type_refs[] = {
    SampleModeTypeTable,
    BorderModeTypeTable
  };
  static const char * const names[] = {
    "mode",
    "paddingMode",
    "alignCorners"
  };
  static const flatbuffers::TypeTable tt = {
    flatbuffers::ST_TABLE, 3, type_codes, type_refs, nullptr, names
  };
  return &tt;
}

inline const flatbuffers::TypeTable *CvtColorParamTypeTable() {
  static const flatbuffers::TypeCode type_codes[] = {
    { flatbuffers::ET_INT, 0, 0 },
    { flatbuffers::ET_INT, 0, 0 },
    { flatbuffers::ET_INT, 0, -1 }
  };
  static const flatbuffers::TypeFunction type_refs[] = {
    ImageFormatTypeTypeTable
  };
  static const char * const names[] = {
    "sourceFormat",
    "destFormat",
    "uvDownMode"
  };
  static const flatbuffers::TypeTable tt = {
    flatbuffers::ST_TABLE, 3, type_codes, type_refs, nullptr, names
  };
  return &tt;
}

}  // namespace MNN

#endif  // FLATBUFFERS_GENERATED_USERDEFINE_MNN_H_
