WIP
DirectOutput framework for virtual pinball cabinets WIP
Go to:
Overview 
DirectOutput.General.Curve Class Reference

Represents a curve which can be used to map values (e.g. adjust a brighnetss value of a led to the brightness perception of the human eye). More...

Inheritance diagram for DirectOutput.General.Curve:
DirectOutput.General.Generic.NamedItemBase DirectOutput.General.Generic.INamedItem

Public Types

enum  CurveTypeEnum {
  CurveTypeEnum.Linear, CurveTypeEnum.Linear0To224, CurveTypeEnum.Linear0To192, CurveTypeEnum.Linear0To160,
  CurveTypeEnum.Linear0To128, CurveTypeEnum.Linear0To96, CurveTypeEnum.Linear0To64, CurveTypeEnum.Linear0To32,
  CurveTypeEnum.Linear0To16, CurveTypeEnum.InvertedLinear, CurveTypeEnum.SwissLizardsLedCurve
}
 Enumeration of predefined curves. More...
 

Public Member Functions

byte MapValue (byte CurvePosition)
 Returns the value from the specified curve position. More...
 
byte MapValue (int CurvePosition)
 Returns the value from the specified curve position. More...
 
void SetCurve (CurveTypeEnum CurveType)
 Sets the the fading curve to one of the predefined curves from the FadingCurveTypeEnum. More...
 
 Curve ()
 Initializes a new instance of the Curve class. More...
 
 Curve (CurveTypeEnum CurveType)
 Initializes a new instance of the Curve class. More...
 
System.Xml.Schema.XmlSchema GetSchema ()
 Part of the IXmlSerializable interface. Must always return null. More...
 
void ReadXml (System.Xml.XmlReader reader)
 Set the data of the object from its XML representation. More...
 
void WriteXml (System.Xml.XmlWriter writer)
 Converts the object to its xml representation. More...
 

Properties

byte[] Data [get, set]
 Gets or sets the curve data array. The curve array must have 256 elements. More...
 
- Properties inherited from DirectOutput.General.Generic.NamedItemBase
string Name [get, set]
 Name of the named item.
Triggers BeforeNameChange before a new Name is set.
Triggers AfterNameChanged after a new name has been set. More...
 
- Properties inherited from DirectOutput.General.Generic.INamedItem
string Name [get, set]
 Gets or sets the name of the item.
Must fire the BeforeNameChange and AfterNameChange events when the value of the property is changed. More...
 

Additional Inherited Members

- Protected Member Functions inherited from DirectOutput.General.Generic.NamedItemBase
virtual void AfterNameChange (string OldName, string NewName)
 
virtual void BeforeNameChange (string OldName, string NewName)
 
virtual void OnPropertyChanged (string propertyName)
 
virtual void OnPropertyChanging (string propertyName)
 
- Events inherited from DirectOutput.General.Generic.NamedItemBase
EventHandler< NameChangeEventArgsAfterNameChanged
 Event is fired after the value of the property Name has changed. More...
 
EventHandler< NameChangeEventArgsBeforeNameChanged
 Event is fired before the value of the property Name is changed. More...
 
PropertyChangedEventHandler PropertyChanged
 
PropertyChangingEventHandler PropertyChanging
 
- Events inherited from DirectOutput.General.Generic.INamedItem
EventHandler< NameChangeEventArgsBeforeNameChanged
 Occurs before the name of the item changes. More...
 
EventHandler< NameChangeEventArgsAfterNameChanged
 Occurs when after the name of the item has changed. More...
 

Detailed Description

Represents a curve which can be used to map values (e.g. adjust a brighnetss value of a led to the brightness perception of the human eye).

Definition at line 15 of file Curve.cs.

Member Enumeration Documentation

Enumeration of predefined curves.

Enumerator
Linear 

A linear curve, where each element will map to a value which is equal to the element index (0=0, 1=1 .... 254=254,255=255).

Linear0To224 

A linear curve, which maps 0 to 255 value range into a new range of 0 to 224.

Linear0To192 

A linear curve, which maps 0 to 255 value range into a new range of 0 to 192.

Linear0To160 

A linear curve, which maps 0 to 255 value range into a new range of 0 to 160.

Linear0To128 

A linear curve, which maps 0 to 255 value range into a new range of 0 to 128.

Linear0To96 

A linear curve, which maps 0 to 255 value range into a new range of 0 to 96.

Linear0To64 

A linear curve, which maps 0 to 255 value range into a new range of 0 to 64.

Linear0To32 

A linear curve, which maps 0 to 255 value range into a new range of 0 to 32.

Linear0To16 

A linear curve, which maps 0 to 255 value range into a new range of 0 to 16.

InvertedLinear 

This is a inverted linear curve where 255=0, 254=1 and so on until 1=254 and 0=255.

SwissLizardsLedCurve 

A fading curve for leds defined by SwissLizard. This curve is not fully correct when it comes to theoretically needed mapping values, but it is some kind of compromise between possible value range and the desired values.

Definition at line 20 of file Curve.cs.

Constructor & Destructor Documentation

DirectOutput.General.Curve.Curve ( )

Initializes a new instance of the Curve class.

Definition at line 220 of file Curve.cs.

DirectOutput.General.Curve.Curve ( CurveTypeEnum  CurveType)

Initializes a new instance of the Curve class.

Parameters
CurveTypeType of the curve.

Definition at line 231 of file Curve.cs.

Member Function Documentation

System.Xml.Schema.XmlSchema DirectOutput.General.Curve.GetSchema ( )

Part of the IXmlSerializable interface. Must always return null.

Returns
Return always null.

Definition at line 248 of file Curve.cs.

byte DirectOutput.General.Curve.MapValue ( byte  CurvePosition)

Returns the value from the specified curve position.

Parameters
CurvePositionThe curve position.
Returns
Value from the specified position of the curve.

Definition at line 97 of file Curve.cs.

byte DirectOutput.General.Curve.MapValue ( int  CurvePosition)

Returns the value from the specified curve position.

Parameters
CurvePositionThe curve position.
Returns
Value from the specified position of the curve.

Definition at line 108 of file Curve.cs.

void DirectOutput.General.Curve.ReadXml ( System.Xml.XmlReader  reader)

Set the data of the object from its XML representation.

Parameters
readerThe T:System.Xml.XmlReader-stream containing the data for ther object.

Definition at line 257 of file Curve.cs.

void DirectOutput.General.Curve.SetCurve ( CurveTypeEnum  CurveType)

Sets the the fading curve to one of the predefined curves from the FadingCurveTypeEnum.

Parameters
CurveTypeType of the fading curve.

Definition at line 124 of file Curve.cs.

void DirectOutput.General.Curve.WriteXml ( System.Xml.XmlWriter  writer)

Converts the object to its xml representation.

Parameters
writerThe T:System.Xml.XmlWriter-stream, to which the object is serialized.

Definition at line 323 of file Curve.cs.

Property Documentation

byte [] DirectOutput.General.Curve.Data
getset

Gets or sets the curve data array. The curve array must have 256 elements.

The curve array (256 elements).

Exceptions
System.ExceptionThe curve array must have 256 elements, but a array with {0} elements has been supplied.

Definition at line 80 of file Curve.cs.


The documentation for this class was generated from the following file: