Lines Matching refs:rect

209                              const FrameRectangle* const rect) {  in WebPUtilClearPic()  argument
210 if (rect != NULL) { in WebPUtilClearPic()
211 ClearRectangle(picture, rect->x_offset_, rect->y_offset_, in WebPUtilClearPic()
212 rect->width_, rect->height_); in WebPUtilClearPic()
403 static int IsEmptyRect(const FrameRectangle* const rect) { in IsEmptyRect() argument
404 return (rect->width_ == 0) || (rect->height_ == 0); in IsEmptyRect()
416 FrameRectangle* const rect, in MinimizeChangeRectangle() argument
426 assert(rect->x_offset_ + rect->width_ <= dst->width); in MinimizeChangeRectangle()
427 assert(rect->y_offset_ + rect->height_ <= dst->height); in MinimizeChangeRectangle()
430 for (i = rect->x_offset_; i < rect->x_offset_ + rect->width_; ++i) { in MinimizeChangeRectangle()
432 &src->argb[rect->y_offset_ * src->argb_stride + i]; in MinimizeChangeRectangle()
434 &dst->argb[rect->y_offset_ * dst->argb_stride + i]; in MinimizeChangeRectangle()
436 rect->height_, max_allowed_diff)) { in MinimizeChangeRectangle()
437 --rect->width_; // Redundant column. in MinimizeChangeRectangle()
438 ++rect->x_offset_; in MinimizeChangeRectangle()
443 if (rect->width_ == 0) goto NoChange; in MinimizeChangeRectangle()
446 for (i = rect->x_offset_ + rect->width_ - 1; i >= rect->x_offset_; --i) { in MinimizeChangeRectangle()
448 &src->argb[rect->y_offset_ * src->argb_stride + i]; in MinimizeChangeRectangle()
450 &dst->argb[rect->y_offset_ * dst->argb_stride + i]; in MinimizeChangeRectangle()
452 rect->height_, max_allowed_diff)) { in MinimizeChangeRectangle()
453 --rect->width_; // Redundant column. in MinimizeChangeRectangle()
458 if (rect->width_ == 0) goto NoChange; in MinimizeChangeRectangle()
461 for (j = rect->y_offset_; j < rect->y_offset_ + rect->height_; ++j) { in MinimizeChangeRectangle()
463 &src->argb[j * src->argb_stride + rect->x_offset_]; in MinimizeChangeRectangle()
465 &dst->argb[j * dst->argb_stride + rect->x_offset_]; in MinimizeChangeRectangle()
466 if (compare_pixels(src_argb, 1, dst_argb, 1, rect->width_, in MinimizeChangeRectangle()
468 --rect->height_; // Redundant row. in MinimizeChangeRectangle()
469 ++rect->y_offset_; in MinimizeChangeRectangle()
474 if (rect->height_ == 0) goto NoChange; in MinimizeChangeRectangle()
477 for (j = rect->y_offset_ + rect->height_ - 1; j >= rect->y_offset_; --j) { in MinimizeChangeRectangle()
479 &src->argb[j * src->argb_stride + rect->x_offset_]; in MinimizeChangeRectangle()
481 &dst->argb[j * dst->argb_stride + rect->x_offset_]; in MinimizeChangeRectangle()
482 if (compare_pixels(src_argb, 1, dst_argb, 1, rect->width_, in MinimizeChangeRectangle()
484 --rect->height_; // Redundant row. in MinimizeChangeRectangle()
489 if (rect->height_ == 0) goto NoChange; in MinimizeChangeRectangle()
491 if (IsEmptyRect(rect)) { in MinimizeChangeRectangle()
493 rect->x_offset_ = 0; in MinimizeChangeRectangle()
494 rect->y_offset_ = 0; in MinimizeChangeRectangle()
495 rect->width_ = 0; in MinimizeChangeRectangle()
496 rect->height_ = 0; in MinimizeChangeRectangle()
501 static WEBP_INLINE void SnapToEvenOffsets(FrameRectangle* const rect) { in SnapToEvenOffsets() argument
502 rect->width_ += (rect->x_offset_ & 1); in SnapToEvenOffsets()
503 rect->height_ += (rect->y_offset_ & 1); in SnapToEvenOffsets()
504 rect->x_offset_ &= ~1; in SnapToEvenOffsets()
505 rect->y_offset_ &= ~1; in SnapToEvenOffsets()
542 FrameRectangle* const rect, in GetSubRect() argument
547 MinimizeChangeRectangle(prev_canvas, curr_canvas, rect, in GetSubRect()
551 if (IsEmptyRect(rect)) { in GetSubRect()
555 rect->width_ = 1; in GetSubRect()
556 rect->height_ = 1; in GetSubRect()
557 assert(rect->x_offset_ == 0); in GetSubRect()
558 assert(rect->y_offset_ == 0); in GetSubRect()
562 SnapToEvenOffsets(rect); in GetSubRect()
563 return WebPPictureView(curr_canvas, rect->x_offset_, rect->y_offset_, in GetSubRect()
564 rect->width_, rect->height_, sub_frame); in GetSubRect()
598 FrameRectangle rect; in WebPAnimEncoderRefineRect() local
609 rect.x_offset_ = left; in WebPAnimEncoderRefineRect()
610 rect.y_offset_ = top; in WebPAnimEncoderRefineRect()
611 rect.width_ = clip(right - left, 0, curr_canvas->width - rect.x_offset_); in WebPAnimEncoderRefineRect()
612 rect.height_ = clip(bottom - top, 0, curr_canvas->height - rect.y_offset_); in WebPAnimEncoderRefineRect()
613 MinimizeChangeRectangle(prev_canvas, curr_canvas, &rect, is_lossless, in WebPAnimEncoderRefineRect()
615 SnapToEvenOffsets(&rect); in WebPAnimEncoderRefineRect()
616 *x_offset = rect.x_offset_; in WebPAnimEncoderRefineRect()
617 *y_offset = rect.y_offset_; in WebPAnimEncoderRefineRect()
618 *width = rect.width_; in WebPAnimEncoderRefineRect()
619 *height = rect.height_; in WebPAnimEncoderRefineRect()
624 const FrameRectangle* const rect, in DisposeFrameRectangle() argument
626 assert(rect != NULL); in DisposeFrameRectangle()
628 WebPUtilClearPic(curr_canvas, rect); in DisposeFrameRectangle()
632 static uint32_t RectArea(const FrameRectangle* const rect) { in RectArea() argument
633 return (uint32_t)rect->width_ * rect->height_; in RectArea()
638 const FrameRectangle* const rect) { in IsLosslessBlendingPossible() argument
641 assert(rect->x_offset_ + rect->width_ <= dst->width); in IsLosslessBlendingPossible()
642 assert(rect->y_offset_ + rect->height_ <= dst->height); in IsLosslessBlendingPossible()
643 for (j = rect->y_offset_; j < rect->y_offset_ + rect->height_; ++j) { in IsLosslessBlendingPossible()
644 for (i = rect->x_offset_; i < rect->x_offset_ + rect->width_; ++i) { in IsLosslessBlendingPossible()
660 const FrameRectangle* const rect, in IsLossyBlendingPossible() argument
665 assert(rect->x_offset_ + rect->width_ <= dst->width); in IsLossyBlendingPossible()
666 assert(rect->y_offset_ + rect->height_ <= dst->height); in IsLossyBlendingPossible()
667 for (j = rect->y_offset_; j < rect->y_offset_ + rect->height_; ++j) { in IsLossyBlendingPossible()
668 for (i = rect->x_offset_; i < rect->x_offset_ + rect->width_; ++i) { in IsLossyBlendingPossible()
687 const FrameRectangle* const rect, in IncreaseTransparency() argument
691 assert(src != NULL && dst != NULL && rect != NULL); in IncreaseTransparency()
693 for (j = rect->y_offset_; j < rect->y_offset_ + rect->height_; ++j) { in IncreaseTransparency()
696 for (i = rect->x_offset_; i < rect->x_offset_ + rect->width_; ++i) { in IncreaseTransparency()
713 const FrameRectangle* const rect, in FlattenSimilarBlocks() argument
719 const int y_start = (rect->y_offset_ + block_size) & ~(block_size - 1); in FlattenSimilarBlocks()
720 const int y_end = (rect->y_offset_ + rect->height_) & ~(block_size - 1); in FlattenSimilarBlocks()
721 const int x_start = (rect->x_offset_ + block_size) & ~(block_size - 1); in FlattenSimilarBlocks()
722 const int x_end = (rect->x_offset_ + rect->width_) & ~(block_size - 1); in FlattenSimilarBlocks()
723 assert(src != NULL && dst != NULL && rect != NULL); in FlattenSimilarBlocks()
788 const FrameRectangle* const rect, in EncodeCandidate() argument
798 candidate->rect_ = *rect; in EncodeCandidate()
800 candidate->info_.x_offset = rect->x_offset_; in EncodeCandidate()
801 candidate->info_.y_offset = rect->y_offset_; in EncodeCandidate()
962 const FrameRectangle rect = { 0, 0, 1, 1 }; in IncreasePreviousDuration() local
998 enc->prev_rect_ = rect; in IncreasePreviousDuration()