MCPcopy Create free account
hub / github.com/creatale/node-dv / DeSerialize

Method DeSerialize

deps/tesseract/ccstruct/imagedata.cpp:91–97  ·  view source on GitHub ↗

Reads from the given file. Returns false in case of error. If swap is true, assumes a big/little-endian swap is needed.

Source from the content-addressed store, hash-verified

89// Reads from the given file. Returns false in case of error.
90// If swap is true, assumes a big/little-endian swap is needed.
91bool WordFeature::DeSerialize(bool swap, FILE* fp) {
92 if (fread(&x_, sizeof(x_), 1, fp) != 1) return false;
93 if (swap) ReverseN(&x_, sizeof(x_));
94 if (fread(&y_, sizeof(y_), 1, fp) != 1) return false;
95 if (fread(&dir_, sizeof(dir_), 1, fp) != 1) return false;
96 return true;
97}
98
99void FloatWordFeature::FromWordFeatures(
100 const GenericVector<WordFeature>& word_features,

Callers

nothing calls this directly

Calls 3

ReverseNFunction · 0.85
FReadMethod · 0.80
DeSerializeClassesMethod · 0.45

Tested by

no test coverage detected