mirror of
https://github.com/webmproject/libwebp.git
synced 2025-02-13 07:22:52 +01:00
Merge "move WebPPictureInit to picture.c"
This commit is contained in:
commit
6f3202be98
@ -21,6 +21,29 @@
|
|||||||
// WebPPicture
|
// WebPPicture
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
static int DummyWriter(const uint8_t* data, size_t data_size,
|
||||||
|
const WebPPicture* const picture) {
|
||||||
|
// The following are to prevent 'unused variable' error message.
|
||||||
|
(void)data;
|
||||||
|
(void)data_size;
|
||||||
|
(void)picture;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int WebPPictureInitInternal(WebPPicture* picture, int version) {
|
||||||
|
if (WEBP_ABI_IS_INCOMPATIBLE(version, WEBP_ENCODER_ABI_VERSION)) {
|
||||||
|
return 0; // caller/system version mismatch!
|
||||||
|
}
|
||||||
|
if (picture != NULL) {
|
||||||
|
memset(picture, 0, sizeof(*picture));
|
||||||
|
picture->writer = DummyWriter;
|
||||||
|
WebPEncodingSetError(picture, VP8_ENC_OK);
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
static void WebPPictureResetBufferARGB(WebPPicture* const picture) {
|
static void WebPPictureResetBufferARGB(WebPPicture* const picture) {
|
||||||
picture->memory_argb_ = NULL;
|
picture->memory_argb_ = NULL;
|
||||||
picture->argb = NULL;
|
picture->argb = NULL;
|
||||||
|
@ -33,31 +33,6 @@ int WebPGetEncoderVersion(void) {
|
|||||||
return (ENC_MAJ_VERSION << 16) | (ENC_MIN_VERSION << 8) | ENC_REV_VERSION;
|
return (ENC_MAJ_VERSION << 16) | (ENC_MIN_VERSION << 8) | ENC_REV_VERSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
// WebPPicture
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
static int DummyWriter(const uint8_t* data, size_t data_size,
|
|
||||||
const WebPPicture* const picture) {
|
|
||||||
// The following are to prevent 'unused variable' error message.
|
|
||||||
(void)data;
|
|
||||||
(void)data_size;
|
|
||||||
(void)picture;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int WebPPictureInitInternal(WebPPicture* picture, int version) {
|
|
||||||
if (WEBP_ABI_IS_INCOMPATIBLE(version, WEBP_ENCODER_ABI_VERSION)) {
|
|
||||||
return 0; // caller/system version mismatch!
|
|
||||||
}
|
|
||||||
if (picture != NULL) {
|
|
||||||
memset(picture, 0, sizeof(*picture));
|
|
||||||
picture->writer = DummyWriter;
|
|
||||||
WebPEncodingSetError(picture, VP8_ENC_OK);
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// VP8Encoder
|
// VP8Encoder
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
@ -399,4 +374,3 @@ int WebPEncode(const WebPConfig* config, WebPPicture* pic) {
|
|||||||
|
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user