alexwalterbos / image-reconstruction

Neural Network seminar image reconstruction project
0 stars 0 forks source link

Bithelper #10

Closed festen closed 10 years ago

festen commented 10 years ago

Created a bithelper class to convert everthing from/to bits and bytes

To convert to bits/bytes

var canvas   = factory.GenerateRandomCanvas();
bool[] bits  = canvas.AsBitArray();
byte[] bytes = canvas.AsByteArray();

To convert to canvas

var canvas = bits.AsCanvas();
var canvas = bytes.AsCanvas();

Bits to bytes (and vice-versa)

bits.AsByteArray();
bytes.AsBitArray()

ToString methods

bits.toBitString();
bytes.toByteString();
festen commented 10 years ago

Is deze ok ? kan ik 'm vanavond mergen