Lines Matching full:region
1 #Topic Region
5 Region is a compressed one bit mask. Region describes an aliased clipping area
6 on integer boundaries. Region can also describe an array of integer rectangles.
8 Canvas uses Region to reduce the current clip. Region may be drawn to Canvas;
9 Paint determines if Region is filled or stroked, its Color, and so on.
11 Region may be constructed from IRect array or Path. Diagonal lines and curves
42 Iterator(const SkRegion& region);
44 void reset(const SkRegion& region);
53 up Region.
58 #Line # constructs Region iterator ##
63 SkRegion region;
64 region.setRect({1, 2, 3, 4});
65 iter.reset(region);
79 #Method Iterator(const SkRegion& region)
80 #Line # constructs Region iterator ##
84 SkRegion region;
85 region.setRect({1, 2, 3, 4});
86 SkRegion::Iterator iter(region);
116 SkRegion region;
117 iter.reset(region);
118 debugster("empty region", iter, true);
119 region.setRect({1, 2, 3, 4});
120 iter.reset(region);
127 empty region rewind success=true
128 empty region rect={0,0,0,0}
141 #Method void reset(const SkRegion& region)
142 #Line # sets Region to iterate ##
149 SkRegion region;
150 SkRegion::Iterator iter(region);
151 debugster("empty region", iter);
152 region.setRect({1, 2, 3, 4});
154 iter.reset(region);
157 empty region: done=true
174 SkRegion region;
175 SkRegion::Iterator iter(region);
177 region.setRect({1, 2, 3, 4});
197 SkRegion region;
199 region.setRects(rects, SK_ARRAY_COUNT(rects));
200 SkRegion::Iterator iter(region);
219 #Line # returns part of Region as IRect ##
224 SkRegion region;
225 SkRegion::Iterator iter(region);
228 region.setRect({1, 2, 3, 4});
246 #Line # returns original Region ##
250 SkRegion region;
252 region.setRects(rects, SK_ARRAY_COUNT(rects));
253 SkRegion::Iterator iter(region);
274 Cliperator(const SkRegion& region, const SkIRect& clip);
282 up Region intersected with the specified clip rectangle.
286 #Method Cliperator(const SkRegion& region, const SkIRect& clip)
287 #Line # constructs Region iterator with clip ##
291 SkRegion region;
292 region.setRect({1, 2, 3, 4});
293 SkRegion::Cliperator clipper(region, {0, 0, 2, 3});
312 auto debugster = [](const char* label, SkRegion& region) -> void {
313 SkRegion::Cliperator clipper(region, {0, 0, 5, 5});
316 SkRegion region;
317 debugster("empty region", region);
318 region.setRect({1, 2, 3, 4});
319 debugster("after add rect", region);
321 empty region done=true
337 SkRegion region;
339 region.setRects(rects, SK_ARRAY_COUNT(rects));
340 SkRegion::Cliperator clipper(region, {0, 3, 8, 7});
359 #Line # returns part of Region as IRect intersected with clip ##
364 auto debugster = [](const char* label, SkRegion& region) -> void {
365 SkRegion::Cliperator clipper(region, {0, 0, 5, 3});
369 SkRegion region;
370 debugster("empty region", region);
371 region.setRect({1, 2, 3, 4});
372 debugster("after set rect", region);
375 empty region rect={1094713344,1065353216,0,-1}
394 Spanerator(const SkRegion& region, int y, int left, int right);
399 Returns the line segment ends within Region that intersect a horizontal line.
403 #Method Spanerator(const SkRegion& region, int y, int left, int right)
404 #Line # constructs Region iterator on scan line ##
408 SkRegion region;
409 region.setRect({1, 2, 3, 4});
410 SkRegion::Spanerator spanner(region, 3, 2, 4);
427 auto debugster = [](const char* label, SkRegion& region) -> void {
428 SkRegion::Spanerator spanner(region, 3, 2, 4);
435 SkRegion region;
436 debugster("empty region", region);
437 region.setRect({1, 2, 3, 4});
438 debugster("after set rect", region);
440 empty region: result=false
459 SkRegion region;
460 SkIRect r = region.getBounds();
461 SkDebugf("region bounds: {%d, %d, %d, %d}\n", r.fLeft, r.fTop, r.fRight, r.fBottom);
463 region bounds: {0, 0, 0, 0}
473 #Method SkRegion(const SkRegion& region)
479 auto debugster = [](const char* label, SkRegion& region) -> void {
480 auto r = region.getBounds();
483 SkRegion region({1, 2, 3, 4});
484 SkRegion region2(region);
485 debugster("region bounds", region);
487 region.setEmpty();
488 SkDebugf(" after region set empty:\n");
489 debugster("region bounds", region);
492 region bounds: {1,2,3,4}
494 after region set empty:
495 region bounds: {0,0,0,0}
500 #SeeAlso setRegion operator=(const SkRegion& region)
508 #Line # constructs Region matching IRect ##
512 SkRegion region({1, 2, 3, 4});
515 SkDebugf("region %c= region2\n", region == region2 ? '=' : '!');
531 delete calls Region destructor, but copy of original in region2 is unaffected.
533 SkRegion* region = new SkRegion({1, 2, 3, 4});
534 SkRegion region2(*region);
535 delete region;
543 …Also SkRegion() SkRegion(const SkRegion& region) SkRegion(const SkIRect& rect) operator=(const SkR…
549 #Method SkRegion& operator=(const SkRegion& region)
555 auto debugster = [](const char* label, SkRegion& region) -> void {
556 auto r = region.getBounds();
569 #SeeAlso set swap SkRegion(const SkRegion& region)
598 #SeeAlso operator!=(const SkRegion& other) const operator=(const SkRegion& region)
628 #SeeAlso operator==(const SkRegion& other) const operator=(const SkRegion& region)
640 auto debugster = [](const char* label, SkRegion& region) -> void {
641 auto r = region.getBounds();
655 #SeeAlso operator=(const SkRegion& region) swap SkRegion(const SkRegion& region)
663 #Line # exchanges Region pair ##
667 auto debugster = [](const char* label, SkRegion& region) -> void {
668 auto r = region.getBounds();
682 #SeeAlso operator=(const SkRegion& region) set SkRegion(const SkRegion& region)
694 auto debugster = [](const char* label, SkRegion& region) -> void {
695 SkDebugf("%14s: region is %s" "empty\n", label, region.isEmpty() ? "" : "not ");
697 SkRegion region;
698 debugster("initial", region);
699 region.setRect({1, 2, 3, 4});
700 debugster("set rect", region);
701 region.setEmpty();
702 debugster("set empty", region);
704 initial: region is empty
705 set rect: region is not empty
706 set empty: region is empty
718 #Line # returns if Region contains one IRect ##
722 auto debugster = [](const char* label, const SkRegion& region) -> void {
723 SkDebugf("%s: region is %s" "rect\n", label, region.isRect() ? "" : "not ");
725 SkRegion region;
726 debugster("initial", region);
727 region.setRect({1, 2, 3, 4});
728 debugster("set rect", region);
729 region.setEmpty();
730 debugster("set empty", region);
732 initial: region is not rect
733 set rect: region is rect
734 set empty: region is not rect
746 #Line # returns true if Region contains more than one IRect ##
750 auto debugster = [](const char* label, const SkRegion& region) -> void {
751 SkDebugf("%s: region is %s" "complex\n", label, region.isComplex() ? "" : "not ");
753 SkRegion region;
754 debugster("initial", region);
755 region.setRect({1, 2, 3, 4});
756 debugster("set rect", region);
757 region.op({2, 3, 4, 5}, SkRegion::kUnion_Op);
758 debugster("op rect", region);
760 initial: region is not complex
761 set rect: region is not complex
762 op rect: region is complex
778 SkRegion region({1, 2, 3, 4});
779 region.op({2, 3, 4, 5}, SkRegion::kUnion_Op);
780 auto r = region.getBounds();
799 auto debugster = [](const char* label, const SkRegion& region) -> void {
800 SkDebugf("%s: region complexity %d\n", label, region.computeRegionComplexity());
802 SkRegion region;
803 debugster("initial", region);
804 region.setRect({1, 2, 3, 4});
805 debugster("set rect", region);
806 region.op({2, 3, 4, 5}, SkRegion::kUnion_Op);
807 debugster("op rect", region);
809 initial: region complexity 0
810 set rect: region complexity 1
811 op rect: region complexity 3
823 #Line # appends Region outline to Path ##
828 SkRegion region;
829 region.setRect({10, 20, 90, 60});
830 region.op({30, 40, 60, 80}, SkRegion::kXOR_Op);
831 canvas->drawRegion(region, SkPaint());
833 region.getBoundaryPath(&path);
850 auto debugster = [](const char* label, SkRegion& region) -> void {
851 auto r = region.getBounds();
854 SkRegion region({1, 2, 3, 4});
855 debugster("region bounds", region);
856 region.setEmpty();
857 SkDebugf(" after region set empty:\n");
858 debugster("region bounds", region);
860 region bounds: {1,2,3,4}
861 after region set empty:
862 region bounds: {0,0,0,0}
874 #Line # constructs Region matching IRect ##
878 SkRegion region({1, 2, 3, 4});
879 SkDebugf("region is %s" "empty\n", region.isEmpty() ? "" : "not ");
880 bool setEmpty = region.setRect({1, 2, 1, 4});
881 SkDebugf("region is %s" "empty\n", region.isEmpty() ? "" : "not ");
884 region is not empty
885 region is empty
898 #Line # constructs Region matching bounds ##
902 auto debugster = [](const char* label, bool success, SkRegion& region) -> void {
903 auto r = region.getBounds();
907 SkRegion region;
908 bool success = region.setRect(1, 2, 3, 4);
909 debugster("set to: 1,2,3,4", success, region);
910 success = region.setRect(3, 2, 1, 4);
911 debugster("set to: 3,2,1,4", success, region);
932 SkRegion region;
933 region.setRects(rects, SK_ARRAY_COUNT(rects));
934 canvas->drawRegion(region, SkPaint());
935 region.setEmpty();
937 region.op(add, SkRegion::kUnion_Op);
939 region.translate(100, 0);
940 canvas->drawRegion(region, SkPaint());
949 #Method bool setRegion(const SkRegion& region)
951 #Line # copies Region ##
955 auto debugster = [](const char* label, SkRegion& region) -> void {
956 auto r = region.getBounds();
959 SkRegion region({1, 2, 3, 4});
961 region2.setRegion(region);
962 debugster("region bounds", region);
965 SkDebugf(" after region set empty:\n");
966 debugster("region bounds", region);
969 region bounds: {1,2,3,4}
971 after region set empty:
972 region bounds: {1,2,3,4}
977 #SeeAlso SkRegion(const SkRegion& region)
985 #Line # constructs Region from clipped Path ##
996 SkRegion region;
997 region.setPath(textPath, clipRegion);
998 canvas->drawRegion(region, SkPaint());
1023 SkRegion region;
1024 region.setPath(textPath, SkRegion({0, 0, 256, 256}));
1025 canvas->drawRegion(region, SkPaint());
1027 paint.setColor(region.intersects(iRect) ? SK_ColorBLUE : SK_ColorRED);
1153 SkRegion region({1, 2, 3, 4});
1155 SkDebugf("quickContains 1: %s\n", region.quickContains(test) ? "true" : "false");
1156 region.op({1, 4, 3, 6}, SkRegion::kUnion_Op);
1157 SkDebugf("quickContains 2: %s\n", region.quickContains(test) ? "true" : "false");
1158 region.op({1, 7, 3, 8}, SkRegion::kUnion_Op);
1159 SkDebugf("quickContains 3: %s\n", region.quickContains(test) ? "true" : "false");
1178 auto debugster = [](const char* label, SkRegion& region) -> void {
1179 SkDebugf("%s: %s\n", label, region.quickContains(2, 2, 3, 3) ? "true" : "false");
1181 SkRegion region({1, 2, 3, 4});
1182 debugster("quickContains 1", region);
1183 region.op({1, 4, 3, 6}, SkRegion::kUnion_Op);
1184 debugster("quickContains 2", region);
1185 region.op({1, 7, 3, 8}, SkRegion::kUnion_Op);
1186 debugster("quickContains 3", region);
1206 SkRegion region({1, 2, 3, 4});
1208 SkDebugf("quickReject 1: %s\n", region.quickReject(test) ? "true" : "false");
1209 region.op({1, 4, 3, 6}, SkRegion::kUnion_Op);
1210 SkDebugf("quickReject 2: %s\n", region.quickReject(test) ? "true" : "false");
1211 region.op({4, 7, 5, 8}, SkRegion::kUnion_Op);
1212 SkDebugf("quickReject 3: %s\n", region.quickReject(test) ? "true" : "false");
1230 SkRegion region({1, 2, 3, 4});
1234 SkDebugf("quickReject 1: %s\n", region.quickReject(test) ? "true" : "false");
1235 region.op({1, 4, 3, 6}, SkRegion::kUnion_Op);
1236 SkDebugf("quickReject 2: %s\n", region.quickReject(test) ? "true" : "false");
1237 region.op({4, 7, 5, 8}, SkRegion::kUnion_Op);
1238 SkDebugf("quickReject 3: %s\n", region.quickReject(test) ? "true" : "false");
1254 #Line # translates IPoints in Region ##
1319 Subtracts operand Region from target Region.
1323 Intersects operand Region and target Region.
1327 Unions operand Region and target Region.
1331 Replaces target Region with area exclusive to both Regions.
1335 Subtracts target Region from operand Region.
1339 Replaces target Region with operand Region.
1568 SkRegion region({20, 20, 80, 80});
1569 size_t size = region.writeToMemory(nullptr);
1571 region.writeToMemory(data->writable_data());
1583 #Topic Region ##