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

Function ReadProtoStyle

deps/tesseract/classify/clusttool.cpp:242–266  ·  view source on GitHub ↗

* This routine reads an single token from the specified * text file and interprets it as a prototype specification. * @param File open text file to read prototype style from * @return Prototype style read from text file * @note Globals: None * @note Exceptions: ILLEGALSTYLESPEC illegal prototype style specification * @note History: 6/8/89, DSJ, Created. */

Source from the content-addressed store, hash-verified

240 * @note History: 6/8/89, DSJ, Created.
241 */
242PROTOSTYLE ReadProtoStyle(FILE *File) {
243 char Token[TOKENSIZE];
244 PROTOSTYLE Style;
245
246 if (tfscanf(File, "%s", Token) != 1)
247 DoError (ILLEGALSTYLESPEC, "Illegal prototype style specification");
248 switch (Token[0]) {
249 case 's':
250 Style = spherical;
251 break;
252 case 'e':
253 Style = elliptical;
254 break;
255 case 'm':
256 Style = mixed;
257 break;
258 case 'a':
259 Style = automatic;
260 break;
261 default:
262 Style = elliptical;
263 DoError (ILLEGALSTYLESPEC, "Illegal prototype style specification");
264 }
265 return (Style);
266}
267
268/**
269 * This routine reads N floats from the specified text file

Callers 1

ReadPrototypeFunction · 0.85

Calls 2

tfscanfFunction · 0.85
DoErrorFunction · 0.85

Tested by

no test coverage detected