Lines Matching full:picture
53 int WebPPictureHasTransparency(const WebPPicture* picture) { in WebPPictureHasTransparency() argument
54 if (picture == NULL) return 0; in WebPPictureHasTransparency()
55 if (!picture->use_argb) { in WebPPictureHasTransparency()
56 return CheckNonOpaque(picture->a, picture->width, picture->height, in WebPPictureHasTransparency()
57 1, picture->a_stride); in WebPPictureHasTransparency()
60 const uint32_t* argb = picture->argb; in WebPPictureHasTransparency()
62 for (y = 0; y < picture->height; ++y) { in WebPPictureHasTransparency()
63 for (x = 0; x < picture->width; ++x) { in WebPPictureHasTransparency()
66 argb += picture->argb_stride; in WebPPictureHasTransparency()
386 WebPPicture* const picture) { in ConvertWRGBToYUV() argument
388 const int w = (picture->width + 1) & ~1; in ConvertWRGBToYUV()
389 const int h = (picture->height + 1) & ~1; in ConvertWRGBToYUV()
392 for (j = 0; j < picture->height; ++j) { in ConvertWRGBToYUV()
393 for (i = 0; i < picture->width; ++i) { in ConvertWRGBToYUV()
395 const int off2 = i + j * picture->y_stride; in ConvertWRGBToYUV()
400 picture->y[off2] = ConvertRGBToY(r, g, b); in ConvertWRGBToYUV()
404 uint8_t* const dst_u = picture->u + j * picture->uv_stride; in ConvertWRGBToYUV()
405 uint8_t* const dst_v = picture->v + j * picture->uv_stride; in ConvertWRGBToYUV()
427 WebPPicture* const picture) { in PreprocessARGB() argument
429 const int w = (picture->width + 1) & ~1; in PreprocessARGB()
430 const int h = (picture->height + 1) & ~1; in PreprocessARGB()
454 ok = WebPEncodingSetError(picture, VP8_ENC_ERROR_OUT_OF_MEMORY); in PreprocessARGB()
457 assert(picture->width >= kMinDimensionIterativeConversion); in PreprocessARGB()
458 assert(picture->height >= kMinDimensionIterativeConversion); in PreprocessARGB()
461 for (j = 0; j < picture->height; j += 2) { in PreprocessARGB()
462 const int is_last_row = (j == picture->height - 1); in PreprocessARGB()
472 step, picture->width, src1); in PreprocessARGB()
475 step, picture->width, src2); in PreprocessARGB()
548 ok = ConvertWRGBToYUV(best_y, best_uv, picture); in PreprocessARGB()
841 WebPPicture* const picture) { in ImportYUVAFromRGBA() argument
843 const int width = picture->width; in ImportYUVAFromRGBA()
844 const int height = picture->height; in ImportYUVAFromRGBA()
848 picture->colorspace = has_alpha ? WEBP_YUV420A : WEBP_YUV420; in ImportYUVAFromRGBA()
849 picture->use_argb = 0; in ImportYUVAFromRGBA()
857 if (!WebPPictureAllocYUVA(picture, width, height)) { in ImportYUVAFromRGBA()
870 if (!PreprocessARGB(r_ptr, g_ptr, b_ptr, step, rgb_stride, picture)) { in ImportYUVAFromRGBA()
875 picture->a, picture->a_stride); in ImportYUVAFromRGBA()
883 uint8_t* dst_y = picture->y; in ImportYUVAFromRGBA()
884 uint8_t* dst_u = picture->u; in ImportYUVAFromRGBA()
885 uint8_t* dst_v = picture->v; in ImportYUVAFromRGBA()
886 uint8_t* dst_a = picture->a; in ImportYUVAFromRGBA()
908 WebPConvertRGB24ToY(r_ptr + off2, dst_y + picture->y_stride, width); in ImportYUVAFromRGBA()
911 WebPConvertBGR24ToY(b_ptr + off2, dst_y + picture->y_stride, width); in ImportYUVAFromRGBA()
917 dst_y + picture->y_stride, width, rg); in ImportYUVAFromRGBA()
919 dst_y += 2 * picture->y_stride; in ImportYUVAFromRGBA()
923 dst_a, picture->a_stride); in ImportYUVAFromRGBA()
924 dst_a += 2 * picture->a_stride; in ImportYUVAFromRGBA()
940 dst_u += picture->uv_stride; in ImportYUVAFromRGBA()
941 dst_v += picture->uv_stride; in ImportYUVAFromRGBA()
987 static int PictureARGBToYUVA(WebPPicture* picture, WebPEncCSP colorspace, in PictureARGBToYUVA() argument
989 if (picture == NULL) return 0; in PictureARGBToYUVA()
990 if (picture->argb == NULL) { in PictureARGBToYUVA()
991 return WebPEncodingSetError(picture, VP8_ENC_ERROR_NULL_PARAMETER); in PictureARGBToYUVA()
993 return WebPEncodingSetError(picture, VP8_ENC_ERROR_INVALID_CONFIGURATION); in PictureARGBToYUVA()
995 const uint8_t* const argb = (const uint8_t*)picture->argb; in PictureARGBToYUVA()
1001 picture->colorspace = WEBP_YUV420; in PictureARGBToYUVA()
1002 return ImportYUVAFromRGBA(r, g, b, a, 4, 4 * picture->argb_stride, in PictureARGBToYUVA()
1003 dithering, use_iterative_conversion, picture); in PictureARGBToYUVA()
1007 int WebPPictureARGBToYUVADithered(WebPPicture* picture, WebPEncCSP colorspace, in WebPPictureARGBToYUVADithered() argument
1009 return PictureARGBToYUVA(picture, colorspace, dithering, 0); in WebPPictureARGBToYUVADithered()
1012 int WebPPictureARGBToYUVA(WebPPicture* picture, WebPEncCSP colorspace) { in WebPPictureARGBToYUVA() argument
1013 return PictureARGBToYUVA(picture, colorspace, 0.f, 0); in WebPPictureARGBToYUVA()
1016 int WebPPictureSmartARGBToYUVA(WebPPicture* picture) { in WebPPictureSmartARGBToYUVA() argument
1017 return PictureARGBToYUVA(picture, WEBP_YUV420, 0.f, 1); in WebPPictureSmartARGBToYUVA()
1023 int WebPPictureYUVAToARGB(WebPPicture* picture) { in WebPPictureYUVAToARGB() argument
1024 if (picture == NULL) return 0; in WebPPictureYUVAToARGB()
1025 if (picture->y == NULL || picture->u == NULL || picture->v == NULL) { in WebPPictureYUVAToARGB()
1026 return WebPEncodingSetError(picture, VP8_ENC_ERROR_NULL_PARAMETER); in WebPPictureYUVAToARGB()
1028 if ((picture->colorspace & WEBP_CSP_ALPHA_BIT) && picture->a == NULL) { in WebPPictureYUVAToARGB()
1029 return WebPEncodingSetError(picture, VP8_ENC_ERROR_NULL_PARAMETER); in WebPPictureYUVAToARGB()
1031 if ((picture->colorspace & WEBP_CSP_UV_MASK) != WEBP_YUV420) { in WebPPictureYUVAToARGB()
1032 return WebPEncodingSetError(picture, VP8_ENC_ERROR_INVALID_CONFIGURATION); in WebPPictureYUVAToARGB()
1035 if (!WebPPictureAllocARGB(picture, picture->width, picture->height)) return 0; in WebPPictureYUVAToARGB()
1036 picture->use_argb = 1; in WebPPictureYUVAToARGB()
1041 const int width = picture->width; in WebPPictureYUVAToARGB()
1042 const int height = picture->height; in WebPPictureYUVAToARGB()
1043 const int argb_stride = 4 * picture->argb_stride; in WebPPictureYUVAToARGB()
1044 uint8_t* dst = (uint8_t*)picture->argb; in WebPPictureYUVAToARGB()
1045 const uint8_t *cur_u = picture->u, *cur_v = picture->v, *cur_y = picture->y; in WebPPictureYUVAToARGB()
1050 cur_y += picture->y_stride; in WebPPictureYUVAToARGB()
1056 cur_u += picture->uv_stride; in WebPPictureYUVAToARGB()
1057 cur_v += picture->uv_stride; in WebPPictureYUVAToARGB()
1058 upsample(cur_y, cur_y + picture->y_stride, top_u, top_v, cur_u, cur_v, in WebPPictureYUVAToARGB()
1060 cur_y += 2 * picture->y_stride; in WebPPictureYUVAToARGB()
1068 if (picture->colorspace & WEBP_CSP_ALPHA_BIT) { in WebPPictureYUVAToARGB()
1070 uint32_t* const argb_dst = picture->argb + y * picture->argb_stride; in WebPPictureYUVAToARGB()
1071 const uint8_t* const src = picture->a + y * picture->a_stride; in WebPPictureYUVAToARGB()
1085 static int Import(WebPPicture* const picture, in Import() argument
1093 const int width = picture->width; in Import()
1094 const int height = picture->height; in Import()
1096 if (!picture->use_argb) { in Import()
1098 0.f /* no dithering */, 0, picture); in Import()
1100 if (!WebPPictureAlloc(picture)) return 0; in Import()
1107 uint32_t* const dst = &picture->argb[y * picture->argb_stride]; in Import()
1115 uint32_t* const dst = &picture->argb[y * picture->argb_stride]; in Import()
1126 int WebPPictureImportRGB(WebPPicture* picture, in WebPPictureImportRGB() argument
1128 return (picture != NULL) ? Import(picture, rgb, rgb_stride, 3, 0, 0) : 0; in WebPPictureImportRGB()
1131 int WebPPictureImportBGR(WebPPicture* picture, in WebPPictureImportBGR() argument
1133 return (picture != NULL) ? Import(picture, rgb, rgb_stride, 3, 1, 0) : 0; in WebPPictureImportBGR()
1136 int WebPPictureImportRGBA(WebPPicture* picture, in WebPPictureImportRGBA() argument
1138 return (picture != NULL) ? Import(picture, rgba, rgba_stride, 4, 0, 1) : 0; in WebPPictureImportRGBA()
1141 int WebPPictureImportBGRA(WebPPicture* picture, in WebPPictureImportBGRA() argument
1143 return (picture != NULL) ? Import(picture, rgba, rgba_stride, 4, 1, 1) : 0; in WebPPictureImportBGRA()
1146 int WebPPictureImportRGBX(WebPPicture* picture, in WebPPictureImportRGBX() argument
1148 return (picture != NULL) ? Import(picture, rgba, rgba_stride, 4, 0, 0) : 0; in WebPPictureImportRGBX()
1151 int WebPPictureImportBGRX(WebPPicture* picture, in WebPPictureImportBGRX() argument
1153 return (picture != NULL) ? Import(picture, rgba, rgba_stride, 4, 1, 0) : 0; in WebPPictureImportBGRX()