1 #include "interfaces.h"
6 const IColorTransformer::Plane
IColorTransformer::Plane::Empty(0,-1,-1,-1,0,UpdateInfo());
8 void IQuality2SquareError::completeSquareRangeErrors
9 ( float quality
, int levelEnd
, float *errors
) {
10 assert( checkBoundsFunc
<float>(0,quality
,1)==quality
&& levelEnd
>2 && errors
);
12 float (IQuality2SquareError::*func
)(float,int)= &IQuality2SquareError::rangeSE
;
14 for (int level
=2; level
<levelEnd
; ++level
)
15 errors
[level
]= (this->*func
)( quality
, powers
[level
*2] );
18 bool IRoot::allSettingsToFile(const char *fileName
) {
20 ofstream
file( fileName
, ios_base::binary
|ios_base::trunc
|ios_base::out
);
21 file
.exceptions( ifstream::eofbit
| ifstream::failbit
| ifstream::badbit
);
22 put( file
, SettingsMagic
);
23 saveAllSettings(file
);
25 } catch(exception
&e
) {
30 bool IRoot::allSettingsFromFile(const char *fileName
) {
31 assert(getMode()==Clear
);
33 ifstream
file( fileName
, ios_base::binary
|ios_base::in
);
34 file
.exceptions( ifstream::eofbit
| ifstream::failbit
| ifstream::badbit
);
35 if (get
<Uint16
>(file
)!=SettingsMagic
)
37 loadAllSettings(file
);
39 } catch(exception
&e
) {