31 #ifndef QUANTIZATOROP_H_
32 #define QUANTIZATOROP_H_
34 #include "../util/Functor.h"
54 "Quantize to n bits. (For integer images)"), mask(0), bitShift(0) {
55 parameters.link(
"bits", this->bits = bits);
61 int operator()(
int s)
const {
69 double operator()(
double s)
const {
71 return (1/255.0)*
static_cast<double>(operator ()(
static_cast<int>(255.0*s)));
83 for (
unsigned int i = 0; i < bits; i++)
84 mask = (mask << 1) | 1;
87 mask = mask << (1*8 - bits);
122 mutable long int mask;
124 mutable int bitShift;
LogSourc e is the means for a function or any program segment to "connect" to a Log.
Definition: Log.h:308
TODO: CopyOP should be quite similar.
Definition: QuantizatorOp.h:50
Definition: DataSelector.cpp:1277
Definition: Functor.h:116