Monado OpenXR Runtime
alpha_encoding.cpp File Reference

OpenGloves Alpha Encoding Decoding implementation. More...

#include <string>
#include <stdexcept>
#include <map>
#include "util/u_logging.h"
#include "alpha_encoding.h"
#include "encoding.h"
Include dependency graph for alpha_encoding.cpp:

Enumerations

enum  opengloves_alpha_encoding_key {
  OPENGLOVES_ALPHA_ENCODING_FinThumb , OPENGLOVES_ALPHA_ENCODING_FinSplayThumb , OPENGLOVES_ALPHA_ENCODING_FinIndex , OPENGLOVES_ALPHA_ENCODING_FinSplayIndex ,
  OPENGLOVES_ALPHA_ENCODING_FinMiddle , OPENGLOVES_ALPHA_ENCODING_FinSplayMiddle , OPENGLOVES_ALPHA_ENCODING_FinRing , OPENGLOVES_ALPHA_ENCODING_FinSplayRing ,
  OPENGLOVES_ALPHA_ENCODING_FinPinky , OPENGLOVES_ALPHA_ENCODING_FinSplayPinky , OPENGLOVES_ALPHA_ENCODING_FinJointThumb0 , OPENGLOVES_ALPHA_ENCODING_FinJointThumb1 ,
  OPENGLOVES_ALPHA_ENCODING_FinJointThumb2 , OPENGLOVES_ALPHA_ENCODING_FinJointThumb3 , OPENGLOVES_ALPHA_ENCODING_FinJointIndex0 , OPENGLOVES_ALPHA_ENCODING_FinJointIndex1 ,
  OPENGLOVES_ALPHA_ENCODING_FinJointIndex2 , OPENGLOVES_ALPHA_ENCODING_FinJointIndex3 , OPENGLOVES_ALPHA_ENCODING_FinJointMiddle0 , OPENGLOVES_ALPHA_ENCODING_FinJointMiddle1 ,
  OPENGLOVES_ALPHA_ENCODING_FinJointMiddle2 , OPENGLOVES_ALPHA_ENCODING_FinJointMiddle3 , OPENGLOVES_ALPHA_ENCODING_FinJointRing0 , OPENGLOVES_ALPHA_ENCODING_FinJointRing1 ,
  OPENGLOVES_ALPHA_ENCODING_FinJointRing2 , OPENGLOVES_ALPHA_ENCODING_FinJointRing3 , OPENGLOVES_ALPHA_ENCODING_FinJointPinky0 , OPENGLOVES_ALPHA_ENCODING_FinJointPinky1 ,
  OPENGLOVES_ALPHA_ENCODING_FinJointPinky2 , OPENGLOVES_ALPHA_ENCODING_FinJointPinky3 , OPENGLOVES_ALPHA_ENCODING_JoyX , OPENGLOVES_ALPHA_ENCODING_JoyY ,
  OPENGLOVES_ALPHA_ENCODING_JoyBtn , OPENGLOVES_ALPHA_ENCODING_TrgValue , OPENGLOVES_ALPHA_ENCODING_BtnTrg , OPENGLOVES_ALPHA_ENCODING_BtnA ,
  OPENGLOVES_ALPHA_ENCODING_BtnB , OPENGLOVES_ALPHA_ENCODING_GesGrab , OPENGLOVES_ALPHA_ENCODING_GesPinch , OPENGLOVES_ALPHA_ENCODING_BtnMenu ,
  OPENGLOVES_ALPHA_ENCODING_BtnCalib , OPENGLOVES_ALPHA_ENCODING_MAX
}
 

Functions

static bool opengloves_alpha_encoding_is_key_character (const char character)
 
static std::map< int, std::string > opengloves_alpha_encoding_parse_to_map (const std::string &str)
 
void opengloves_alpha_encoding_decode (const char *data, struct opengloves_input *out)
 
void opengloves_alpha_encoding_encode (const struct opengloves_output *output, char *out_buff)
 

Variables

static const std::string opengloves_alpha_encoding_key_characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ()"
 
static const std::map< std::string, int > opengloves_alpha_encoding_input_key_string
 
static const std::map< int, std::string > opengloves_alpha_encoding_output_key_string
 

Detailed Description

OpenGloves Alpha Encoding Decoding implementation.

Author
Daniel Willmott web@d.nosp@m.an-w.nosp@m..com

Variable Documentation

◆ opengloves_alpha_encoding_output_key_string

const std::map<int, std::string> opengloves_alpha_encoding_output_key_string
static
Initial value:
{
{OPENGLOVES_ALPHA_ENCODING_FinThumb, "A"},
{OPENGLOVES_ALPHA_ENCODING_FinIndex, "B"},
{OPENGLOVES_ALPHA_ENCODING_FinMiddle, "C"},
{OPENGLOVES_ALPHA_ENCODING_FinRing, "D"},
{OPENGLOVES_ALPHA_ENCODING_FinPinky, "E"},
}