means add/subtract 1 to/from 0 and store the result to 0. here are the code fragments:
https://github.com/LAStools/LAStools/blob/master/LASlib/src/lastransform.cpp#L802class LASoperationAddRegisters : public LASoperation
{
public:
inline const CHAR* name() const { return "add_registers"; };
inline I32 get_command(CHAR* string) const { return sprintf(string, "-%s %u %u %u ", name(), input1, input2, output); };
inline void transform(LASpoint* point) {
F64 result = registers[input1] + registers[input2];
registers[output] = result;
};
LASoperationAddRegisters(F64* registers, U32 input1, U32 input2, U32 output) { this->registers = registers; this->input1 = input1; this->input2 = input2; this->output = output; };
private:
F64* registers;
U32 input1;
U32 input2;
U32 output;
};
class LASoperationSubtractRegisters : public LASoperation
{
public:
inline const CHAR* name() const { return "subtract_registers"; };
inline I32 get_command(CHAR* string) const { return sprintf(string, "-%s %u %u %u ", name(), input1, input2, output); };
inline void transform(LASpoint* point) {
F64 result = registers[input1] - registers[input2];
registers[output] = result;
};
LASoperationSubtractRegisters(F64* registers, U32 input1, U32 input2, U32 output) { this->registers = registers; this->input1 = input1; this->input2 = input2; this->output = output; };
private:
F64* registers;
U32 input1;
U32 input2;
U32 output;
};