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
コード例 #1
0
ファイル: Lut.cs プロジェクト: segapsh2/SharpTune
 /// <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);
 }
コード例 #2
0
ファイル: Lut.cs プロジェクト: segapsh2/SharpTune
 /// <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);
 }