Documentation
¶
Overview ¶
Go Language Raspberry Pi Interface (c) Copyright David Thorpe 2016 All Rights Reserved For Licensing and Usage information, please see LICENSE.md
PPI ¶
These methods provide support for calculating the pixels-per-inch (PPI) of a display. The function ParseLengthString parses a string to return a diaganol length in inches. Typically you will call the function with one of the following forms:
99 in 99 mm 99 cm 99 x 99 in 99 x 99 mm 99 x 99 cm
Index ¶
- Constants
- Variables
- func ParseLengthString(value string) (float64, error)
- type Dict
- func (this *Dict) GetBool(key string) (bool, bool)
- func (this *Dict) GetData(key string) ([]byte, bool)
- func (this *Dict) GetDate(key string) (time.Time, bool)
- func (this *Dict) GetDict(key string) (*Dict, bool)
- func (this *Dict) GetDuration(key string) (time.Duration, bool)
- func (this *Dict) GetFloat32(key string) (float32, bool)
- func (this *Dict) GetFloat64(key string) (float64, bool)
- func (this *Dict) GetInt(key string) (int, bool)
- func (this *Dict) GetString(key string) (string, bool)
- func (this *Dict) GetUint(key string) (uint, bool)
- func (this *Dict) IsEmpty() bool
- func (this *Dict) Keys() []string
- func (this *Dict) MarshalXML(e *xml.Encoder, start xml.StartElement) error
- func (this *Dict) SetBool(key string, value bool)
- func (this *Dict) SetData(key string, value []byte)
- func (this *Dict) SetDate(key string, value time.Time)
- func (this *Dict) SetDict(key string, value *Dict)
- func (this *Dict) SetDuration(key string, value time.Duration)
- func (this *Dict) SetFloat32(key string, value float32)
- func (this *Dict) SetFloat64(key string, value float64)
- func (this *Dict) SetInt(key string, value int)
- func (this *Dict) SetString(key string, value string)
- func (this *Dict) SetUint(key string, value uint)
- func (this *Dict) String() string
- func (this *Dict) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
Constants ¶
const ( R_OK = 4 W_OK = 2 X_OK = 1 )
const ( UNITS_IN_PER_MM float64 = 0.0393701 UNITS_IN_PER_CM float64 = 0.393701 )
Variables ¶
var ( ErrUnsupportedType = errors.New("Unsupported type") ErrParseError = errors.New("Syntax error in input") )
var ( REGEXP_PPI_D *regexp.Regexp = regexp.MustCompile("^\\s*([0-9\\.]+)\\s*(in|mm|cm)\\s*$") REGEXP_PPI_WH *regexp.Regexp = regexp.MustCompile("^\\s*([0-9\\.]+)\\s*(x|X)\\s*([0-9\\.]+)\\s*(in|mm|cm)\\s*$") )
Functions ¶
func ParseLengthString ¶
Return the length of the diagnol, in inches. On syntax error, ErrParseError is returned. On success, the number of inches on the screen diagnanol is returned.
Types ¶
type Dict ¶
type Dict struct { // Require ability to marshall and unmarshall XML xml.Marshaler xml.Unmarshaler // contains filtered or unexported fields }
Dict defines a dictionary of values, somewhat similar to Apple property lists
func NewDict ¶
NewDict creates a new empty dictionary. Use the capacity argument to provide a hint on how many items the dictionary will contain
func (*Dict) MarshalXML ¶
func (*Dict) SetDuration ¶
SetDuration sets time.Duration value for key
func (*Dict) SetFloat32 ¶
SetFloat32 sets float32 value for key
func (*Dict) SetFloat64 ¶
SetFloat64 sets float64 value for key
func (*Dict) UnmarshalXML ¶
Directories
¶
Path | Synopsis |
---|---|
Merge multiple incoming events into one, and fan out to subscribers Publish, Subscribe and Emit package for gopi.Publisher interface
|
Merge multiple incoming events into one, and fan out to subscribers Publish, Subscribe and Emit package for gopi.Publisher interface |
Provide a way to count metrics and provide total and rates
|
Provide a way to count metrics and provide total and rates |