9 template<
typename U =
unsigned char>
38 void predict(
const U* p,
int bpp,
int bpr,
int (* predictor)(
int,
int,
int)) __attribute__((always_inline))
40 c[0] = predictor(p[
C0 - bpp], p[
C0 - bpr], p[
C0 - bpp - bpr]);
41 c[1] = predictor(p[
C1 - bpp], p[
C1 - bpr], p[
C1 - bpp - bpr]);
42 c[2] = predictor(p[
C2 - bpp], p[
C2 - bpr], p[
C2 - bpp - bpr]);
61 return c[0] == other.
c[0] &&
c[1] == other.
c[1] &&
c[2] == other.
c[2];
78 if (
sizeof(U) ==
sizeof(
signed char))
80 c[0] =
s2u((
signed char)
c[0]);
81 c[1] =
s2u((
signed char) c[1]);
82 c[2] =
s2u((
signed char) c[2]);
84 else if (
sizeof(U) ==
sizeof(
signed short))
86 c[0] =
s2u((
signed short)
c[0]);
87 c[1] =
s2u((
signed short) c[1]);
88 c[2] =
s2u((
signed short) c[2]);
static unsigned int numBits(unsigned int v)
void readBits(BitDecoder<> &bc, int numBits)
static int u2s(unsigned int u)
void predict(const U *p, int bpp, int bpr, int(*predictor)(int, int, int)) __attribute__((always_inline))
unsigned int numBits() const
void operator+=(const Pixel< U > &other)
void writeBits(unsigned int bits, unsigned int count)
void writeBits(BitEncoder<> &bc, int numBits) const
void readFrom(const U *p)
bool operator==(const Pixel< U > &other) const
unsigned int readBits(unsigned int count)
void operator-=(const Pixel< U > &other)
static unsigned int s2u(int s)