Lines Matching refs:pic
337 int WebPEncodingSetError(const WebPPicture* const pic,
341 ((WebPPicture*)pic)->error_code = error;
345 int WebPReportProgress(const WebPPicture* const pic,
349 if (pic->progress_hook && !pic->progress_hook(percent, pic)) {
351 WebPEncodingSetError(pic, VP8_ENC_ERROR_USER_ABORT);
359 int WebPEncode(const WebPConfig* config, WebPPicture* pic) {
362 if (pic == NULL)
364 WebPEncodingSetError(pic, VP8_ENC_OK); // all ok so far
366 return WebPEncodingSetError(pic, VP8_ENC_ERROR_NULL_PARAMETER);
368 return WebPEncodingSetError(pic, VP8_ENC_ERROR_INVALID_CONFIGURATION);
369 if (pic->width <= 0 || pic->height <= 0)
370 return WebPEncodingSetError(pic, VP8_ENC_ERROR_BAD_DIMENSION);
371 if (pic->width > WEBP_MAX_DIMENSION || pic->height > WEBP_MAX_DIMENSION)
372 return WebPEncodingSetError(pic, VP8_ENC_ERROR_BAD_DIMENSION);
374 if (pic->stats != NULL) memset(pic->stats, 0, sizeof(*pic->stats));
378 if (pic->y == NULL || pic->u == NULL || pic->v == NULL) {
380 if (!WebPPictureARGBToYUVA(pic, WEBP_YUV420)) return 0;
383 enc = InitVP8Encoder(config, pic);
384 if (enc == NULL) return 0; // pic->error is already set.
408 if (pic->argb == NULL && !WebPPictureYUVAToARGB(pic)) {
412 ok = VP8LEncodeImage(config, pic); // Sets pic->error in case of problem.