Lines Matching refs:pic

68 void WebPCleanupTransparentArea(WebPPicture* pic) {
70 if (pic == NULL) return;
71 w = pic->width / SIZE;
72 h = pic->height / SIZE;
75 if (pic->use_argb) {
80 const int off = (y * pic->argb_stride + x) * SIZE;
81 if (is_transparent_argb_area(pic->argb + off, pic->argb_stride, SIZE)) {
83 argb_value = pic->argb[off];
86 flatten_argb(pic->argb + off, argb_value, pic->argb_stride, SIZE);
93 const uint8_t* const a_ptr = pic->a;
99 const int off_a = (y * pic->a_stride + x) * SIZE;
100 const int off_y = (y * pic->y_stride + x) * SIZE;
101 const int off_uv = (y * pic->uv_stride + x) * SIZE2;
102 if (is_transparent_area(a_ptr + off_a, pic->a_stride, SIZE)) {
104 values[0] = pic->y[off_y];
105 values[1] = pic->u[off_uv];
106 values[2] = pic->v[off_uv];
109 flatten(pic->y + off_y, values[0], pic->y_stride, SIZE);
110 flatten(pic->u + off_uv, values[1], pic->uv_stride, SIZE2);
111 flatten(pic->v + off_uv, values[2], pic->uv_stride, SIZE2);
131 void WebPBlendAlpha(WebPPicture* pic, uint32_t background_rgb) {
136 if (pic == NULL) return;
137 if (!pic->use_argb) {
138 const int uv_width = (pic->width >> 1); // omit last pixel during u/v loop
143 const int has_alpha = pic->colorspace & WEBP_CSP_ALPHA_BIT;
144 if (!has_alpha || pic->a == NULL) return; // nothing to do
145 for (y = 0; y < pic->height; ++y) {
147 uint8_t* const y_ptr = pic->y + y * pic->y_stride;
148 uint8_t* const a_ptr = pic->a + y * pic->a_stride;
149 for (x = 0; x < pic->width; ++x) {
157 uint8_t* const u = pic->u + (y >> 1) * pic->uv_stride;
158 uint8_t* const v = pic->v + (y >> 1) * pic->uv_stride;
160 (y + 1 == pic->height) ? a_ptr : a_ptr + pic->a_stride;
170 if (pic->width & 1) { // rightmost pixel
176 memset(a_ptr, 0xff, pic->width);
179 uint32_t* argb = pic->argb;
181 for (y = 0; y < pic->height; ++y) {
182 for (x = 0; x < pic->width; ++x) {
198 argb += pic->argb_stride;