mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-12 22:14:29 +02:00
cleanup WebPPicture struct and API
* add a real proper pointer for holding memory chunk pointer (instead of using y and argb fields) * polish the doc with details * add a WebPPictureView() that extract a view from a picture without any copy (kind of a fast-crop). * properly snap the top-left corner for Crop/View. Previously, the luma position was not snapped, and was off compared to the chroma. Change-Id: I8a3620c7f5fc6f7d1f8dd89d9da167c91e237439
This commit is contained in:
@ -1023,9 +1023,12 @@ int main(int argc, const char *argv[]) {
|
||||
if (verbose) {
|
||||
StopwatchReadAndReset(&stop_watch);
|
||||
}
|
||||
if (crop != 0 && !WebPPictureCrop(&picture, crop_x, crop_y, crop_w, crop_h)) {
|
||||
fprintf(stderr, "Error! Cannot crop picture\n");
|
||||
goto Error;
|
||||
if (crop != 0) {
|
||||
// We use self-cropping using a view.
|
||||
if (!WebPPictureView(&picture, crop_x, crop_y, crop_w, crop_h, &picture)) {
|
||||
fprintf(stderr, "Error! Cannot crop picture\n");
|
||||
goto Error;
|
||||
}
|
||||
}
|
||||
if ((resize_w | resize_h) > 0) {
|
||||
if (!WebPPictureRescale(&picture, resize_w, resize_h)) {
|
||||
|
Reference in New Issue
Block a user