Lines Matching refs:pic
45 static void SnapTopLeftPosition(const WebPPicture* const pic, in SnapTopLeftPosition() argument
47 if (!pic->use_argb) { in SnapTopLeftPosition()
54 static int AdjustAndCheckRectangle(const WebPPicture* const pic, in AdjustAndCheckRectangle() argument
57 SnapTopLeftPosition(pic, left, top); in AdjustAndCheckRectangle()
60 if ((*left) + width > pic->width) return 0; in AdjustAndCheckRectangle()
61 if ((*top) + height > pic->height) return 0; in AdjustAndCheckRectangle()
132 int WebPPictureCrop(WebPPicture* pic, in WebPPictureCrop() argument
136 if (pic == NULL) return 0; in WebPPictureCrop()
137 if (!AdjustAndCheckRectangle(pic, &left, &top, width, height)) return 0; in WebPPictureCrop()
139 PictureGrabSpecs(pic, &tmp); in WebPPictureCrop()
144 if (!pic->use_argb) { in WebPPictureCrop()
145 const int y_offset = top * pic->y_stride + left; in WebPPictureCrop()
146 const int uv_offset = (top / 2) * pic->uv_stride + left / 2; in WebPPictureCrop()
147 CopyPlane(pic->y + y_offset, pic->y_stride, in WebPPictureCrop()
149 CopyPlane(pic->u + uv_offset, pic->uv_stride, in WebPPictureCrop()
151 CopyPlane(pic->v + uv_offset, pic->uv_stride, in WebPPictureCrop()
155 const int a_offset = top * pic->a_stride + left; in WebPPictureCrop()
156 CopyPlane(pic->a + a_offset, pic->a_stride, in WebPPictureCrop()
161 (const uint8_t*)(pic->argb + top * pic->argb_stride + left); in WebPPictureCrop()
162 CopyPlane(src, pic->argb_stride * 4, in WebPPictureCrop()
166 WebPPictureFree(pic); in WebPPictureCrop()
167 *pic = tmp; in WebPPictureCrop()
196 static void AlphaMultiplyARGB(WebPPicture* const pic, int inverse) { in AlphaMultiplyARGB() argument
197 assert(pic->argb != NULL); in AlphaMultiplyARGB()
198 WebPMultARGBRows((uint8_t*)pic->argb, pic->argb_stride * sizeof(*pic->argb), in AlphaMultiplyARGB()
199 pic->width, pic->height, inverse); in AlphaMultiplyARGB()
202 static void AlphaMultiplyY(WebPPicture* const pic, int inverse) { in AlphaMultiplyY() argument
203 if (pic->a != NULL) { in AlphaMultiplyY()
204 WebPMultRows(pic->y, pic->y_stride, pic->a, pic->a_stride, in AlphaMultiplyY()
205 pic->width, pic->height, inverse); in AlphaMultiplyY()
209 int WebPPictureRescale(WebPPicture* pic, int width, int height) { in WebPPictureRescale() argument
214 if (pic == NULL) return 0; in WebPPictureRescale()
215 prev_width = pic->width; in WebPPictureRescale()
216 prev_height = pic->height; in WebPPictureRescale()
228 PictureGrabSpecs(pic, &tmp); in WebPPictureRescale()
233 if (!pic->use_argb) { in WebPPictureRescale()
240 if (pic->a != NULL) { in WebPPictureRescale()
242 RescalePlane(pic->a, prev_width, prev_height, pic->a_stride, in WebPPictureRescale()
248 AlphaMultiplyY(pic, 0); in WebPPictureRescale()
249 RescalePlane(pic->y, prev_width, prev_height, pic->y_stride, in WebPPictureRescale()
253 RescalePlane(pic->u, in WebPPictureRescale()
254 HALVE(prev_width), HALVE(prev_height), pic->uv_stride, in WebPPictureRescale()
257 RescalePlane(pic->v, in WebPPictureRescale()
258 HALVE(prev_width), HALVE(prev_height), pic->uv_stride, in WebPPictureRescale()
271 AlphaMultiplyARGB(pic, 0); in WebPPictureRescale()
272 RescalePlane((const uint8_t*)pic->argb, prev_width, prev_height, in WebPPictureRescale()
273 pic->argb_stride * 4, in WebPPictureRescale()
279 WebPPictureFree(pic); in WebPPictureRescale()
281 *pic = tmp; in WebPPictureRescale()