Lines Matching refs:v
38 static uint32_t extract(uint32_t v, int h, int l, int bits);
39 static uint32_t expand(uint32_t v, int sbits, int dbits);
40 static uint32_t downshift_component(uint32_t in, uint32_t v,
121 uint32_t v = 0; in read_pixel() local
123 case 1: v = *data; break; in read_pixel()
124 case 2: v = *(uint16_t*)data; break; in read_pixel()
125 case 3: v = (data[2]<<16)|(data[1]<<8)|data[0]; break; in read_pixel()
126 case 4: v = GGL_RGBA_TO_HOST(*(uint32_t*)data); break; in read_pixel()
131 pixel->c[i] = extract(v, f->c[i].h, f->c[i].l, f->size*8); in read_pixel()
138 uint16_t v = *(reinterpret_cast<uint16_t*>(s->data) + (x + (s->stride * y))); in readRGB565() local
140 pixel->c[1] = v>>11; in readRGB565()
141 pixel->c[2] = (v>>5)&0x3F; in readRGB565()
142 pixel->c[3] = v&0x1F; in readRGB565()
152 uint32_t v = *(reinterpret_cast<uint32_t*>(s->data) + (x + (s->stride * y))); in readABGR8888() local
153 v = GGL_RGBA_TO_HOST(v); in readABGR8888()
154 pixel->c[0] = v>>24; // A in readABGR8888()
155 pixel->c[1] = v&0xFF; // R in readABGR8888()
156 pixel->c[2] = (v>>8)&0xFF; // G in readABGR8888()
157 pixel->c[3] = (v>>16)&0xFF; // B in readABGR8888()
180 uint32_t v = 0; in write_pixel() local
198 v = downshift_component(v, u, pixelSize, 0, h, l, 0, 0, dither); in write_pixel()
212 v = logic_op(c->state.logic_op.opcode, v, d); in write_pixel()
213 v &= mask; in write_pixel()
215 v |= (d & ~mask); in write_pixel()
219 case 1: *data = v; break; in write_pixel()
220 case 2: *(uint16_t*)data = v; break; in write_pixel()
222 data[0] = v; in write_pixel()
223 data[1] = v>>8; in write_pixel()
224 data[2] = v>>16; in write_pixel()
226 case 4: *(uint32_t*)data = GGL_HOST_TO_RGBA(v); break; in write_pixel()
254 uint32_t ggl_expand(uint32_t v, int sbits, int dbits) in ggl_expand() argument
256 return expand(v, sbits, dbits); in ggl_expand()
283 uint32_t extract(uint32_t v, int h, int l, int bits) in extract() argument
287 v >>= l; in extract()
290 v &= (1<<(h-l))-1; in extract()
292 return v; in extract()
296 uint32_t expand(uint32_t v, int sbits, int dbits) in expand() argument
301 v = (v<<dbits) - v; in expand()
304 v <<= (dbits-sbits); in expand()
307 v |= v>>sbits; in expand()
314 v |= v<<sbits; in expand()
323 return v; in expand()
328 uint32_t downshift_component( uint32_t in, uint32_t v, in downshift_component() argument
342 v -= (v>>dbits); // fix up in downshift_component()
344 if (shift >= 0) v += (dither >> shift) << sl; in downshift_component()
345 else v += (dither << (-shift)) << sl; in downshift_component()
360 v <<= 32-sh; in downshift_component()
367 v >>= sh-dbits; in downshift_component()
370 in |= v<<dl; in downshift_component()
375 in |= v<<shift; in downshift_component()
381 if (shift > 0) in |= v>>shift; in downshift_component()
382 else if (shift < 0) in |= v<<shift; in downshift_component()
383 else in |= v; in downshift_component()