Cary Clark | bc5697d | 2017-10-04 14:31:33 -0400 | [diff] [blame^] | 1 | #Topic Rect |
| 2 | #Alias Rects |
| 3 | #Alias Rect_Reference |
| 4 | |
| 5 | #Struct SkRect |
| 6 | |
| 7 | #Topic Overview |
| 8 | |
| 9 | #Subtopic Subtopics |
| 10 | #ToDo manually add subtopics ## |
| 11 | #Table |
| 12 | #Legend |
| 13 | # topics # description ## |
| 14 | #Legend ## |
| 15 | #Table ## |
| 16 | ## |
| 17 | |
| 18 | #Subtopic Operators |
| 19 | #Table |
| 20 | #Legend |
| 21 | # description # function ## |
| 22 | #Legend ## |
| 23 | # friend bool operator!=(const SkRect& a, const SkRect& b) # ## |
| 24 | # friend bool operator==(const SkRect& a, const SkRect& b) # ## |
| 25 | #Table ## |
| 26 | #Subtopic ## |
| 27 | |
| 28 | #Subtopic Member_Functions |
| 29 | #Table |
| 30 | #Legend |
| 31 | # description # function ## |
| 32 | #Legend ## |
| 33 | # Make # ## |
| 34 | # MakeEmpty # ## |
| 35 | # MakeFromIRect # ## |
| 36 | # MakeIWH # ## |
| 37 | # MakeLTRB # ## |
| 38 | # MakeLargest # ## |
| 39 | # MakeSize # ## |
| 40 | # MakeWH # ## |
| 41 | # MakeXYWH # ## |
| 42 | # bottom # ## |
| 43 | # centerX # ## |
| 44 | # centerY # ## |
| 45 | # height # ## |
| 46 | # inset # ## |
| 47 | # intersect # ## |
| 48 | # isEmpty # ## |
| 49 | # isFinite # ## |
| 50 | # isLargest # ## |
| 51 | # isSorted # ## |
| 52 | # iset # ## |
| 53 | # isetWH # ## |
| 54 | # left # ## |
| 55 | # makeInset # ## |
| 56 | # makeOffset # ## |
| 57 | # makeOutset # ## |
| 58 | # offset # ## |
| 59 | # offsetTo # ## |
| 60 | # outset # ## |
| 61 | # right # ## |
| 62 | # set # ## |
| 63 | # setBounds # ## |
| 64 | # setBoundsCheck # ## |
| 65 | # setEmpty # ## |
| 66 | # setLTRB # ## |
| 67 | # setLargest # ## |
| 68 | # setLargestInverted # ## |
| 69 | # setWH # ## |
| 70 | # setXYWH # ## |
| 71 | # toQuad # ## |
| 72 | # top # ## |
| 73 | # width # ## |
| 74 | # x # ## |
| 75 | # y # ## |
| 76 | #Table ## |
| 77 | #Subtopic ## |
| 78 | |
| 79 | #Topic ## |
| 80 | |
| 81 | #Member SkScalar fLeft |
| 82 | ## |
| 83 | |
| 84 | #Member SkScalar fTop |
| 85 | ## |
| 86 | |
| 87 | #Member SkScalar fRight |
| 88 | ## |
| 89 | |
| 90 | #Member SkScalar fBottom |
| 91 | ## |
| 92 | |
| 93 | # ------------------------------------------------------------------------------ |
| 94 | |
| 95 | #Method static constexpr SkRect SK_WARN_UNUSED_RESULT MakeEmpty() |
| 96 | |
| 97 | #Return incomplete ## |
| 98 | |
| 99 | #Example |
| 100 | // incomplete |
| 101 | ## |
| 102 | |
| 103 | #ToDo incomplete ## |
| 104 | |
| 105 | ## |
| 106 | |
| 107 | # ------------------------------------------------------------------------------ |
| 108 | |
| 109 | #Method static SkRect SK_WARN_UNUSED_RESULT MakeLargest() |
| 110 | |
| 111 | #Return incomplete ## |
| 112 | |
| 113 | #Example |
| 114 | // incomplete |
| 115 | ## |
| 116 | |
| 117 | #ToDo incomplete ## |
| 118 | |
| 119 | ## |
| 120 | |
| 121 | # ------------------------------------------------------------------------------ |
| 122 | |
| 123 | #Method static SkRect SK_WARN_UNUSED_RESULT MakeWH(SkScalar w, SkScalar h) |
| 124 | |
| 125 | #Param w incomplete ## |
| 126 | #Param h incomplete ## |
| 127 | |
| 128 | #Return incomplete ## |
| 129 | |
| 130 | #Example |
| 131 | // incomplete |
| 132 | ## |
| 133 | |
| 134 | #ToDo incomplete ## |
| 135 | |
| 136 | ## |
| 137 | |
| 138 | # ------------------------------------------------------------------------------ |
| 139 | |
| 140 | #Method static SkRect SK_WARN_UNUSED_RESULT MakeIWH(int w, int h) |
| 141 | |
| 142 | #Param w incomplete ## |
| 143 | #Param h incomplete ## |
| 144 | |
| 145 | #Return incomplete ## |
| 146 | |
| 147 | #Example |
| 148 | // incomplete |
| 149 | ## |
| 150 | |
| 151 | #ToDo incomplete ## |
| 152 | |
| 153 | ## |
| 154 | |
| 155 | # ------------------------------------------------------------------------------ |
| 156 | |
| 157 | #Method static SkRect SK_WARN_UNUSED_RESULT MakeSize(const SkSize& size) |
| 158 | |
| 159 | #Param size incomplete ## |
| 160 | |
| 161 | #Return incomplete ## |
| 162 | |
| 163 | #Example |
| 164 | // incomplete |
| 165 | ## |
| 166 | |
| 167 | #ToDo incomplete ## |
| 168 | |
| 169 | ## |
| 170 | |
| 171 | # ------------------------------------------------------------------------------ |
| 172 | |
| 173 | #Method static constexpr SkRect SK_WARN_UNUSED_RESULT MakeLTRB(SkScalar l, SkScalar t, SkScalar r, |
| 174 | SkScalar b) |
| 175 | |
| 176 | #Param l incomplete ## |
| 177 | #Param t incomplete ## |
| 178 | #Param r incomplete ## |
| 179 | #Param b incomplete ## |
| 180 | |
| 181 | #Return incomplete ## |
| 182 | |
| 183 | #Example |
| 184 | // incomplete |
| 185 | ## |
| 186 | |
| 187 | #ToDo incomplete ## |
| 188 | |
| 189 | ## |
| 190 | |
| 191 | # ------------------------------------------------------------------------------ |
| 192 | |
| 193 | #Method static SkRect SK_WARN_UNUSED_RESULT MakeXYWH(SkScalar x, SkScalar y, SkScalar w, SkScalar h) |
| 194 | |
| 195 | #Param x incomplete ## |
| 196 | #Param y incomplete ## |
| 197 | #Param w incomplete ## |
| 198 | #Param h incomplete ## |
| 199 | |
| 200 | #Return incomplete ## |
| 201 | |
| 202 | #Example |
| 203 | // incomplete |
| 204 | ## |
| 205 | |
| 206 | #ToDo incomplete ## |
| 207 | |
| 208 | ## |
| 209 | |
| 210 | # ------------------------------------------------------------------------------ |
| 211 | |
| 212 | #Method static SkRect SK_WARN_UNUSED_RESULT MakeFromIRect(const SkIRect& irect) |
| 213 | |
| 214 | #Param irect incomplete ## |
| 215 | |
| 216 | #Return incomplete ## |
| 217 | |
| 218 | #Example |
| 219 | // incomplete |
| 220 | ## |
| 221 | |
| 222 | #ToDo incomplete ## |
| 223 | |
| 224 | ## |
| 225 | |
| 226 | # ------------------------------------------------------------------------------ |
| 227 | |
| 228 | #Method static SkRect Make(const SkISize& size) |
| 229 | |
| 230 | #Param size incomplete ## |
| 231 | |
| 232 | #Return incomplete ## |
| 233 | |
| 234 | #Example |
| 235 | // incomplete |
| 236 | ## |
| 237 | |
| 238 | #ToDo incomplete ## |
| 239 | |
| 240 | ## |
| 241 | |
| 242 | # ------------------------------------------------------------------------------ |
| 243 | |
| 244 | #Method static SkRect SK_WARN_UNUSED_RESULT Make(const SkIRect& irect) |
| 245 | |
| 246 | #Param irect incomplete ## |
| 247 | |
| 248 | #Return incomplete ## |
| 249 | |
| 250 | #Example |
| 251 | // incomplete |
| 252 | ## |
| 253 | |
| 254 | #ToDo incomplete ## |
| 255 | |
| 256 | ## |
| 257 | |
| 258 | # ------------------------------------------------------------------------------ |
| 259 | |
| 260 | #Method bool isEmpty() const |
| 261 | |
| 262 | Return true if the rectangle width or height are <= 0 |
| 263 | |
| 264 | #Return incomplete ## |
| 265 | |
| 266 | #Example |
| 267 | // incomplete |
| 268 | ## |
| 269 | |
| 270 | #ToDo incomplete ## |
| 271 | |
| 272 | ## |
| 273 | |
| 274 | # ------------------------------------------------------------------------------ |
| 275 | |
| 276 | #Method bool isSorted() const |
| 277 | |
| 278 | Return true if the rectangle width and height are >= 0 |
| 279 | |
| 280 | #Return incomplete ## |
| 281 | |
| 282 | #Example |
| 283 | // incomplete |
| 284 | ## |
| 285 | |
| 286 | #ToDo incomplete ## |
| 287 | |
| 288 | ## |
| 289 | |
| 290 | # ------------------------------------------------------------------------------ |
| 291 | |
| 292 | #Method bool isLargest() const |
| 293 | |
| 294 | #Return incomplete ## |
| 295 | |
| 296 | #Example |
| 297 | // incomplete |
| 298 | ## |
| 299 | |
| 300 | #ToDo incomplete ## |
| 301 | |
| 302 | ## |
| 303 | |
| 304 | # ------------------------------------------------------------------------------ |
| 305 | |
| 306 | #Method bool isFinite() const |
| 307 | |
| 308 | Returns true if and only if all values in the rectangle are finite. If any are |
| 309 | infinite or NaN then this returns false. |
| 310 | |
| 311 | #Return incomplete ## |
| 312 | |
| 313 | #Example |
| 314 | // incomplete |
| 315 | ## |
| 316 | |
| 317 | #ToDo incomplete ## |
| 318 | |
| 319 | ## |
| 320 | |
| 321 | # ------------------------------------------------------------------------------ |
| 322 | |
| 323 | #Method SkScalar x() const |
| 324 | |
| 325 | #Return incomplete ## |
| 326 | |
| 327 | #Example |
| 328 | // incomplete |
| 329 | ## |
| 330 | |
| 331 | #ToDo incomplete ## |
| 332 | |
| 333 | ## |
| 334 | |
| 335 | # ------------------------------------------------------------------------------ |
| 336 | |
| 337 | #Method SkScalar y() const |
| 338 | |
| 339 | #Return incomplete ## |
| 340 | |
| 341 | #Example |
| 342 | // incomplete |
| 343 | ## |
| 344 | |
| 345 | #ToDo incomplete ## |
| 346 | |
| 347 | ## |
| 348 | |
| 349 | # ------------------------------------------------------------------------------ |
| 350 | |
| 351 | #Method SkScalar left() const |
| 352 | |
| 353 | #Return incomplete ## |
| 354 | |
| 355 | #Example |
| 356 | // incomplete |
| 357 | ## |
| 358 | |
| 359 | #ToDo incomplete ## |
| 360 | |
| 361 | ## |
| 362 | |
| 363 | # ------------------------------------------------------------------------------ |
| 364 | |
| 365 | #Method SkScalar top() const |
| 366 | |
| 367 | #Return incomplete ## |
| 368 | |
| 369 | #Example |
| 370 | // incomplete |
| 371 | ## |
| 372 | |
| 373 | #ToDo incomplete ## |
| 374 | |
| 375 | ## |
| 376 | |
| 377 | # ------------------------------------------------------------------------------ |
| 378 | |
| 379 | #Method SkScalar right() const |
| 380 | |
| 381 | #Return incomplete ## |
| 382 | |
| 383 | #Example |
| 384 | // incomplete |
| 385 | ## |
| 386 | |
| 387 | #ToDo incomplete ## |
| 388 | |
| 389 | ## |
| 390 | |
| 391 | # ------------------------------------------------------------------------------ |
| 392 | |
| 393 | #Method SkScalar bottom() const |
| 394 | |
| 395 | #Return incomplete ## |
| 396 | |
| 397 | #Example |
| 398 | // incomplete |
| 399 | ## |
| 400 | |
| 401 | #ToDo incomplete ## |
| 402 | |
| 403 | ## |
| 404 | |
| 405 | # ------------------------------------------------------------------------------ |
| 406 | |
| 407 | #Method SkScalar width() const |
| 408 | |
| 409 | #Return incomplete ## |
| 410 | |
| 411 | #Example |
| 412 | // incomplete |
| 413 | ## |
| 414 | |
| 415 | #ToDo incomplete ## |
| 416 | |
| 417 | ## |
| 418 | |
| 419 | # ------------------------------------------------------------------------------ |
| 420 | |
| 421 | #Method SkScalar height() const |
| 422 | |
| 423 | #Return incomplete ## |
| 424 | |
| 425 | #Example |
| 426 | // incomplete |
| 427 | ## |
| 428 | |
| 429 | #ToDo incomplete ## |
| 430 | |
| 431 | ## |
| 432 | |
| 433 | # ------------------------------------------------------------------------------ |
| 434 | |
| 435 | #Method SkScalar centerX() const |
| 436 | |
| 437 | #Return incomplete ## |
| 438 | |
| 439 | #Example |
| 440 | // incomplete |
| 441 | ## |
| 442 | |
| 443 | #ToDo incomplete ## |
| 444 | |
| 445 | ## |
| 446 | |
| 447 | # ------------------------------------------------------------------------------ |
| 448 | |
| 449 | #Method SkScalar centerY() const |
| 450 | |
| 451 | #Return incomplete ## |
| 452 | |
| 453 | #Example |
| 454 | // incomplete |
| 455 | ## |
| 456 | |
| 457 | #ToDo incomplete ## |
| 458 | |
| 459 | ## |
| 460 | |
| 461 | # ------------------------------------------------------------------------------ |
| 462 | |
| 463 | #Method friend bool operator==(const SkRect& a, const SkRect& b) |
| 464 | |
| 465 | #Param a incomplete ## |
| 466 | #Param b incomplete ## |
| 467 | |
| 468 | #Return incomplete ## |
| 469 | |
| 470 | #Example |
| 471 | // incomplete |
| 472 | ## |
| 473 | |
| 474 | #ToDo incomplete ## |
| 475 | |
| 476 | ## |
| 477 | |
| 478 | # ------------------------------------------------------------------------------ |
| 479 | |
| 480 | #Method friend bool operator!=(const SkRect& a, const SkRect& b) |
| 481 | |
| 482 | #Param a incomplete ## |
| 483 | #Param b incomplete ## |
| 484 | |
| 485 | #Return incomplete ## |
| 486 | |
| 487 | #Example |
| 488 | // incomplete |
| 489 | ## |
| 490 | |
| 491 | #ToDo incomplete ## |
| 492 | |
| 493 | ## |
| 494 | |
| 495 | # ------------------------------------------------------------------------------ |
| 496 | |
| 497 | #Method void toQuad(SkPoint quad[4]) const |
| 498 | |
| 499 | return the 4 points that enclose the rectangle (top-left, top-right, bottom-right, |
| 500 | bottom-left). |
| 501 | #ToDo |
| 502 | Consider adding param to control whether quad is CW or CCW. |
| 503 | ## |
| 504 | |
| 505 | #Param quad incomplete ## |
| 506 | |
| 507 | #Example |
| 508 | // incomplete |
| 509 | ## |
| 510 | |
| 511 | #ToDo incomplete ## |
| 512 | |
| 513 | ## |
| 514 | |
| 515 | # ------------------------------------------------------------------------------ |
| 516 | |
| 517 | #Method void setEmpty() |
| 518 | |
| 519 | Set this rectangle to the empty rectangle (0,0,0,0) |
| 520 | |
| 521 | #Example |
| 522 | // incomplete |
| 523 | ## |
| 524 | |
| 525 | #ToDo incomplete ## |
| 526 | |
| 527 | ## |
| 528 | |
| 529 | # ------------------------------------------------------------------------------ |
| 530 | |
| 531 | #Method void set(const SkIRect& src) |
| 532 | |
| 533 | #Param src incomplete ## |
| 534 | |
| 535 | #Example |
| 536 | // incomplete |
| 537 | ## |
| 538 | |
| 539 | #ToDo incomplete ## |
| 540 | |
| 541 | ## |
| 542 | |
| 543 | # ------------------------------------------------------------------------------ |
| 544 | |
| 545 | #Method void set(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom) |
| 546 | |
| 547 | #Param left incomplete ## |
| 548 | #Param top incomplete ## |
| 549 | #Param right incomplete ## |
| 550 | #Param bottom incomplete ## |
| 551 | |
| 552 | #Example |
| 553 | // incomplete |
| 554 | ## |
| 555 | |
| 556 | #ToDo incomplete ## |
| 557 | |
| 558 | ## |
| 559 | |
| 560 | # ------------------------------------------------------------------------------ |
| 561 | |
| 562 | #Method void setLTRB(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom) |
| 563 | |
| 564 | alias for set(l, t, r, b) |
| 565 | |
| 566 | #Param left incomplete ## |
| 567 | #Param top incomplete ## |
| 568 | #Param right incomplete ## |
| 569 | #Param bottom incomplete ## |
| 570 | |
| 571 | #Example |
| 572 | // incomplete |
| 573 | ## |
| 574 | |
| 575 | #ToDo incomplete ## |
| 576 | |
| 577 | ## |
| 578 | |
| 579 | # ------------------------------------------------------------------------------ |
| 580 | |
| 581 | #Method void iset(int left, int top, int right, int bottom) |
| 582 | |
| 583 | Initialize the rectangle with the 4 specified integers. The routine handles |
| 584 | converting them to scalars (by calling SkIntToScalar) |
| 585 | |
| 586 | #Param left incomplete ## |
| 587 | #Param top incomplete ## |
| 588 | #Param right incomplete ## |
| 589 | #Param bottom incomplete ## |
| 590 | |
| 591 | #Example |
| 592 | // incomplete |
| 593 | ## |
| 594 | |
| 595 | #ToDo incomplete ## |
| 596 | |
| 597 | ## |
| 598 | |
| 599 | # ------------------------------------------------------------------------------ |
| 600 | |
| 601 | #Method void isetWH(int width, int height) |
| 602 | |
| 603 | Set this rectangle to be left/top at 0,0, and have the specified width |
| 604 | and height (automatically converted to SkScalar). |
| 605 | |
| 606 | #Param width incomplete ## |
| 607 | #Param height incomplete ## |
| 608 | |
| 609 | #Example |
| 610 | // incomplete |
| 611 | ## |
| 612 | |
| 613 | #ToDo incomplete ## |
| 614 | |
| 615 | ## |
| 616 | |
| 617 | # ------------------------------------------------------------------------------ |
| 618 | |
| 619 | #Method void set(const SkPoint pts[], int count) |
| 620 | |
| 621 | Set this rectangle to be the bounds of the array of points. |
| 622 | If the array is empty (count == 0), then set this rectangle |
| 623 | to the empty rectangle (0,0,0,0) |
| 624 | |
| 625 | #Param pts incomplete ## |
| 626 | #Param count incomplete ## |
| 627 | |
| 628 | #Example |
| 629 | // incomplete |
| 630 | ## |
| 631 | |
| 632 | #ToDo incomplete ## |
| 633 | |
| 634 | ## |
| 635 | |
| 636 | # ------------------------------------------------------------------------------ |
| 637 | |
| 638 | #Method void setBounds(const SkPoint pts[], int count) |
| 639 | |
| 640 | alias for set(pts, count) |
| 641 | |
| 642 | #Param pts incomplete ## |
| 643 | #Param count incomplete ## |
| 644 | |
| 645 | #Example |
| 646 | // incomplete |
| 647 | ## |
| 648 | |
| 649 | #ToDo incomplete ## |
| 650 | |
| 651 | ## |
| 652 | |
| 653 | # ------------------------------------------------------------------------------ |
| 654 | |
| 655 | #Method bool setBoundsCheck(const SkPoint pts[], int count) |
| 656 | |
| 657 | Compute the bounds of the array of points, and set this rectangle to that |
| 658 | bounds and return true... unless a non-finite value is encountered, |
| 659 | in which case this rectangle is set to empty and false is returned. |
| 660 | |
| 661 | #Param pts incomplete ## |
| 662 | #Param count incomplete ## |
| 663 | |
| 664 | #Return incomplete ## |
| 665 | |
| 666 | #Example |
| 667 | // incomplete |
| 668 | ## |
| 669 | |
| 670 | #ToDo incomplete ## |
| 671 | |
| 672 | ## |
| 673 | |
| 674 | # ------------------------------------------------------------------------------ |
| 675 | |
| 676 | #Method void set(const SkPoint& p0, const SkPoint& p1) |
| 677 | |
| 678 | #Param p0 incomplete ## |
| 679 | #Param p1 incomplete ## |
| 680 | |
| 681 | #Example |
| 682 | // incomplete |
| 683 | ## |
| 684 | |
| 685 | #ToDo incomplete ## |
| 686 | |
| 687 | ## |
| 688 | |
| 689 | # ------------------------------------------------------------------------------ |
| 690 | |
| 691 | #Method void setXYWH(SkScalar x, SkScalar y, SkScalar width, SkScalar height) |
| 692 | |
| 693 | #Param x incomplete ## |
| 694 | #Param y incomplete ## |
| 695 | #Param width incomplete ## |
| 696 | #Param height incomplete ## |
| 697 | |
| 698 | #Example |
| 699 | // incomplete |
| 700 | ## |
| 701 | |
| 702 | #ToDo incomplete ## |
| 703 | |
| 704 | ## |
| 705 | |
| 706 | # ------------------------------------------------------------------------------ |
| 707 | |
| 708 | #Method void setWH(SkScalar width, SkScalar height) |
| 709 | |
| 710 | #Param width incomplete ## |
| 711 | #Param height incomplete ## |
| 712 | |
| 713 | #Example |
| 714 | // incomplete |
| 715 | ## |
| 716 | |
| 717 | #ToDo incomplete ## |
| 718 | |
| 719 | ## |
| 720 | |
| 721 | # ------------------------------------------------------------------------------ |
| 722 | |
| 723 | #Method void setLargest() |
| 724 | |
| 725 | Sets rectangle left and top to most negative value, and sets |
| 726 | right and bottom to most positive value. |
| 727 | |
| 728 | #Example |
| 729 | // incomplete |
| 730 | ## |
| 731 | |
| 732 | #ToDo incomplete ## |
| 733 | |
| 734 | ## |
| 735 | |
| 736 | # ------------------------------------------------------------------------------ |
| 737 | |
| 738 | #Method void setLargestInverted() |
| 739 | |
| 740 | Sets rectangle left and top to most positive value, and sets |
| 741 | right and bottom to most negative value. |
| 742 | |
| 743 | #Example |
| 744 | // incomplete |
| 745 | ## |
| 746 | |
| 747 | #ToDo incomplete ## |
| 748 | |
| 749 | ## |
| 750 | |
| 751 | # ------------------------------------------------------------------------------ |
| 752 | |
| 753 | #Method SkRect makeOffset(SkScalar dx, SkScalar dy) const |
| 754 | |
| 755 | Return a new Rect, built as an offset of this rectangle. |
| 756 | |
| 757 | #Param dx incomplete ## |
| 758 | #Param dy incomplete ## |
| 759 | |
| 760 | #Return incomplete ## |
| 761 | |
| 762 | #Example |
| 763 | // incomplete |
| 764 | ## |
| 765 | |
| 766 | #ToDo incomplete ## |
| 767 | |
| 768 | ## |
| 769 | |
| 770 | # ------------------------------------------------------------------------------ |
| 771 | |
| 772 | #Method SkRect makeInset(SkScalar dx, SkScalar dy) const |
| 773 | |
| 774 | Return a new Rect, built as an inset of this rectangle. |
| 775 | |
| 776 | #Param dx incomplete ## |
| 777 | #Param dy incomplete ## |
| 778 | |
| 779 | #Return incomplete ## |
| 780 | |
| 781 | #Example |
| 782 | // incomplete |
| 783 | ## |
| 784 | |
| 785 | #ToDo incomplete ## |
| 786 | |
| 787 | ## |
| 788 | |
| 789 | # ------------------------------------------------------------------------------ |
| 790 | |
| 791 | #Method SkRect makeOutset(SkScalar dx, SkScalar dy) const |
| 792 | |
| 793 | Return a new Rect, built as an outset of this rectangle. |
| 794 | |
| 795 | #Param dx incomplete ## |
| 796 | #Param dy incomplete ## |
| 797 | |
| 798 | #Return incomplete ## |
| 799 | |
| 800 | #Example |
| 801 | // incomplete |
| 802 | ## |
| 803 | |
| 804 | #ToDo incomplete ## |
| 805 | |
| 806 | ## |
| 807 | |
| 808 | # ------------------------------------------------------------------------------ |
| 809 | |
| 810 | #Method void offset(SkScalar dx, SkScalar dy) |
| 811 | |
| 812 | Offset set the rectangle by adding dx to its left and right, |
| 813 | and adding dy to its top and bottom. |
| 814 | |
| 815 | #Param dx incomplete ## |
| 816 | #Param dy incomplete ## |
| 817 | |
| 818 | #Example |
| 819 | // incomplete |
| 820 | ## |
| 821 | |
| 822 | #ToDo incomplete ## |
| 823 | |
| 824 | ## |
| 825 | |
| 826 | # ------------------------------------------------------------------------------ |
| 827 | |
| 828 | #Method void offset(const SkPoint& delta) |
| 829 | |
| 830 | #Param delta incomplete ## |
| 831 | |
| 832 | #Example |
| 833 | // incomplete |
| 834 | ## |
| 835 | |
| 836 | #ToDo incomplete ## |
| 837 | |
| 838 | ## |
| 839 | |
| 840 | # ------------------------------------------------------------------------------ |
| 841 | |
| 842 | #Method void offsetTo(SkScalar newX, SkScalar newY) |
| 843 | |
| 844 | Offset this rectangle such its new x() and y() will equal newX and newY. |
| 845 | |
| 846 | #Param newX incomplete ## |
| 847 | #Param newY incomplete ## |
| 848 | |
| 849 | #Example |
| 850 | // incomplete |
| 851 | ## |
| 852 | |
| 853 | #ToDo incomplete ## |
| 854 | |
| 855 | ## |
| 856 | |
| 857 | # ------------------------------------------------------------------------------ |
| 858 | |
| 859 | #Method void inset(SkScalar dx, SkScalar dy) |
| 860 | |
| 861 | Inset the rectangle by (dx,dy). If dx is positive, then the sides are |
| 862 | moved inwards, making the rectangle narrower. If dx is negative, then |
| 863 | the sides are moved outwards, making the rectangle wider. The same holds |
| 864 | true for dy and the top and bottom. |
| 865 | |
| 866 | #Param dx incomplete ## |
| 867 | #Param dy incomplete ## |
| 868 | |
| 869 | #Example |
| 870 | // incomplete |
| 871 | ## |
| 872 | |
| 873 | #ToDo incomplete ## |
| 874 | |
| 875 | ## |
| 876 | |
| 877 | # ------------------------------------------------------------------------------ |
| 878 | |
| 879 | #Method void outset(SkScalar dx, SkScalar dy) |
| 880 | |
| 881 | Outset the rectangle by (dx,dy). If dx is positive, then the sides are |
| 882 | moved outwards, making the rectangle wider. If dx is negative, then the |
| 883 | sides are moved inwards, making the rectangle narrower. The same holds |
| 884 | true for dy and the top and bottom. |
| 885 | |
| 886 | #Param dx incomplete ## |
| 887 | #Param dy incomplete ## |
| 888 | |
| 889 | #Example |
| 890 | // incomplete |
| 891 | ## |
| 892 | |
| 893 | #ToDo incomplete ## |
| 894 | |
| 895 | ## |
| 896 | |
| 897 | # ------------------------------------------------------------------------------ |
| 898 | |
| 899 | #Method bool intersect(const SkRect& r) |
| 900 | |
| 901 | If this rectangle intersects r, return true and set this rectangle to that |
| 902 | intersection, otherwise return false and do not change this rectangle. |
| 903 | If either rectangle is empty, do nothing and return false. |
| 904 | |
| 905 | #Param r incomplete ## |
| 906 | |
| 907 | #Return incomplete ## |
| 908 | |
| 909 | #Example |
| 910 | // incomplete |
| 911 | ## |
| 912 | |
| 913 | #ToDo incomplete ## |
| 914 | |
| 915 | ## |
| 916 | |
| 917 | # ------------------------------------------------------------------------------ |
| 918 | |
| 919 | #Method bool intersect(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom) |
| 920 | |
| 921 | If this rectangle intersects the rectangle specified by left, top, right, bottom, |
| 922 | return true and set this rectangle to that intersection, otherwise return false |
| 923 | and do not change this rectangle. |
| 924 | If either rectangle is empty, do nothing and return false. |
| 925 | |
| 926 | #Param left incomplete ## |
| 927 | #Param top incomplete ## |
| 928 | #Param right incomplete ## |
| 929 | #Param bottom incomplete ## |
| 930 | |
| 931 | #Return incomplete ## |
| 932 | |
| 933 | #Example |
| 934 | // incomplete |
| 935 | ## |
| 936 | |
| 937 | #ToDo incomplete ## |
| 938 | |
| 939 | ## |
| 940 | |
| 941 | # ------------------------------------------------------------------------------ |
| 942 | |
| 943 | #Method bool SK_WARN_UNUSED_RESULT intersect(const SkRect& a, const SkRect& b) |
| 944 | |
| 945 | If rectangles a and b intersect, return true and set this rectangle to |
| 946 | that intersection, otherwise return false and do not change this |
| 947 | rectangle. If either rectangle is empty, do nothing and return false. |
| 948 | |
| 949 | #Param a incomplete ## |
| 950 | #Param b incomplete ## |
| 951 | |
| 952 | #Return incomplete ## |
| 953 | |
| 954 | #Example |
| 955 | // incomplete |
| 956 | ## |
| 957 | |
| 958 | #ToDo incomplete ## |
| 959 | |
| 960 | ## |
| 961 | |
| 962 | #Method bool intersects(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom) const |
| 963 | |
| 964 | Returns true if this rectangle is not empty, and the specified sides of |
| 965 | a rectangle are not empty, and they intersect. |
| 966 | |
| 967 | #Param left incomplete ## |
| 968 | #Param top incomplete ## |
| 969 | #Param right incomplete ## |
| 970 | #Param bottom incomplete ## |
| 971 | |
| 972 | #Return incomplete ## |
| 973 | |
| 974 | #Example |
| 975 | // incomplete |
| 976 | ## |
| 977 | |
| 978 | #SeeAlso incomplete |
| 979 | |
| 980 | ## |
| 981 | |
| 982 | #Method bool intersects(const SkRect& r) const |
| 983 | |
| 984 | #Param r incomplete ## |
| 985 | |
| 986 | #Return incomplete ## |
| 987 | |
| 988 | #Example |
| 989 | // incomplete |
| 990 | ## |
| 991 | |
| 992 | #SeeAlso incomplete |
| 993 | |
| 994 | ## |
| 995 | |
| 996 | #Method static bool Intersects(const SkRect& a, const SkRect& b) |
| 997 | |
| 998 | Returns true if rectangles a and b are not empty and intersect. |
| 999 | |
| 1000 | #Param a incomplete ## |
| 1001 | #Param b incomplete ## |
| 1002 | |
| 1003 | #Return incomplete ## |
| 1004 | |
| 1005 | #Example |
| 1006 | // incomplete |
| 1007 | ## |
| 1008 | |
| 1009 | #SeeAlso incomplete |
| 1010 | |
| 1011 | ## |
| 1012 | |
| 1013 | |
| 1014 | #Method void join(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom) |
| 1015 | |
| 1016 | Updates rectangle to enclose itself and the specified rectangle. |
| 1017 | If this rectangle is empty, just set it to the specified rectangle. |
| 1018 | If the specified rectangle is empty, do nothing. |
| 1019 | |
| 1020 | #Param left incomplete ## |
| 1021 | #Param top incomplete ## |
| 1022 | #Param right incomplete ## |
| 1023 | #Param bottom incomplete ## |
| 1024 | |
| 1025 | #Example |
| 1026 | // incomplete |
| 1027 | ## |
| 1028 | |
| 1029 | #SeeAlso incomplete |
| 1030 | |
| 1031 | ## |
| 1032 | |
| 1033 | #Method void join(const SkRect& r) |
| 1034 | |
| 1035 | If this rectangle is empty, just set it to the specified rectangle. If the specified |
| 1036 | rectangle is empty, do nothing. |
| 1037 | |
| 1038 | #Param r incomplete ## |
| 1039 | |
| 1040 | #Example |
| 1041 | // incomplete |
| 1042 | ## |
| 1043 | |
| 1044 | #SeeAlso incomplete |
| 1045 | |
| 1046 | ## |
| 1047 | |
| 1048 | #Method void joinNonEmptyArg(const SkRect& r) |
| 1049 | |
| 1050 | #Param r incomplete ## |
| 1051 | |
| 1052 | #Example |
| 1053 | // incomplete |
| 1054 | ## |
| 1055 | |
| 1056 | #SeeAlso incomplete |
| 1057 | |
| 1058 | ## |
| 1059 | |
| 1060 | #Method void joinPossiblyEmptyRect(const SkRect& r) |
| 1061 | |
| 1062 | Joins the rectangle with another without checking if either are empty (may produce unexpected |
| 1063 | results if either rectangle is inverted). |
| 1064 | |
| 1065 | #Param r incomplete ## |
| 1066 | |
| 1067 | #Example |
| 1068 | // incomplete |
| 1069 | ## |
| 1070 | |
| 1071 | #SeeAlso incomplete |
| 1072 | |
| 1073 | ## |
| 1074 | |
| 1075 | #Method void growToInclude(SkPoint pt) |
| 1076 | |
| 1077 | Grows rectangle to include the specified (x,y). After this call, the |
| 1078 | following will be true: fLeft <= x <= fRight && fTop <= y <= fBottom. |
| 1079 | |
| 1080 | This is close, but not quite the same contract as contains(), since |
| 1081 | contains() treats the left and top different from the right and bottom. |
| 1082 | contains(x,y) -> fLeft <= x < fRight && fTop <= y < fBottom. Also note |
| 1083 | that contains(x,y) always returns false if the rectangle is empty. |
| 1084 | |
| 1085 | #Param pt incomplete ## |
| 1086 | |
| 1087 | #Example |
| 1088 | // incomplete |
| 1089 | ## |
| 1090 | |
| 1091 | #SeeAlso incomplete |
| 1092 | |
| 1093 | ## |
| 1094 | |
| 1095 | #Method void growToInclude(const SkPoint pts[], int count) |
| 1096 | |
| 1097 | Bulk version of growToInclude |
| 1098 | |
| 1099 | #Param pts incomplete ## |
| 1100 | #Param count incomplete ## |
| 1101 | |
| 1102 | #Example |
| 1103 | // incomplete |
| 1104 | ## |
| 1105 | |
| 1106 | #SeeAlso incomplete |
| 1107 | |
| 1108 | ## |
| 1109 | |
| 1110 | #Method void growToInclude(const SkPoint pts[], size_t stride, int count) |
| 1111 | |
| 1112 | Bulk version of growToInclude with stride. |
| 1113 | |
| 1114 | #Param pts incomplete ## |
| 1115 | #Param stride incomplete ## |
| 1116 | #Param count incomplete ## |
| 1117 | |
| 1118 | #Example |
| 1119 | // incomplete |
| 1120 | ## |
| 1121 | |
| 1122 | #SeeAlso incomplete |
| 1123 | |
| 1124 | ## |
| 1125 | |
| 1126 | #Method bool contains(const SkRect& r) const { |
| 1127 | |
| 1128 | Return true if this rectangle contains r, and if both rectangles are |
| 1129 | not empty. |
| 1130 | |
| 1131 | #Param r incomplete ## |
| 1132 | |
| 1133 | #Return incomplete ## |
| 1134 | |
| 1135 | #Example |
| 1136 | // incomplete |
| 1137 | ## |
| 1138 | |
| 1139 | #SeeAlso incomplete |
| 1140 | |
| 1141 | ## |
| 1142 | |
| 1143 | #Method bool contains(const SkIRect& r) const |
| 1144 | |
| 1145 | Returns true if the specified rectangle r is inside or equal to this rectangle. |
| 1146 | |
| 1147 | #Param r incomplete ## |
| 1148 | |
| 1149 | #Return incomplete ## |
| 1150 | |
| 1151 | #Example |
| 1152 | // incomplete |
| 1153 | ## |
| 1154 | |
| 1155 | #SeeAlso incomplete |
| 1156 | |
| 1157 | ## |
| 1158 | |
| 1159 | #Method void round(SkIRect* dst) const |
| 1160 | |
| 1161 | Sets dst rectangle by rounding this rectangle coordinates to their |
| 1162 | nearest integer values using SkScalarRoundToInt. |
| 1163 | |
| 1164 | #Param dst incomplete ## |
| 1165 | |
| 1166 | #Example |
| 1167 | // incomplete |
| 1168 | ## |
| 1169 | |
| 1170 | #SeeAlso incomplete |
| 1171 | |
| 1172 | ## |
| 1173 | |
| 1174 | #Method void roundOut(SkIRect* dst) const |
| 1175 | |
| 1176 | Sets dst rectangle by rounding "out" this rectangle, choosing the |
| 1177 | SkScalarFloorToInt of top and left, and the SkScalarCeilToInt of right and bottom. |
| 1178 | |
| 1179 | #Param dst incomplete ## |
| 1180 | |
| 1181 | #Example |
| 1182 | // incomplete |
| 1183 | ## |
| 1184 | |
| 1185 | #SeeAlso incomplete |
| 1186 | |
| 1187 | ## |
| 1188 | |
| 1189 | #Method void roundOut(SkRect* dst) const |
| 1190 | |
| 1191 | Sets the dst rectangle by rounding "out" this rectangle, choosing the |
| 1192 | SkScalarFloorToScalar of top and left, and the SkScalarCeilToScalar of right and bottom. |
| 1193 | |
| 1194 | It is safe for this to equal dst. |
| 1195 | |
| 1196 | #Param dst incomplete ## |
| 1197 | |
| 1198 | #Example |
| 1199 | // incomplete |
| 1200 | ## |
| 1201 | |
| 1202 | #SeeAlso incomplete |
| 1203 | |
| 1204 | ## |
| 1205 | |
| 1206 | #Method void roundIn(SkIRect* dst) const |
| 1207 | |
| 1208 | Set the dst rectangle by rounding "in" this rectangle, choosing the |
| 1209 | ceil() of top and left, and the floor of right and bottom. This does *not* |
| 1210 | call sort(), so it is possible that the resulting rectangle is inverted; |
| 1211 | either left >= right or top >= bottom. Call isEmpty() to detect that. |
| 1212 | |
| 1213 | #Param dst incomplete ## |
| 1214 | |
| 1215 | #Example |
| 1216 | // incomplete |
| 1217 | ## |
| 1218 | |
| 1219 | #SeeAlso incomplete |
| 1220 | |
| 1221 | ## |
| 1222 | |
| 1223 | #Method SkIRect round() const |
| 1224 | |
| 1225 | Returns the result of calling round(&dst) |
| 1226 | |
| 1227 | #Return incomplete ## |
| 1228 | |
| 1229 | #Example |
| 1230 | // incomplete |
| 1231 | ## |
| 1232 | |
| 1233 | #SeeAlso incomplete |
| 1234 | |
| 1235 | ## |
| 1236 | |
| 1237 | #Method SkIRect roundOut() const |
| 1238 | |
| 1239 | Returns the result of calling roundOut(&dst) |
| 1240 | |
| 1241 | #Return incomplete ## |
| 1242 | |
| 1243 | #Example |
| 1244 | // incomplete |
| 1245 | ## |
| 1246 | |
| 1247 | #SeeAlso incomplete |
| 1248 | |
| 1249 | ## |
| 1250 | |
| 1251 | #Method void sort() |
| 1252 | |
| 1253 | Swaps top/bottom or left/right if there are flipped; if width() |
| 1254 | or height() would have returned a negative value. This should be called |
| 1255 | if the edges are computed separately, and may have crossed over each |
| 1256 | other. When this returns, left <= right && top <= bottom |
| 1257 | |
| 1258 | #Example |
| 1259 | // incomplete |
| 1260 | ## |
| 1261 | |
| 1262 | #SeeAlso incomplete |
| 1263 | |
| 1264 | ## |
| 1265 | |
| 1266 | #Method SkRect makeSorted() const |
| 1267 | |
| 1268 | Returns a new Rect that is the sorted version of this rectangle (left <= right, top <= bottom). |
| 1269 | |
| 1270 | #Return incomplete ## |
| 1271 | |
| 1272 | #Example |
| 1273 | // incomplete |
| 1274 | ## |
| 1275 | |
| 1276 | #SeeAlso incomplete |
| 1277 | |
| 1278 | ## |
| 1279 | |
| 1280 | #Method const SkScalar* asScalars() const |
| 1281 | |
| 1282 | Cast-safe way to treat the rectangle as a SkScalar array with four entries. |
| 1283 | |
| 1284 | #Return incomplete ## |
| 1285 | |
| 1286 | #Example |
| 1287 | // incomplete |
| 1288 | ## |
| 1289 | |
| 1290 | ## |
| 1291 | |
| 1292 | #Method void dump(bool asHex) const |
| 1293 | |
| 1294 | #Param asHex incomplete ## |
| 1295 | |
| 1296 | #Example |
| 1297 | // incomplete |
| 1298 | ## |
| 1299 | |
| 1300 | ## |
| 1301 | |
| 1302 | #Method void dump() const |
| 1303 | |
| 1304 | #Example |
| 1305 | // incomplete |
| 1306 | ## |
| 1307 | |
| 1308 | ## |
| 1309 | |
| 1310 | #Method void dumpHex() const |
| 1311 | |
| 1312 | #Example |
| 1313 | // incomplete |
| 1314 | ## |
| 1315 | |
| 1316 | ## |
| 1317 | |
| 1318 | #Struct SkRect ## |
| 1319 | |
| 1320 | #Topic Rect ## |