public TryGetUInt16 ( |
||
result | ||
offset | int | |
return | bool |
public bool TryGetUInt16(ref UInt16 result, ref int offset)
{
if (this.Content.Count < offset + 2)
{
return false;
}
result = 0;
byte temp = 0;
if (!this.TryGetByte(ref temp, ref offset))
{
return false;
}
result |= temp;
if (!this.TryGetByte(ref temp, ref offset))
{
return false;
}
result <<= 8;
result |= temp;
return true;
}
/// <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); }