Lines Matching refs:picture
26 const WebPPicture* const picture) { in DummyWriter() argument
30 (void)picture; in DummyWriter()
34 int WebPPictureInitInternal(WebPPicture* picture, int version) { in WebPPictureInitInternal() argument
38 if (picture != NULL) { in WebPPictureInitInternal()
39 memset(picture, 0, sizeof(*picture)); in WebPPictureInitInternal()
40 picture->writer = DummyWriter; in WebPPictureInitInternal()
41 WebPEncodingSetError(picture, VP8_ENC_OK); in WebPPictureInitInternal()
48 static void WebPPictureResetBufferARGB(WebPPicture* const picture) { in WebPPictureResetBufferARGB() argument
49 picture->memory_argb_ = NULL; in WebPPictureResetBufferARGB()
50 picture->argb = NULL; in WebPPictureResetBufferARGB()
51 picture->argb_stride = 0; in WebPPictureResetBufferARGB()
54 static void WebPPictureResetBufferYUVA(WebPPicture* const picture) { in WebPPictureResetBufferYUVA() argument
55 picture->memory_ = NULL; in WebPPictureResetBufferYUVA()
56 picture->y = picture->u = picture->v = picture->a = NULL; in WebPPictureResetBufferYUVA()
57 picture->y_stride = picture->uv_stride = 0; in WebPPictureResetBufferYUVA()
58 picture->a_stride = 0; in WebPPictureResetBufferYUVA()
61 void WebPPictureResetBuffers(WebPPicture* const picture) { in WebPPictureResetBuffers() argument
62 WebPPictureResetBufferARGB(picture); in WebPPictureResetBuffers()
63 WebPPictureResetBufferYUVA(picture); in WebPPictureResetBuffers()
66 int WebPPictureAllocARGB(WebPPicture* const picture, int width, int height) { in WebPPictureAllocARGB() argument
70 assert(picture != NULL); in WebPPictureAllocARGB()
72 WebPSafeFree(picture->memory_argb_); in WebPPictureAllocARGB()
73 WebPPictureResetBufferARGB(picture); in WebPPictureAllocARGB()
76 return WebPEncodingSetError(picture, VP8_ENC_ERROR_BAD_DIMENSION); in WebPPictureAllocARGB()
79 memory = WebPSafeMalloc(argb_size + WEBP_ALIGN_CST, sizeof(*picture->argb)); in WebPPictureAllocARGB()
81 return WebPEncodingSetError(picture, VP8_ENC_ERROR_OUT_OF_MEMORY); in WebPPictureAllocARGB()
83 picture->memory_argb_ = memory; in WebPPictureAllocARGB()
84 picture->argb = (uint32_t*)WEBP_ALIGN(memory); in WebPPictureAllocARGB()
85 picture->argb_stride = width; in WebPPictureAllocARGB()
89 int WebPPictureAllocYUVA(WebPPicture* const picture, int width, int height) { in WebPPictureAllocYUVA() argument
91 (WebPEncCSP)((int)picture->colorspace & WEBP_CSP_UV_MASK); in WebPPictureAllocYUVA()
92 const int has_alpha = (int)picture->colorspace & WEBP_CSP_ALPHA_BIT; in WebPPictureAllocYUVA()
101 assert(picture != NULL); in WebPPictureAllocYUVA()
103 WebPSafeFree(picture->memory_); in WebPPictureAllocYUVA()
104 WebPPictureResetBufferYUVA(picture); in WebPPictureAllocYUVA()
107 return WebPEncodingSetError(picture, VP8_ENC_ERROR_INVALID_CONFIGURATION); in WebPPictureAllocYUVA()
122 return WebPEncodingSetError(picture, VP8_ENC_ERROR_BAD_DIMENSION); in WebPPictureAllocYUVA()
127 return WebPEncodingSetError(picture, VP8_ENC_ERROR_OUT_OF_MEMORY); in WebPPictureAllocYUVA()
131 picture->memory_ = (void*)mem; in WebPPictureAllocYUVA()
132 picture->y_stride = y_stride; in WebPPictureAllocYUVA()
133 picture->uv_stride = uv_stride; in WebPPictureAllocYUVA()
134 picture->a_stride = a_stride; in WebPPictureAllocYUVA()
137 picture->y = mem; in WebPPictureAllocYUVA()
140 picture->u = mem; in WebPPictureAllocYUVA()
142 picture->v = mem; in WebPPictureAllocYUVA()
146 picture->a = mem; in WebPPictureAllocYUVA()
153 int WebPPictureAlloc(WebPPicture* picture) { in WebPPictureAlloc() argument
154 if (picture != NULL) { in WebPPictureAlloc()
155 const int width = picture->width; in WebPPictureAlloc()
156 const int height = picture->height; in WebPPictureAlloc()
158 WebPPictureFree(picture); // erase previous buffer in WebPPictureAlloc()
160 if (!picture->use_argb) { in WebPPictureAlloc()
161 return WebPPictureAllocYUVA(picture, width, height); in WebPPictureAlloc()
163 return WebPPictureAllocARGB(picture, width, height); in WebPPictureAlloc()
169 void WebPPictureFree(WebPPicture* picture) { in WebPPictureFree() argument
170 if (picture != NULL) { in WebPPictureFree()
171 WebPSafeFree(picture->memory_); in WebPPictureFree()
172 WebPSafeFree(picture->memory_argb_); in WebPPictureFree()
173 WebPPictureResetBuffers(picture); in WebPPictureFree()
187 const WebPPicture* picture) { in WebPMemoryWrite() argument
188 WebPMemoryWriter* const w = (WebPMemoryWriter*)picture->custom_ptr; in WebPMemoryWrite()