TryGetUInt16() public method

Try to get a unsigned short from the blob at the given offset. If successful, incrmenet offset
public TryGetUInt16 ( UInt16 &result, int &offset ) : bool
result System.UInt16
offset int
return bool
Example #1
0
 /// <summary>
 /// TODO: do 2d tables have grad/offs??
 /// </summary>
 /// <param name="blob"></param>
 /// <param name="address"></param>
 public Lut2D(string name,Blob blob, uint address)
 {
     Name = name;
     int addr = (int)(address - (uint)blob.StartAddress);
     blob.TryGetUInt16(ref cols, ref addr);
     addr += 2;
     blob.TryGetUInt32(ref colsAddress, ref addr);
     blob.TryGetUInt32(ref dataAddress, ref addr);
 }
Example #2
0
 /// <summary>
 /// WARNING ONLY USE FOR 3d TABLES
 /// TODO arrange classes as 2D/3D and base
 /// </summary>
 /// <param name="blob"></param>
 /// <param name="address"></param>
 public Lut3D(string name, Blob blob, uint address)
 {
     Name = name;
     int addr = (int)(address - (uint)blob.StartAddress);
     blob.TryGetUInt16(ref cols, ref addr);
     blob.TryGetUInt16(ref rows, ref addr);
     blob.TryGetUInt32(ref colsAddress, ref addr);
     blob.TryGetUInt32(ref rowsAddress, ref addr);
     blob.TryGetUInt32(ref dataAddress, ref addr);
     blob.TryGetUInt32(ref tableType, ref addr);
     blob.TryGetUInt32(ref gradient, ref addr);
     blob.TryGetUInt32(ref offset, ref addr);
 }