double CellCodeToFloat(CellCode cellCode) { var bytes = BitConverter.GetBytes((ulong)cellCode); return BitConverter.ToDouble(bytes, 0); }
double CellIndexToFloat(CellCode code, uint index) { var bytes = BitConverter.GetBytes((ulong)((index << 4) + (ulong)code)); return BitConverter.ToDouble(bytes, 0); }
bool CompareCellCodes(double pixelCode, CellCode cellCode) { var bytes = BitConverter.GetBytes(pixelCode); uint code = BitConverter.ToUInt32(bytes, 0); return (CellCode)(code - ((code>>4)<<4)) == cellCode; }