/* Automatically generated nanopb header */
/* Generated by nanopb-0.4.9.1 */

#ifndef PB_CARDBOARD_CARDBOARD_DEVICE_PB_H_INCLUDED
#define PB_CARDBOARD_CARDBOARD_DEVICE_PB_H_INCLUDED
#include <pb.h>

#if PB_PROTO_HEADER_VERSION != 40
#error Regenerate this file with the current version of nanopb generator.
#endif

/* Enum definitions */
typedef enum _cardboard_DeviceParams_VerticalAlignmentType {
    cardboard_DeviceParams_VerticalAlignmentType_BOTTOM = 0, /* phone rests against a fixed bottom tray */
    cardboard_DeviceParams_VerticalAlignmentType_CENTER = 1, /* phone screen assumed to be centered w.r.t. lenses */
    cardboard_DeviceParams_VerticalAlignmentType_TOP = 2 /* phone rests against a fixed top tray */
} cardboard_DeviceParams_VerticalAlignmentType;

typedef enum _cardboard_DeviceParams_ButtonType {
    /* No physical button, and touch screen is not easily accessible. */
    cardboard_DeviceParams_ButtonType_NONE = 0,
    /* HMD has integrated magnet switch similar to original Cardboard. */
    cardboard_DeviceParams_ButtonType_MAGNET = 1,
    /* At least a portion of touch screen is easily accessible to user for taps. */
    cardboard_DeviceParams_ButtonType_TOUCH = 2,
    /* Touch screen is triggered indirectly via integrated button on the HMD. */
    cardboard_DeviceParams_ButtonType_INDIRECT_TOUCH = 3
} cardboard_DeviceParams_ButtonType;

/* Struct definitions */
/* *
 Message describing properties of a VR head mount device (HMD) which uses an
 interchangeable smartphone as a display (e.g. Google Cardboard).

 While some properties are certain (e.g. inter_lens_distance), others
 represent nominal values which may be refined depending on context (e.g.
 viewport_angles).

 Lengths are in meters unless noted otherwise.  Fields are _required_
 unless noted otherwise.

 Some context on why this set of parameters are deemed necessary and
 sufficient:
    * FOV scale can be reasonably approximated from lens-to-screen distance
      and display size (i.e. knowing lens focal length isn't crucial).
    * Lenses are assumed to be horizontally centered with respect to
      display.
    * The display is not necessarily vertically centered.  For interchangeable
      phones where the device rests against a tray, we can derive
      the vertical offset from tray-to-lens height along with phone-specific
      bezel and screen sizes (supplied separately). */
typedef struct _cardboard_DeviceParams {
    /* String identifying the device's vendor (e.g. "Google, Inc.").
 A device's [vendor, model] pair is expected to be globally unique. */
    pb_callback_t vendor;
    /* String identifying the device's model, including revision info if
 needed (e.g. "Cardboard v1").  A device's [vendor, model] pair is
 expected to be globally unique. */
    pb_callback_t model;
    /* Distance from the display screen to the optical center of lenses.
 This is a required field for distortion rendering, and must be positive. */
    bool has_screen_to_lens_distance;
    float screen_to_lens_distance;
    /* Horizontal distance between optical center of the lenses.
 This is a required field for distortion rendering, and must be positive. */
    bool has_inter_lens_distance;
    float inter_lens_distance;
    /* Four-element tuple (left, right, bottom, top) of left eye's view extent
 angles relative to center, assuming the following:
     * eye is aligned with optical center of lens
     * display screen is equal or larger than extents viewable through lens
     * nominal eye-to-lens distance
     * mirrored field of view will be applied to the right eye
 These values are essentially used as an optimization to avoid rendering
 pixels which can't be seen.
 This is a required field for distortion rendering, and angles must be
 positive. */
    pb_callback_t left_eye_field_of_view_angles;
    /* If the phone is aligned vertically within the device by resting against
 a fixed top or bottom tray, this is the distance from the tray to
 optical center of the lenses.
 This is a required field for distortion rendering, and must be positive.
 NOTE: Due to a bug in initial versions of the SDK's, this field
 must be set explicitly to .035 when vertical_alignment = CENTER. */
    bool has_tray_to_lens_distance;
    float tray_to_lens_distance;
    /* Coefficients Ki for pincushion distortion function which maps
 from position on real screen to virtual screen (i.e. texture) relative
 to optical center:

    p' = p (1 + K1 r^2 + K2 r^4 + ... + Kn r^(2n))

 where r is the distance in tan-angle units from the optical center,
 p the input point, and p' the output point.  Tan-angle units can be
 computed as distance on the screen divided by distance from the
 virtual eye to the screen. */
    pb_callback_t distortion_coefficients;
    /* Set according to vertical alignment strategy-- see enum comments above.
 NOTE: If you set this to CENTER, see special instructions for the
 tray_to_lens_distance field below. */
    bool has_vertical_alignment;
    cardboard_DeviceParams_VerticalAlignmentType vertical_alignment;
    /* Specify primary input mechanism of the HMD.  Intended for advisory
 purposes only, to address simple questions such as "can HMD
 be used with apps requiring a physical button event?" or "what icon
 should be used to represent button action to the user?". */
    bool has_primary_button;
    cardboard_DeviceParams_ButtonType primary_button;
} cardboard_DeviceParams;


#ifdef __cplusplus
extern "C" {
#endif

/* Helper constants for enums */
#define _cardboard_DeviceParams_VerticalAlignmentType_MIN cardboard_DeviceParams_VerticalAlignmentType_BOTTOM
#define _cardboard_DeviceParams_VerticalAlignmentType_MAX cardboard_DeviceParams_VerticalAlignmentType_TOP
#define _cardboard_DeviceParams_VerticalAlignmentType_ARRAYSIZE ((cardboard_DeviceParams_VerticalAlignmentType)(cardboard_DeviceParams_VerticalAlignmentType_TOP+1))

#define _cardboard_DeviceParams_ButtonType_MIN cardboard_DeviceParams_ButtonType_NONE
#define _cardboard_DeviceParams_ButtonType_MAX cardboard_DeviceParams_ButtonType_INDIRECT_TOUCH
#define _cardboard_DeviceParams_ButtonType_ARRAYSIZE ((cardboard_DeviceParams_ButtonType)(cardboard_DeviceParams_ButtonType_INDIRECT_TOUCH+1))

#define cardboard_DeviceParams_vertical_alignment_ENUMTYPE cardboard_DeviceParams_VerticalAlignmentType
#define cardboard_DeviceParams_primary_button_ENUMTYPE cardboard_DeviceParams_ButtonType


/* Initializer values for message structs */
#define cardboard_DeviceParams_init_default      {{{NULL}, NULL}, {{NULL}, NULL}, false, 0, false, 0, {{NULL}, NULL}, false, 0, {{NULL}, NULL}, false, cardboard_DeviceParams_VerticalAlignmentType_BOTTOM, false, cardboard_DeviceParams_ButtonType_MAGNET}
#define cardboard_DeviceParams_init_zero         {{{NULL}, NULL}, {{NULL}, NULL}, false, 0, false, 0, {{NULL}, NULL}, false, 0, {{NULL}, NULL}, false, _cardboard_DeviceParams_VerticalAlignmentType_MIN, false, _cardboard_DeviceParams_ButtonType_MIN}

/* Field tags (for use in manual encoding/decoding) */
#define cardboard_DeviceParams_vendor_tag        1
#define cardboard_DeviceParams_model_tag         2
#define cardboard_DeviceParams_screen_to_lens_distance_tag 3
#define cardboard_DeviceParams_inter_lens_distance_tag 4
#define cardboard_DeviceParams_left_eye_field_of_view_angles_tag 5
#define cardboard_DeviceParams_tray_to_lens_distance_tag 6
#define cardboard_DeviceParams_distortion_coefficients_tag 7
#define cardboard_DeviceParams_vertical_alignment_tag 11
#define cardboard_DeviceParams_primary_button_tag 12

/* Struct field encoding specification for nanopb */
#define cardboard_DeviceParams_FIELDLIST(X, a) \
X(a, CALLBACK, OPTIONAL, STRING,   vendor,            1) \
X(a, CALLBACK, OPTIONAL, STRING,   model,             2) \
X(a, STATIC,   OPTIONAL, FLOAT,    screen_to_lens_distance,   3) \
X(a, STATIC,   OPTIONAL, FLOAT,    inter_lens_distance,   4) \
X(a, CALLBACK, REPEATED, FLOAT,    left_eye_field_of_view_angles,   5) \
X(a, STATIC,   OPTIONAL, FLOAT,    tray_to_lens_distance,   6) \
X(a, CALLBACK, REPEATED, FLOAT,    distortion_coefficients,   7) \
X(a, STATIC,   OPTIONAL, UENUM,    vertical_alignment,  11) \
X(a, STATIC,   OPTIONAL, UENUM,    primary_button,   12)
#define cardboard_DeviceParams_CALLBACK pb_default_field_callback
#define cardboard_DeviceParams_DEFAULT (const pb_byte_t*)"\x60\x01\x00"

extern const pb_msgdesc_t cardboard_DeviceParams_msg;

/* Defines for backwards compatibility with code written before nanopb-0.4.0 */
#define cardboard_DeviceParams_fields &cardboard_DeviceParams_msg

/* Maximum encoded size of messages (where known) */
/* cardboard_DeviceParams_size depends on runtime parameters */

#ifdef __cplusplus
} /* extern "C" */
#endif

#endif
