Lines Matching refs:pic
70 void WebPCleanupTransparentArea(WebPPicture* pic) { in WebPCleanupTransparentArea() argument
72 if (pic == NULL) return; in WebPCleanupTransparentArea()
73 w = pic->width / SIZE; in WebPCleanupTransparentArea()
74 h = pic->height / SIZE; in WebPCleanupTransparentArea()
77 if (pic->use_argb) { in WebPCleanupTransparentArea()
82 const int off = (y * pic->argb_stride + x) * SIZE; in WebPCleanupTransparentArea()
83 if (is_transparent_argb_area(pic->argb + off, pic->argb_stride, SIZE)) { in WebPCleanupTransparentArea()
85 argb_value = pic->argb[off]; in WebPCleanupTransparentArea()
88 flatten_argb(pic->argb + off, argb_value, pic->argb_stride, SIZE); in WebPCleanupTransparentArea()
95 const uint8_t* const a_ptr = pic->a; in WebPCleanupTransparentArea()
101 const int off_a = (y * pic->a_stride + x) * SIZE; in WebPCleanupTransparentArea()
102 const int off_y = (y * pic->y_stride + x) * SIZE; in WebPCleanupTransparentArea()
103 const int off_uv = (y * pic->uv_stride + x) * SIZE2; in WebPCleanupTransparentArea()
104 if (is_transparent_area(a_ptr + off_a, pic->a_stride, SIZE)) { in WebPCleanupTransparentArea()
106 values[0] = pic->y[off_y]; in WebPCleanupTransparentArea()
107 values[1] = pic->u[off_uv]; in WebPCleanupTransparentArea()
108 values[2] = pic->v[off_uv]; in WebPCleanupTransparentArea()
111 flatten(pic->y + off_y, values[0], pic->y_stride, SIZE); in WebPCleanupTransparentArea()
112 flatten(pic->u + off_uv, values[1], pic->uv_stride, SIZE2); in WebPCleanupTransparentArea()
113 flatten(pic->v + off_uv, values[2], pic->uv_stride, SIZE2); in WebPCleanupTransparentArea()
125 void WebPCleanupTransparentAreaLossless(WebPPicture* const pic) { in WebPCleanupTransparentAreaLossless() argument
128 assert(pic != NULL && pic->use_argb); in WebPCleanupTransparentAreaLossless()
129 w = pic->width; in WebPCleanupTransparentAreaLossless()
130 h = pic->height; in WebPCleanupTransparentAreaLossless()
131 argb = pic->argb; in WebPCleanupTransparentAreaLossless()
139 argb += pic->argb_stride; in WebPCleanupTransparentAreaLossless()
151 void WebPBlendAlpha(WebPPicture* pic, uint32_t background_rgb) { in WebPBlendAlpha() argument
156 if (pic == NULL) return; in WebPBlendAlpha()
157 if (!pic->use_argb) { in WebPBlendAlpha()
158 const int uv_width = (pic->width >> 1); // omit last pixel during u/v loop in WebPBlendAlpha()
163 const int has_alpha = pic->colorspace & WEBP_CSP_ALPHA_BIT; in WebPBlendAlpha()
164 if (!has_alpha || pic->a == NULL) return; // nothing to do in WebPBlendAlpha()
165 for (y = 0; y < pic->height; ++y) { in WebPBlendAlpha()
167 uint8_t* const y_ptr = pic->y + y * pic->y_stride; in WebPBlendAlpha()
168 uint8_t* const a_ptr = pic->a + y * pic->a_stride; in WebPBlendAlpha()
169 for (x = 0; x < pic->width; ++x) { in WebPBlendAlpha()
177 uint8_t* const u = pic->u + (y >> 1) * pic->uv_stride; in WebPBlendAlpha()
178 uint8_t* const v = pic->v + (y >> 1) * pic->uv_stride; in WebPBlendAlpha()
180 (y + 1 == pic->height) ? a_ptr : a_ptr + pic->a_stride; in WebPBlendAlpha()
190 if (pic->width & 1) { // rightmost pixel in WebPBlendAlpha()
196 memset(a_ptr, 0xff, pic->width); in WebPBlendAlpha()
199 uint32_t* argb = pic->argb; in WebPBlendAlpha()
201 for (y = 0; y < pic->height; ++y) { in WebPBlendAlpha()
202 for (x = 0; x < pic->width; ++x) { in WebPBlendAlpha()
218 argb += pic->argb_stride; in WebPBlendAlpha()