Lines Matching refs:v

36 static uint32_t extract(uint32_t v, int h, int l, int bits);
37 static uint32_t expand(uint32_t v, int sbits, int dbits);
38 static uint32_t downshift_component(uint32_t in, uint32_t v,
119 uint32_t v = 0; in read_pixel() local
121 case 1: v = *data; break; in read_pixel()
122 case 2: v = *(uint16_t*)data; break; in read_pixel()
123 case 3: v = (data[2]<<16)|(data[1]<<8)|data[0]; break; in read_pixel()
124 case 4: v = GGL_RGBA_TO_HOST(*(uint32_t*)data); break; in read_pixel()
129 pixel->c[i] = extract(v, f->c[i].h, f->c[i].l, f->size*8); in read_pixel()
136 uint16_t v = *(reinterpret_cast<uint16_t*>(s->data) + (x + (s->stride * y))); in readRGB565() local
138 pixel->c[1] = v>>11; in readRGB565()
139 pixel->c[2] = (v>>5)&0x3F; in readRGB565()
140 pixel->c[3] = v&0x1F; in readRGB565()
150 uint32_t v = *(reinterpret_cast<uint32_t*>(s->data) + (x + (s->stride * y))); in readABGR8888() local
151 v = GGL_RGBA_TO_HOST(v); in readABGR8888()
152 pixel->c[0] = v>>24; // A in readABGR8888()
153 pixel->c[1] = v&0xFF; // R in readABGR8888()
154 pixel->c[2] = (v>>8)&0xFF; // G in readABGR8888()
155 pixel->c[3] = (v>>16)&0xFF; // B in readABGR8888()
178 uint32_t v = 0; in write_pixel() local
196 v = downshift_component(v, u, pixelSize, 0, h, l, 0, 0, dither); in write_pixel()
210 v = logic_op(c->state.logic_op.opcode, v, d); in write_pixel()
211 v &= mask; in write_pixel()
213 v |= (d & ~mask); in write_pixel()
217 case 1: *data = v; break; in write_pixel()
218 case 2: *(uint16_t*)data = v; break; in write_pixel()
220 data[0] = v; in write_pixel()
221 data[1] = v>>8; in write_pixel()
222 data[2] = v>>16; in write_pixel()
224 case 4: *(uint32_t*)data = GGL_HOST_TO_RGBA(v); break; in write_pixel()
252 uint32_t ggl_expand(uint32_t v, int sbits, int dbits) in ggl_expand() argument
254 return expand(v, sbits, dbits); in ggl_expand()
278 uint32_t extract(uint32_t v, int h, int l, int bits) in extract() argument
282 v >>= l; in extract()
285 v &= (1<<(h-l))-1; in extract()
287 return v; in extract()
291 uint32_t expand(uint32_t v, int sbits, int dbits) in expand() argument
296 v = (v<<dbits) - v; in expand()
299 v <<= (dbits-sbits); in expand()
302 v |= v>>sbits; in expand()
309 v |= v<<sbits; in expand()
318 return v; in expand()
323 uint32_t downshift_component( uint32_t in, uint32_t v, in downshift_component() argument
337 v -= (v>>dbits); // fix up in downshift_component()
339 if (shift >= 0) v += (dither >> shift) << sl; in downshift_component()
340 else v += (dither << (-shift)) << sl; in downshift_component()
355 v <<= 32-sh; in downshift_component()
362 v >>= sh-dbits; in downshift_component()
365 in |= v<<dl; in downshift_component()
370 in |= v<<shift; in downshift_component()
376 if (shift > 0) in |= v>>shift; in downshift_component()
377 else if (shift < 0) in |= v<<shift; in downshift_component()
378 else in |= v; in downshift_component()