CodeCountsMap
Assemble::expand_code_counts_map() const
{
	int n = code_counts_map.size() - 1;

	double* x = new double[SCANNER_LINING_CODES];
	double* y = new double[SCANNER_LINING_CODES];
	double* p = new double[SCANNER_LINING_CODES];

	CodeCountsMap new_map;

	// initiate new code counts map
	int i = SCANNER_LINING_CODE_MIN;
	while (i <= SCANNER_LINING_CODE_MAX) {
		new_map.insert(CodeCountsPair( guint8(i),
			Image::DataVector(SCANNER_STRIPS_PER_CHIP_REAL)));
		++i;
	}

	for ( i = 0; i < SCANNER_STRIPS_PER_CHIP_REAL; ++i) {
		unsigned int k = 0;
		CodeCountsMap::const_iterator iter;
		for ( iter = code_counts_map.begin(); iter != code_counts_map.end();
			++iter, ++k) {
			x[k] = double(iter->first);
			y[k] = double(iter->second[i]);
		}
		ccm_cspl( x, y, p, n, tension);
		for ( int j = SCANNER_LINING_CODE_MIN; j <= SCANNER_LINING_CODE_MAX;
			++j) {
			new_map[j][i] = ccm_splfit( double(j), x, y, p, n, tension);
		}
	}
	delete [] x;
	delete [] y;
	delete [] p;

	return new_map;
}
Exemple #2
0
bool LaserdockDevice::get_output(bool *enabled) {
    uint8_t enabled8;
    bool success =  guint8(d->devh_ctl, 0x81, &enabled8);
    *enabled = (enabled8 == 1)? true : false;
    return success;
}