PlusLib  2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
DeckLinkAPIWrapper.cxx
Go to the documentation of this file.
1 /*=Plus=header=begin======================================================
2 Program: Plus
3 Copyright (c) Laboratory for Percutaneous Surgery. All rights reserved.
4 See License.txt for details.
5 =========================================================Plus=header=end*/
6 
7 // Local includes
8 #include "DeckLinkAPIWrapper.h"
9 
10 // IGSIO includes
11 #include <igsioCommon.h>
12 
13 //----------------------------------------------------------------------------
15 {
16 #if WIN32
17  IDeckLinkIterator* pointer;
18  if (CoCreateInstance(CLSID_CDeckLinkIterator, NULL, CLSCTX_ALL, IID_IDeckLinkIterator, (void**)&pointer) != S_OK)
19  {
20  return nullptr;
21  }
22  else
23  {
24  return pointer;
25  }
26 #else
27  return ::CreateDeckLinkIteratorInstance();
28 #endif
29 }
30 
31 //----------------------------------------------------------------------------
33 {
34 #if WIN32
35  IDeckLinkDiscovery* pointer;
36  if (CoCreateInstance(CLSID_CDeckLinkDiscovery, NULL, CLSCTX_ALL, IID_IDeckLinkDiscovery, (void**)&pointer) != S_OK)
37  {
38  return nullptr;
39  }
40  else
41  {
42  return pointer;
43  }
44 #else
45  return ::CreateDeckLinkDiscoveryInstance();
46 #endif
47 }
48 
49 //----------------------------------------------------------------------------
51 {
52 #if WIN32
53  IDeckLinkAPIInformation* pointer;
54  if (CoCreateInstance(CLSID_CDeckLinkAPIInformation, NULL, CLSCTX_ALL, IID_IDeckLinkAPIInformation, (void**)&pointer) != S_OK)
55  {
56  return nullptr;
57  }
58  else
59  {
60  return pointer;
61  }
62 #else
63  return ::CreateDeckLinkAPIInformationInstance();
64 #endif
65 }
66 
67 //----------------------------------------------------------------------------
69 {
70 #if WIN32
71  IDeckLinkGLScreenPreviewHelper* pointer;
72  if (CoCreateInstance(CLSID_CDeckLinkGLScreenPreviewHelper, NULL, CLSCTX_ALL, IID_IDeckLinkGLScreenPreviewHelper, (void**)&pointer) != S_OK)
73  {
74  return nullptr;
75  }
76  else
77  {
78  return pointer;
79  }
80 #else
81  return ::CreateOpenGLScreenPreviewHelper();
82 #endif
83 }
84 
85 //----------------------------------------------------------------------------
87 {
88 #if WIN32
89  IDeckLinkVideoConversion* pointer;
90  if (CoCreateInstance(CLSID_CDeckLinkVideoConversion, NULL, CLSCTX_ALL, IID_IDeckLinkVideoConversion, (void**)&pointer) != S_OK)
91  {
92  return nullptr;
93  }
94  else
95  {
96  return pointer;
97  }
98 #else
99  return ::CreateVideoConversionInstance();
100 #endif
101 }
102 
103 //----------------------------------------------------------------------------
105 {
106 #if WIN32
107  IDeckLinkVideoFrameAncillaryPackets* pointer;
108  if (CoCreateInstance(CLSID_CDeckLinkVideoFrameAncillaryPackets, NULL, CLSCTX_ALL, IID_IDeckLinkVideoFrameAncillaryPackets, (void**)&pointer) != S_OK)
109  {
110  return nullptr;
111  }
112  else
113  {
114  return pointer;
115  }
116 #else
117  return ::CreateVideoFrameAncillaryPacketsInstance();
118 #endif
119 }
120 
121 //----------------------------------------------------------------------------
122 BMDPixelFormat DeckLinkAPIWrapper::PixelFormatFromString(const std::string& _arg)
123 {
124  if (igsioCommon::IsEqualInsensitive(_arg, "8BitYUV"))
125  {
126  return bmdFormat8BitYUV;
127  }
128  else if (igsioCommon::IsEqualInsensitive(_arg, "10BitYUV"))
129  {
130  return bmdFormat10BitYUV;
131  }
132  else if (igsioCommon::IsEqualInsensitive(_arg, "8BitARGB"))
133  {
134  return bmdFormat8BitARGB;
135  }
136  else if (igsioCommon::IsEqualInsensitive(_arg, "8BitBGRA"))
137  {
138  return bmdFormat8BitBGRA;
139  }
140  else if (igsioCommon::IsEqualInsensitive(_arg, "10BitRGB"))
141  {
142  return bmdFormat10BitRGB;
143  }
144  else if (igsioCommon::IsEqualInsensitive(_arg, "12BitRGB"))
145  {
146  return bmdFormat12BitRGB;
147  }
148  else if (igsioCommon::IsEqualInsensitive(_arg, "12BitRGBLE"))
149  {
150  return bmdFormat12BitRGBLE;
151  }
152  else if (igsioCommon::IsEqualInsensitive(_arg, "10BitRGBXLE"))
153  {
154  return bmdFormat10BitRGBXLE;
155  }
156  else if (igsioCommon::IsEqualInsensitive(_arg, "10BitRGBX"))
157  {
158  return bmdFormat10BitRGBX;
159  }
160  else if (igsioCommon::IsEqualInsensitive(_arg, "H265"))
161  {
162  return bmdFormatH265;
163  }
164  else if (igsioCommon::IsEqualInsensitive(_arg, "DNxHR"))
165  {
166  return bmdFormatDNxHR;
167  }
168  else if (igsioCommon::IsEqualInsensitive(_arg, "12BitRAWGRBG"))
169  {
170  return bmdFormat12BitRAWGRBG;
171  }
172  else if (igsioCommon::IsEqualInsensitive(_arg, "12BitRAWJPEG"))
173  {
174  return bmdFormat12BitRAWJPEG;
175  }
176  else
177  {
178  return bmdFormatUnspecified;
179  }
180 }
181 
182 //----------------------------------------------------------------------------
183 BMDVideoConnection DeckLinkAPIWrapper::VideoConnectionFromString(const std::string& _arg)
184 {
185  if (igsioCommon::IsEqualInsensitive(_arg, "SDI"))
186  {
187  return bmdVideoConnectionSDI;
188  }
189  else if (igsioCommon::IsEqualInsensitive(_arg, "HDMI"))
190  {
191  return bmdVideoConnectionHDMI;
192  }
193  else if (igsioCommon::IsEqualInsensitive(_arg, "OpticalSDI"))
194  {
195  return bmdVideoConnectionOpticalSDI;
196  }
197  else if (igsioCommon::IsEqualInsensitive(_arg, "Component"))
198  {
199  return bmdVideoConnectionComponent;
200  }
201  else if (igsioCommon::IsEqualInsensitive(_arg, "Composite"))
202  {
203  return bmdVideoConnectionComposite;
204  }
205  else if (igsioCommon::IsEqualInsensitive(_arg, "SVideo"))
206  {
207  return bmdVideoConnectionSVideo;
208  }
209  else
210  {
211  return bmdVideoConnectionUnspecified;
212  }
213 }
214 
215 //----------------------------------------------------------------------------
216 BMDDisplayMode DeckLinkAPIWrapper::DisplayModeFromString(const std::string& _arg)
217 {
218  if (igsioCommon::IsEqualInsensitive(_arg, "NTSC"))
219  {
220  return bmdModeNTSC;
221  }
222  else if (igsioCommon::IsEqualInsensitive(_arg, "NTSC2398"))
223  {
224  return bmdModeNTSC2398;
225  }
226  else if (igsioCommon::IsEqualInsensitive(_arg, "PAL"))
227  {
228  return bmdModePAL;
229  }
230  else if (igsioCommon::IsEqualInsensitive(_arg, "NTSCp"))
231  {
232  return bmdModeNTSCp;
233  }
234  else if (igsioCommon::IsEqualInsensitive(_arg, "PALp"))
235  {
236  return bmdModePALp;
237  }
238  else if (igsioCommon::IsEqualInsensitive(_arg, "HD1080p2398"))
239  {
240  return bmdModeHD1080p2398;
241  }
242  else if (igsioCommon::IsEqualInsensitive(_arg, "HD1080p24"))
243  {
244  return bmdModeHD1080p24;
245  }
246  else if (igsioCommon::IsEqualInsensitive(_arg, "HD1080p25"))
247  {
248  return bmdModeHD1080p25;
249  }
250  else if (igsioCommon::IsEqualInsensitive(_arg, "HD1080p2997"))
251  {
252  return bmdModeHD1080p2997;
253  }
254  else if (igsioCommon::IsEqualInsensitive(_arg, "HD1080p30"))
255  {
256  return bmdModeHD1080p30;
257  }
258  else if (igsioCommon::IsEqualInsensitive(_arg, "HD1080p4795"))
259  {
260  return bmdModeHD1080p4795;
261  }
262  else if (igsioCommon::IsEqualInsensitive(_arg, "HD1080p48"))
263  {
264  return bmdModeHD1080p48;
265  }
266  else if (igsioCommon::IsEqualInsensitive(_arg, "HD1080p50"))
267  {
268  return bmdModeHD1080p50;
269  }
270  else if (igsioCommon::IsEqualInsensitive(_arg, "HD1080p5994"))
271  {
272  return bmdModeHD1080p5994;
273  }
274  else if (igsioCommon::IsEqualInsensitive(_arg, "HD1080p6000"))
275  {
276  return bmdModeHD1080p6000;
277  }
278  else if (igsioCommon::IsEqualInsensitive(_arg, "HD1080p9590"))
279  {
280  return bmdModeHD1080p9590;
281  }
282  else if (igsioCommon::IsEqualInsensitive(_arg, "HD1080p96"))
283  {
284  return bmdModeHD1080p96;
285  }
286  else if (igsioCommon::IsEqualInsensitive(_arg, "HD1080p100"))
287  {
288  return bmdModeHD1080p100;
289  }
290  else if (igsioCommon::IsEqualInsensitive(_arg, "HD1080p11988"))
291  {
292  return bmdModeHD1080p11988;
293  }
294  else if (igsioCommon::IsEqualInsensitive(_arg, "HD1080p120"))
295  {
296  return bmdModeHD1080p120;
297  }
298  else if (igsioCommon::IsEqualInsensitive(_arg, "HD1080i50"))
299  {
300  return bmdModeHD1080i50;
301  }
302  else if (igsioCommon::IsEqualInsensitive(_arg, "HD1080i5994"))
303  {
304  return bmdModeHD1080i5994;
305  }
306  else if (igsioCommon::IsEqualInsensitive(_arg, "HD1080i6000"))
307  {
308  return bmdModeHD1080i6000;
309  }
310  else if (igsioCommon::IsEqualInsensitive(_arg, "HD720p50"))
311  {
312  return bmdModeHD720p50;
313  }
314  else if (igsioCommon::IsEqualInsensitive(_arg, "HD720p5994"))
315  {
316  return bmdModeHD720p5994;
317  }
318  else if (igsioCommon::IsEqualInsensitive(_arg, "HD720p60"))
319  {
320  return bmdModeHD720p60;
321  }
322  else if (igsioCommon::IsEqualInsensitive(_arg, "2k2398"))
323  {
324  return bmdMode2k2398;
325  }
326  else if (igsioCommon::IsEqualInsensitive(_arg, "2k24"))
327  {
328  return bmdMode2k24;
329  }
330  else if (igsioCommon::IsEqualInsensitive(_arg, "2k25"))
331  {
332  return bmdMode2k25;
333  }
334  else if (igsioCommon::IsEqualInsensitive(_arg, "2kDCI2398"))
335  {
336  return bmdMode2kDCI2398;
337  }
338  else if (igsioCommon::IsEqualInsensitive(_arg, "2kDCI24"))
339  {
340  return bmdMode2kDCI24;
341  }
342  else if (igsioCommon::IsEqualInsensitive(_arg, "2kDCI25"))
343  {
344  return bmdMode2kDCI25;
345  }
346  else if (igsioCommon::IsEqualInsensitive(_arg, "2kDCI2997"))
347  {
348  return bmdMode2kDCI2997;
349  }
350  else if (igsioCommon::IsEqualInsensitive(_arg, "2kDCI30"))
351  {
352  return bmdMode2kDCI30;
353  }
354  else if (igsioCommon::IsEqualInsensitive(_arg, "2kDCI4795"))
355  {
356  return bmdMode2kDCI4795;
357  }
358  else if (igsioCommon::IsEqualInsensitive(_arg, "2kDCI48"))
359  {
360  return bmdMode2kDCI48;
361  }
362  else if (igsioCommon::IsEqualInsensitive(_arg, "2kDCI50"))
363  {
364  return bmdMode2kDCI50;
365  }
366  else if (igsioCommon::IsEqualInsensitive(_arg, "2kDCI5994"))
367  {
368  return bmdMode2kDCI5994;
369  }
370  else if (igsioCommon::IsEqualInsensitive(_arg, "2kDCI60"))
371  {
372  return bmdMode2kDCI60;
373  }
374  else if (igsioCommon::IsEqualInsensitive(_arg, "2kDCI9590"))
375  {
376  return bmdMode2kDCI9590;
377  }
378  else if (igsioCommon::IsEqualInsensitive(_arg, "2kDCI96"))
379  {
380  return bmdMode2kDCI96;
381  }
382  else if (igsioCommon::IsEqualInsensitive(_arg, "2kDCI100"))
383  {
384  return bmdMode2kDCI100;
385  }
386  else if (igsioCommon::IsEqualInsensitive(_arg, "2kDCI11988"))
387  {
388  return bmdMode2kDCI11988;
389  }
390  else if (igsioCommon::IsEqualInsensitive(_arg, "2kDCI120"))
391  {
392  return bmdMode2kDCI120;
393  }
394  else if (igsioCommon::IsEqualInsensitive(_arg, "4K2160p2398"))
395  {
396  return bmdMode4K2160p2398;
397  }
398  else if (igsioCommon::IsEqualInsensitive(_arg, "4K2160p24"))
399  {
400  return bmdMode4K2160p24;
401  }
402  else if (igsioCommon::IsEqualInsensitive(_arg, "4K2160p25"))
403  {
404  return bmdMode4K2160p25;
405  }
406  else if (igsioCommon::IsEqualInsensitive(_arg, "4K2160p2997"))
407  {
408  return bmdMode4K2160p2997;
409  }
410  else if (igsioCommon::IsEqualInsensitive(_arg, "4K2160p30"))
411  {
412  return bmdMode4K2160p30;
413  }
414  else if (igsioCommon::IsEqualInsensitive(_arg, "4K2160p4795"))
415  {
416  return bmdMode4K2160p4795;
417  }
418  else if (igsioCommon::IsEqualInsensitive(_arg, "4K2160p48"))
419  {
420  return bmdMode4K2160p48;
421  }
422  else if (igsioCommon::IsEqualInsensitive(_arg, "4K2160p50"))
423  {
424  return bmdMode4K2160p50;
425  }
426  else if (igsioCommon::IsEqualInsensitive(_arg, "4K2160p5994"))
427  {
428  return bmdMode4K2160p5994;
429  }
430  else if (igsioCommon::IsEqualInsensitive(_arg, "4K2160p60"))
431  {
432  return bmdMode4K2160p60;
433  }
434  else if (igsioCommon::IsEqualInsensitive(_arg, "4K2160p9590"))
435  {
436  return bmdMode4K2160p9590;
437  }
438  else if (igsioCommon::IsEqualInsensitive(_arg, "4K2160p96"))
439  {
440  return bmdMode4K2160p96;
441  }
442  else if (igsioCommon::IsEqualInsensitive(_arg, "4K2160p100"))
443  {
444  return bmdMode4K2160p100;
445  }
446  else if (igsioCommon::IsEqualInsensitive(_arg, "4K2160p11988"))
447  {
448  return bmdMode4K2160p11988;
449  }
450  else if (igsioCommon::IsEqualInsensitive(_arg, "4K2160p120"))
451  {
452  return bmdMode4K2160p120;
453  }
454  else if (igsioCommon::IsEqualInsensitive(_arg, "4kDCI2398"))
455  {
456  return bmdMode4kDCI2398;
457  }
458  else if (igsioCommon::IsEqualInsensitive(_arg, "4kDCI24"))
459  {
460  return bmdMode4kDCI24;
461  }
462  else if (igsioCommon::IsEqualInsensitive(_arg, "4kDCI25"))
463  {
464  return bmdMode4kDCI25;
465  }
466  else if (igsioCommon::IsEqualInsensitive(_arg, "4kDCI2997"))
467  {
468  return bmdMode4kDCI2997;
469  }
470  else if (igsioCommon::IsEqualInsensitive(_arg, "4kDCI30"))
471  {
472  return bmdMode4kDCI30;
473  }
474  else if (igsioCommon::IsEqualInsensitive(_arg, "4kDCI4795"))
475  {
476  return bmdMode4kDCI4795;
477  }
478  else if (igsioCommon::IsEqualInsensitive(_arg, "4kDCI48"))
479  {
480  return bmdMode4kDCI48;
481  }
482  else if (igsioCommon::IsEqualInsensitive(_arg, "4kDCI50"))
483  {
484  return bmdMode4kDCI50;
485  }
486  else if (igsioCommon::IsEqualInsensitive(_arg, "4kDCI5994"))
487  {
488  return bmdMode4kDCI5994;
489  }
490  else if (igsioCommon::IsEqualInsensitive(_arg, "4kDCI60"))
491  {
492  return bmdMode4kDCI60;
493  }
494  else if (igsioCommon::IsEqualInsensitive(_arg, "4kDCI9590"))
495  {
496  return bmdMode4kDCI9590;
497  }
498  else if (igsioCommon::IsEqualInsensitive(_arg, "4kDCI96"))
499  {
500  return bmdMode4kDCI96;
501  }
502  else if (igsioCommon::IsEqualInsensitive(_arg, "4kDCI100"))
503  {
504  return bmdMode4kDCI100;
505  }
506  else if (igsioCommon::IsEqualInsensitive(_arg, "4kDCI11988"))
507  {
508  return bmdMode4kDCI11988;
509  }
510  else if (igsioCommon::IsEqualInsensitive(_arg, "4kDCI120"))
511  {
512  return bmdMode4kDCI120;
513  }
514  else if (igsioCommon::IsEqualInsensitive(_arg, "8K4320p2398"))
515  {
516  return bmdMode8K4320p2398;
517  }
518  else if (igsioCommon::IsEqualInsensitive(_arg, "8K4320p24"))
519  {
520  return bmdMode8K4320p24;
521  }
522  else if (igsioCommon::IsEqualInsensitive(_arg, "8K4320p25"))
523  {
524  return bmdMode8K4320p25;
525  }
526  else if (igsioCommon::IsEqualInsensitive(_arg, "8K4320p2997"))
527  {
528  return bmdMode8K4320p2997;
529  }
530  else if (igsioCommon::IsEqualInsensitive(_arg, "8K4320p30"))
531  {
532  return bmdMode8K4320p30;
533  }
534  else if (igsioCommon::IsEqualInsensitive(_arg, "8K4320p4795"))
535  {
536  return bmdMode8K4320p4795;
537  }
538  else if (igsioCommon::IsEqualInsensitive(_arg, "8K4320p48"))
539  {
540  return bmdMode8K4320p48;
541  }
542  else if (igsioCommon::IsEqualInsensitive(_arg, "8K4320p50"))
543  {
544  return bmdMode8K4320p50;
545  }
546  else if (igsioCommon::IsEqualInsensitive(_arg, "8K4320p5994"))
547  {
548  return bmdMode8K4320p5994;
549  }
550  else if (igsioCommon::IsEqualInsensitive(_arg, "8K4320p60"))
551  {
552  return bmdMode8K4320p60;
553  }
554  else if (igsioCommon::IsEqualInsensitive(_arg, "8kDCI2398"))
555  {
556  return bmdMode8kDCI2398;
557  }
558  else if (igsioCommon::IsEqualInsensitive(_arg, "8kDCI24"))
559  {
560  return bmdMode8kDCI24;
561  }
562  else if (igsioCommon::IsEqualInsensitive(_arg, "8kDCI25"))
563  {
564  return bmdMode8kDCI25;
565  }
566  else if (igsioCommon::IsEqualInsensitive(_arg, "8kDCI2997"))
567  {
568  return bmdMode8kDCI2997;
569  }
570  else if (igsioCommon::IsEqualInsensitive(_arg, "8kDCI30"))
571  {
572  return bmdMode8kDCI30;
573  }
574  else if (igsioCommon::IsEqualInsensitive(_arg, "8kDCI4795"))
575  {
576  return bmdMode8kDCI4795;
577  }
578  else if (igsioCommon::IsEqualInsensitive(_arg, "8kDCI48"))
579  {
580  return bmdMode8kDCI48;
581  }
582  else if (igsioCommon::IsEqualInsensitive(_arg, "8kDCI50"))
583  {
584  return bmdMode8kDCI50;
585  }
586  else if (igsioCommon::IsEqualInsensitive(_arg, "8kDCI5994"))
587  {
588  return bmdMode8kDCI5994;
589  }
590  else if (igsioCommon::IsEqualInsensitive(_arg, "8kDCI60"))
591  {
592  return bmdMode8kDCI60;
593  }
594  else if (igsioCommon::IsEqualInsensitive(_arg, "640x480p60"))
595  {
596  return bmdMode640x480p60;
597  }
598  else if (igsioCommon::IsEqualInsensitive(_arg, "800x600p60"))
599  {
600  return bmdMode800x600p60;
601  }
602  else if (igsioCommon::IsEqualInsensitive(_arg, "1440x900p50"))
603  {
604  return bmdMode1440x900p50;
605  }
606  else if (igsioCommon::IsEqualInsensitive(_arg, "1440x900p60"))
607  {
608  return bmdMode1440x900p60;
609  }
610  else if (igsioCommon::IsEqualInsensitive(_arg, "1440x1080p50"))
611  {
612  return bmdMode1440x1080p50;
613  }
614  else if (igsioCommon::IsEqualInsensitive(_arg, "1440x1080p60"))
615  {
616  return bmdMode1440x1080p60;
617  }
618  else if (igsioCommon::IsEqualInsensitive(_arg, "1600x1200p50"))
619  {
620  return bmdMode1600x1200p50;
621  }
622  else if (igsioCommon::IsEqualInsensitive(_arg, "1600x1200p60"))
623  {
624  return bmdMode1600x1200p60;
625  }
626  else if (igsioCommon::IsEqualInsensitive(_arg, "1920x1200p50"))
627  {
628  return bmdMode1920x1200p50;
629  }
630  else if (igsioCommon::IsEqualInsensitive(_arg, "1920x1200p60"))
631  {
632  return bmdMode1920x1200p60;
633  }
634  else if (igsioCommon::IsEqualInsensitive(_arg, "1920x1440p50"))
635  {
636  return bmdMode1920x1440p50;
637  }
638  else if (igsioCommon::IsEqualInsensitive(_arg, "1920x1440p60"))
639  {
640  return bmdMode1920x1440p60;
641  }
642  else if (igsioCommon::IsEqualInsensitive(_arg, "2560x1440p50"))
643  {
644  return bmdMode2560x1440p50;
645  }
646  else if (igsioCommon::IsEqualInsensitive(_arg, "2560x1440p60"))
647  {
648  return bmdMode2560x1440p60;
649  }
650  else if (igsioCommon::IsEqualInsensitive(_arg, "2560x1600p50"))
651  {
652  return bmdMode2560x1600p50;
653  }
654  else if (igsioCommon::IsEqualInsensitive(_arg, "2560x1600p60"))
655  {
656  return bmdMode2560x1600p60;
657  }
658  else if (igsioCommon::IsEqualInsensitive(_arg, "CintelRAW"))
659  {
660  return bmdModeCintelRAW;
661  }
662  else if (igsioCommon::IsEqualInsensitive(_arg, "CintelCompressedRAW"))
663  {
664  return bmdModeCintelCompressedRAW;
665  }
666  else
667  {
668  return bmdModeUnknown;
669  }
670 }
static IDeckLinkGLScreenPreviewHelper *BMD_PUBLIC CreateOpenGLScreenPreviewHelper()
static IDeckLinkDiscovery *BMD_PUBLIC CreateDeckLinkDiscovery()
static IDeckLinkIterator *BMD_PUBLIC CreateDeckLinkIterator()
static BMDVideoConnection VideoConnectionFromString(const std::string &)
static IDeckLinkAPIInformation *BMD_PUBLIC CreateDeckLinkAPIInformation()
static IDeckLinkVideoConversion *BMD_PUBLIC CreateVideoConversion()
static IDeckLinkVideoFrameAncillaryPackets *BMD_PUBLIC CreateVideoFrameAncillaryPackets()
#define BMD_PUBLIC
static BMDDisplayMode DisplayModeFromString(const std::string &)
static BMDPixelFormat PixelFormatFromString(const std::string &)