FLImaging 6.5.8.1
TRect.h
1#pragma once
2
11#include <stdint.h>
12#include <type_traits>
13#include <typeinfo>
14
15#include "FLLibTags.h"
16
18namespace FLImaging
19{
21 namespace Base
22 {
34 #pragma pack(push, 1)
35 template <typename T>
36 class FL_EXPORT TRect
37 {
38 public:
39 T left;
40 T top;
41 T right;
42 T bottom;
43
44
45 TRect()
46 {
47 }
48
49 TRect(const TRect<int8_t>& tr) : left((T)tr.left), top((T)tr.top), right((T)tr.right), bottom((T)tr.bottom)
50 {
51 }
52
53 TRect(const TRect<int8_t>* pTr) : left((T)pTr->left), top((T)pTr->top), right((T)pTr->right), bottom((T)pTr->bottom)
54 {
55 }
56
57 TRect(const TRect<uint8_t>& tr) : left((T)tr.left), top((T)tr.top), right((T)tr.right), bottom((T)tr.bottom)
58 {
59 }
60
61 TRect(const TRect<uint8_t>* pTr) : left((T)pTr->left), top((T)pTr->top), right((T)pTr->right), bottom((T)pTr->bottom)
62 {
63 }
64
65 TRect(const TRect<int16_t>& tr) : left((T)tr.left), top((T)tr.top), right((T)tr.right), bottom((T)tr.bottom)
66 {
67 }
68
69 TRect(const TRect<int16_t>* pTr) : left((T)pTr->left), top((T)pTr->top), right((T)pTr->right), bottom((T)pTr->bottom)
70 {
71 }
72
73 TRect(const TRect<uint16_t>& tr) : left((T)tr.left), top((T)tr.top), right((T)tr.right), bottom((T)tr.bottom)
74 {
75 }
76
77 TRect(const TRect<uint16_t>* pTr) : left((T)pTr->left), top((T)pTr->top), right((T)pTr->right), bottom((T)pTr->bottom)
78 {
79 }
80
81 TRect(const TRect<int32_t>& tr) : left((T)tr.left), top((T)tr.top), right((T)tr.right), bottom((T)tr.bottom)
82 {
83 }
84
85 TRect(const TRect<int32_t>* pTr) : left((T)pTr->left), top((T)pTr->top), right((T)pTr->right), bottom((T)pTr->bottom)
86 {
87 }
88
89 TRect(const TRect<uint32_t>& tr) : left((T)tr.left), top((T)tr.top), right((T)tr.right), bottom((T)tr.bottom)
90 {
91 }
92
93 TRect(const TRect<uint32_t>* pTr) : left((T)pTr->left), top((T)pTr->top), right((T)pTr->right), bottom((T)pTr->bottom)
94 {
95 }
96
97 TRect(const TRect<int64_t>& tr) : left((T)tr.left), top((T)tr.top), right((T)tr.right), bottom((T)tr.bottom)
98 {
99 }
100
101 TRect(const TRect<int64_t>* pTr) : left((T)pTr->left), top((T)pTr->top), right((T)pTr->right), bottom((T)pTr->bottom)
102 {
103 }
104
105 TRect(const TRect<uint64_t>& tr) : left((T)tr.left), top((T)tr.top), right((T)tr.right), bottom((T)tr.bottom)
106 {
107 }
108
109 TRect(const TRect<uint64_t>* pTr) : left((T)pTr->left), top((T)pTr->top), right((T)pTr->right), bottom((T)pTr->bottom)
110 {
111 }
112
113 TRect(const TRect<float>& tr) : left((T)tr.left), top((T)tr.top), right((T)tr.right), bottom((T)tr.bottom)
114 {
115 }
116
117 TRect(const TRect<float>* pTr) : left((T)pTr->left), top((T)pTr->top), right((T)pTr->right), bottom((T)pTr->bottom)
118 {
119 }
120
121 TRect(const TRect<double>& tr) : left((T)tr.left), top((T)tr.top), right((T)tr.right), bottom((T)tr.bottom)
122 {
123 }
124
125 TRect(const TRect<double>* pTr) : left((T)pTr->left), top((T)pTr->top), right((T)pTr->right), bottom((T)pTr->bottom)
126 {
127 }
128
129 TRect(int8_t left, int8_t top, int8_t right, int8_t bottom) : left((T)left), top((T)top), right((T)right), bottom((T)bottom)
130 {
131 }
132
133 TRect(uint8_t left, uint8_t top, uint8_t right, uint8_t bottom) : left((T)left), top((T)top), right((T)right), bottom((T)bottom)
134 {
135 }
136
137 TRect(int16_t left, int16_t top, int16_t right, int16_t bottom) : left((T)left), top((T)top), right((T)right), bottom((T)bottom)
138 {
139 }
140
141 TRect(uint16_t left, uint16_t top, uint16_t right, uint16_t bottom) : left((T)left), top((T)top), right((T)right), bottom((T)bottom)
142 {
143 }
144
145 TRect(int32_t left, int32_t top, int32_t right, int32_t bottom) : left((T)left), top((T)top), right((T)right), bottom((T)bottom)
146 {
147 }
148
149 TRect(uint32_t left, uint32_t top, uint32_t right, uint32_t bottom) : left((T)left), top((T)top), right((T)right), bottom((T)bottom)
150 {
151 }
152
153 TRect(int64_t left, int64_t top, int64_t right, int64_t bottom) : left((T)left), top((T)top), right((T)right), bottom((T)bottom)
154 {
155 }
156
157 TRect(uint64_t left, uint64_t top, uint64_t right, uint64_t bottom) : left((T)left), top((T)top), right((T)right), bottom((T)bottom)
158 {
159 }
160
161 TRect(float left, float top, float right, float bottom) : left((T)left), top((T)top), right((T)right), bottom((T)bottom)
162 {
163 }
164
165 TRect(double left, double top, double right, double bottom) : left((T)left), top((T)top), right((T)right), bottom((T)bottom)
166 {
167 }
168
169 void Set(const TRect<int8_t>& tr)
170 {
171 this->left = (T)tr.left;
172 this->top = (T)tr.top;
173 this->right = (T)tr.right;
174 this->bottom = (T)tr.bottom;
175 }
176
177 void Set(const TRect<int8_t>* pTr)
178 {
179 this->left = (T)pTr->left;
180 this->top = (T)pTr->top;
181 this->right = (T)pTr->right;
182 this->bottom = (T)pTr->bottom;
183 }
184
185 void Set(const TRect<uint8_t>& tr)
186 {
187 this->left = (T)tr.left;
188 this->top = (T)tr.top;
189 this->right = (T)tr.right;
190 this->bottom = (T)tr.bottom;
191 }
192
193 void Set(const TRect<uint8_t>* pTr)
194 {
195 this->left = (T)pTr->left;
196 this->top = (T)pTr->top;
197 this->right = (T)pTr->right;
198 this->bottom = (T)pTr->bottom;
199 }
200
201 void Set(const TRect<int16_t>& tr)
202 {
203 this->left = (T)tr.left;
204 this->top = (T)tr.top;
205 this->right = (T)tr.right;
206 this->bottom = (T)tr.bottom;
207 }
208
209 void Set(const TRect<int16_t>* pTr)
210 {
211 this->left = (T)pTr->left;
212 this->top = (T)pTr->top;
213 this->right = (T)pTr->right;
214 this->bottom = (T)pTr->bottom;
215 }
216
217 void Set(const TRect<uint16_t>& tr)
218 {
219 this->left = (T)tr.left;
220 this->top = (T)tr.top;
221 this->right = (T)tr.right;
222 this->bottom = (T)tr.bottom;
223 }
224
225 void Set(const TRect<uint16_t>* pTr)
226 {
227 this->left = (T)pTr->left;
228 this->top = (T)pTr->top;
229 this->right = (T)pTr->right;
230 this->bottom = (T)pTr->bottom;
231 }
232
233 void Set(const TRect<int32_t>& tr)
234 {
235 this->left = (T)tr.left;
236 this->top = (T)tr.top;
237 this->right = (T)tr.right;
238 this->bottom = (T)tr.bottom;
239 }
240
241 void Set(const TRect<int32_t>* pTr)
242 {
243 this->left = (T)pTr->left;
244 this->top = (T)pTr->top;
245 this->right = (T)pTr->right;
246 this->bottom = (T)pTr->bottom;
247 }
248
249 void Set(const TRect<uint32_t>& tr)
250 {
251 this->left = (T)tr.left;
252 this->top = (T)tr.top;
253 this->right = (T)tr.right;
254 this->bottom = (T)tr.bottom;
255 }
256
257 void Set(const TRect<uint32_t>* pTr)
258 {
259 this->left = (T)pTr->left;
260 this->top = (T)pTr->top;
261 this->right = (T)pTr->right;
262 this->bottom = (T)pTr->bottom;
263 }
264
265 void Set(const TRect<int64_t>& tr)
266 {
267 this->left = (T)tr.left;
268 this->top = (T)tr.top;
269 this->right = (T)tr.right;
270 this->bottom = (T)tr.bottom;
271 }
272
273 void Set(const TRect<int64_t>* pTr)
274 {
275 this->left = (T)pTr->left;
276 this->top = (T)pTr->top;
277 this->right = (T)pTr->right;
278 this->bottom = (T)pTr->bottom;
279 }
280
281 void Set(const TRect<uint64_t>& tr)
282 {
283 this->left = (T)tr.left;
284 this->top = (T)tr.top;
285 this->right = (T)tr.right;
286 this->bottom = (T)tr.bottom;
287 }
288
289 void Set(const TRect<uint64_t>* pTr)
290 {
291 this->left = (T)pTr->left;
292 this->top = (T)pTr->top;
293 this->right = (T)pTr->right;
294 this->bottom = (T)pTr->bottom;
295 }
296
297 void Set(const TRect<float>& tr)
298 {
299 this->left = (T)tr.left;
300 this->top = (T)tr.top;
301 this->right = (T)tr.right;
302 this->bottom = (T)tr.bottom;
303 }
304
305 void Set(const TRect<float>* pTr)
306 {
307 this->left = (T)pTr->left;
308 this->top = (T)pTr->top;
309 this->right = (T)pTr->right;
310 this->bottom = (T)pTr->bottom;
311 }
312
313 void Set(const TRect<double>& tr)
314 {
315 this->left = (T)tr.left;
316 this->top = (T)tr.top;
317 this->right = (T)tr.right;
318 this->bottom = (T)tr.bottom;
319 }
320
321 void Set(const TRect<double>* pTr)
322 {
323 this->left = (T)pTr->left;
324 this->top = (T)pTr->top;
325 this->right = (T)pTr->right;
326 this->bottom = (T)pTr->bottom;
327 }
328
329 void Set(int8_t left, int8_t top, int8_t right, int8_t bottom)
330 {
331 this->left = (T)left;
332 this->top = (T)top;
333 this->right = (T)right;
334 this->bottom = (T)bottom;
335 }
336
337 void Set(uint8_t left, uint8_t top, uint8_t right, uint8_t bottom)
338 {
339 this->left = (T)left;
340 this->top = (T)top;
341 this->right = (T)right;
342 this->bottom = (T)bottom;
343 }
344
345 void Set(int16_t left, int16_t top, int16_t right, int16_t bottom)
346 {
347 this->left = (T)left;
348 this->top = (T)top;
349 this->right = (T)right;
350 this->bottom = (T)bottom;
351 }
352
353 void Set(uint16_t left, uint16_t top, uint16_t right, uint16_t bottom)
354 {
355 this->left = (T)left;
356 this->top = (T)top;
357 this->right = (T)right;
358 this->bottom = (T)bottom;
359 }
360
361 void Set(int32_t left, int32_t top, int32_t right, int32_t bottom)
362 {
363 this->left = (T)left;
364 this->top = (T)top;
365 this->right = (T)right;
366 this->bottom = (T)bottom;
367 }
368
369 void Set(uint32_t left, uint32_t top, uint32_t right, uint32_t bottom)
370 {
371 this->left = (T)left;
372 this->top = (T)top;
373 this->right = (T)right;
374 this->bottom = (T)bottom;
375 }
376
377 void Set(int64_t left, int64_t top, int64_t right, int64_t bottom)
378 {
379 this->left = (T)left;
380 this->top = (T)top;
381 this->right = (T)right;
382 this->bottom = (T)bottom;
383 }
384
385 void Set(uint64_t left, uint64_t top, uint64_t right, uint64_t bottom)
386 {
387 this->left = (T)left;
388 this->top = (T)top;
389 this->right = (T)right;
390 this->bottom = (T)bottom;
391 }
392
393 void Set(float left, float top, float right, float bottom)
394 {
395 this->left = (T)left;
396 this->top = (T)top;
397 this->right = (T)right;
398 this->bottom = (T)bottom;
399 }
400
401 void Set(double left, double top, double right, double bottom)
402 {
403 this->left = (T)left;
404 this->top = (T)top;
405 this->right = (T)right;
406 this->bottom = (T)bottom;
407 }
408
409
410 const TRect<T>& operator=(int32_t value)
411 {
412 left = top = right = bottom = (T)value;
413
414 return *this;
415 }
416
417 const TRect<T>& operator=(int64_t value)
418 {
419 left = top = right = bottom = (T)value;
420
421 return *this;
422 }
423
424 const TRect<T>& operator=(float value)
425 {
426 left = top = right = bottom = (T)value;
427
428 return *this;
429 }
430
431 const TRect<T>& operator=(double value)
432 {
433 left = top = right = bottom = (T)value;
434
435 return *this;
436 }
437
438 const TRect<T>& operator=(const TRect<int32_t>& tr)
439 {
440 left = (T)tr.left;
441 top = (T)tr.top;
442 right = (T)tr.right;
443 bottom = (T)tr.bottom;
444
445 return *this;
446 }
447
448 const TRect<T>& operator=(const TRect<int64_t>& tr)
449 {
450 left = (T)tr.left;
451 top = (T)tr.top;
452 right = (T)tr.right;
453 bottom = (T)tr.bottom;
454
455 return *this;
456 }
457
458 const TRect<T>& operator=(const TRect<float>& tr)
459 {
460 left = (T)tr.left;
461 top = (T)tr.top;
462 right = (T)tr.right;
463 bottom = (T)tr.bottom;
464
465 return *this;
466 }
467
468 const TRect<T>& operator=(const TRect<double>& tr)
469 {
470 left = (T)tr.left;
471 top = (T)tr.top;
472 right = (T)tr.right;
473 bottom = (T)tr.bottom;
474
475 return *this;
476 }
477
478 bool operator==(const TRect<int32_t>& tr)
479 {
480 return left == (T)tr.left && top == (T)tr.top && right == (T)tr.right && bottom == (T)tr.bottom;
481 }
482
483 bool operator==(const TRect<int64_t>& tr)
484 {
485 return left == (T)tr.left && top == (T)tr.top && right == (T)tr.right && bottom == (T)tr.bottom;
486 }
487
488 bool operator==(const TRect<float>& tr)
489 {
490 return left == (T)tr.left && top == (T)tr.top && right == (T)tr.right && bottom == (T)tr.bottom;
491 }
492
493 bool operator==(const TRect<double>& tr)
494 {
495 return left == (T)tr.left && top == (T)tr.top && right == (T)tr.right && bottom == (T)tr.bottom;
496 }
497
498 bool operator!=(const TRect<int32_t>& tr)
499 {
500 return left != (T)tr.left || top != (T)tr.top || right != (T)tr.right || bottom != (T)tr.bottom;
501 }
502
503 bool operator!=(const TRect<int64_t>& tr)
504 {
505 return left != (T)tr.left || top != (T)tr.top || right != (T)tr.right || bottom != (T)tr.bottom;
506 }
507
508 bool operator!=(const TRect<float>& tr)
509 {
510 return left != (T)tr.left || top != (T)tr.top || right != (T)tr.right || bottom != (T)tr.bottom;
511 }
512
513 bool operator!=(const TRect<double>& tr)
514 {
515 return left != (T)tr.left || top != (T)tr.top || right != (T)tr.right || bottom != (T)tr.bottom;
516 }
517
518 const TRect<T>& operator+=(int32_t value)
519 {
520 left += (T)value;
521 top += (T)value;
522 right += (T)value;
523 bottom += (T)value;
524
525 return *this;
526 }
527
528 const TRect<T>& operator+=(int64_t value)
529 {
530 left += (T)value;
531 top += (T)value;
532 right += (T)value;
533 bottom += (T)value;
534
535 return *this;
536 }
537
538 const TRect<T>& operator+=(float value)
539 {
540 left += (T)value;
541 top += (T)value;
542 right += (T)value;
543 bottom += (T)value;
544
545 return *this;
546 }
547
548 const TRect<T>& operator+=(double value)
549 {
550 left += (T)value;
551 top += (T)value;
552 right += (T)value;
553 bottom += (T)value;
554
555 return *this;
556 }
557
558 const TRect<T>& operator+=(const TRect<int32_t>& tr)
559 {
560 left += (T)tr.left;
561 top += (T)tr.top;
562 right += (T)tr.right;
563 bottom += (T)tr.bottom;
564
565 return *this;
566 }
567
568 const TRect<T>& operator+=(const TRect<int64_t>& tr)
569 {
570 left += (T)tr.left;
571 top += (T)tr.top;
572 right += (T)tr.right;
573 bottom += (T)tr.bottom;
574
575 return *this;
576 }
577
578 const TRect<T>& operator+=(const TRect<float>& tr)
579 {
580 left += (T)tr.left;
581 top += (T)tr.top;
582 right += (T)tr.right;
583 bottom += (T)tr.bottom;
584
585 return *this;
586 }
587
588 const TRect<T>& operator+=(const TRect<double>& tr)
589 {
590 left += (T)tr.left;
591 top += (T)tr.top;
592 right += (T)tr.right;
593 bottom += (T)tr.bottom;
594
595 return *this;
596 }
597
598 const TRect<T>& operator-=(int32_t value)
599 {
600 left -= (T)value;
601 top -= (T)value;
602 right -= (T)value;
603 bottom -= (T)value;
604
605 return *this;
606 }
607
608 const TRect<T>& operator-=(int64_t value)
609 {
610 left -= (T)value;
611 top -= (T)value;
612 right -= (T)value;
613 bottom -= (T)value;
614
615 return *this;
616 }
617
618 const TRect<T>& operator-=(float value)
619 {
620 left -= (T)value;
621 top -= (T)value;
622 right -= (T)value;
623 bottom -= (T)value;
624
625 return *this;
626 }
627
628 const TRect<T>& operator-=(double value)
629 {
630 left -= (T)value;
631 top -= (T)value;
632 right -= (T)value;
633 bottom -= (T)value;
634
635 return *this;
636 }
637
638 const TRect<T>& operator-=(const TRect<int32_t>& tr)
639 {
640 left -= (T)tr.left;
641 top -= (T)tr.top;
642 right -= (T)tr.right;
643 bottom -= (T)tr.bottom;
644
645 return *this;
646 }
647
648 const TRect<T>& operator-=(const TRect<int64_t>& tr)
649 {
650 left -= (T)tr.left;
651 top -= (T)tr.top;
652 right -= (T)tr.right;
653 bottom -= (T)tr.bottom;
654
655 return *this;
656 }
657
658 const TRect<T>& operator-=(const TRect<float>& tr)
659 {
660 left -= (T)tr.left;
661 top -= (T)tr.top;
662 right -= (T)tr.right;
663 bottom -= (T)tr.bottom;
664
665 return *this;
666 }
667
668 const TRect<T>& operator-=(const TRect<double>& tr)
669 {
670 left -= (T)tr.left;
671 top -= (T)tr.top;
672 right -= (T)tr.right;
673 bottom -= (T)tr.bottom;
674
675 return *this;
676 }
677
678 const TRect<T>& operator*=(int32_t value)
679 {
680 left *= (T)value;
681 top *= (T)value;
682 right *= (T)value;
683 bottom *= (T)value;
684
685 return *this;
686 }
687
688 const TRect<T>& operator*=(int64_t value)
689 {
690 left *= (T)value;
691 top *= (T)value;
692 right *= (T)value;
693 bottom *= (T)value;
694
695 return *this;
696 }
697
698 const TRect<T>& operator*=(float value)
699 {
700 left *= (T)value;
701 top *= (T)value;
702 right *= (T)value;
703 bottom *= (T)value;
704
705 return *this;
706 }
707
708 const TRect<T>& operator*=(double value)
709 {
710 left *= (T)value;
711 top *= (T)value;
712 right *= (T)value;
713 bottom *= (T)value;
714
715 return *this;
716 }
717
718 const TRect<T>& operator*=(const TRect<int32_t>& tr)
719 {
720 left *= (T)tr.left;
721 top *= (T)tr.top;
722 right *= (T)tr.right;
723 bottom *= (T)tr.bottom;
724
725 return *this;
726 }
727
728 const TRect<T>& operator*=(const TRect<int64_t>& tr)
729 {
730 left *= (T)tr.left;
731 top *= (T)tr.top;
732 right *= (T)tr.right;
733 bottom *= (T)tr.bottom;
734
735 return *this;
736 }
737
738 const TRect<T>& operator*=(const TRect<float>& tr)
739 {
740 left *= (T)tr.left;
741 top *= (T)tr.top;
742 right *= (T)tr.right;
743 bottom *= (T)tr.bottom;
744
745 return *this;
746 }
747
748 const TRect<T>& operator*=(const TRect<double>& tr)
749 {
750 left *= (T)tr.left;
751 top *= (T)tr.top;
752 right *= (T)tr.right;
753 bottom *= (T)tr.bottom;
754
755 return *this;
756 }
757
758 const TRect<T>& operator/=(int32_t value)
759 {
760 left /= (T)value;
761 top /= (T)value;
762 right /= (T)value;
763 bottom /= (T)value;
764
765 return *this;
766 }
767
768 const TRect<T>& operator/=(int64_t value)
769 {
770 left /= (T)value;
771 top /= (T)value;
772 right /= (T)value;
773 bottom /= (T)value;
774
775 return *this;
776 }
777
778 const TRect<T>& operator/=(float value)
779 {
780 left /= (T)value;
781 top /= (T)value;
782 right /= (T)value;
783 bottom /= (T)value;
784
785 return *this;
786 }
787
788 const TRect<T>& operator/=(double value)
789 {
790 left /= (T)value;
791 top /= (T)value;
792 right /= (T)value;
793 bottom /= (T)value;
794
795 return *this;
796 }
797
798 const TRect<T>& operator/=(const TRect<int32_t>& tr)
799 {
800 left /= (T)tr.left;
801 top /= (T)tr.top;
802 right /= (T)tr.right;
803 bottom /= (T)tr.bottom;
804
805 return *this;
806 }
807
808 const TRect<T>& operator/=(const TRect<int64_t>& tr)
809 {
810 left /= (T)tr.left;
811 top /= (T)tr.top;
812 right /= (T)tr.right;
813 bottom /= (T)tr.bottom;
814
815 return *this;
816 }
817
818 const TRect<T>& operator/=(const TRect<float>& tr)
819 {
820 left /= (T)tr.left;
821 top /= (T)tr.top;
822 right /= (T)tr.right;
823 bottom /= (T)tr.bottom;
824
825 return *this;
826 }
827
828 const TRect<T>& operator/=(const TRect<double>& tr)
829 {
830 left /= (T)tr.left;
831 top /= (T)tr.top;
832 right /= (T)tr.right;
833 bottom /= (T)tr.bottom;
834
835 return *this;
836 }
837
838 TRect<T> operator+(int32_t value)
839 {
840 TRect<T> trReturn;
841 trReturn.left = left + (T)value;
842 trReturn.top = top + (T)value;
843 trReturn.right = right + (T)value;
844 trReturn.bottom = bottom + (T)value;
845 return trReturn;
846 }
847
848 TRect<T> operator+(int64_t value)
849 {
850 TRect<T> trReturn;
851 trReturn.left = left + (T)value;
852 trReturn.top = top + (T)value;
853 trReturn.right = right + (T)value;
854 trReturn.bottom = bottom + (T)value;
855 return trReturn;
856 }
857
858 TRect<T> operator+(float value)
859 {
860 TRect<T> trReturn;
861 trReturn.left = left + (T)value;
862 trReturn.top = top + (T)value;
863 trReturn.right = right + (T)value;
864 trReturn.bottom = bottom + (T)value;
865 return trReturn;
866 }
867
868 TRect<T> operator+(double value)
869 {
870 TRect<T> trReturn;
871 trReturn.left = left + (T)value;
872 trReturn.top = top + (T)value;
873 trReturn.right = right + (T)value;
874 trReturn.bottom = bottom + (T)value;
875 return trReturn;
876 }
877
878 TRect<T> operator+(const TRect<int32_t>& tr)
879 {
880 TRect<T> trReturn;
881 trReturn.left = left + (T)tr.left;
882 trReturn.top = top + (T)tr.top;
883 trReturn.right = right + (T)tr.right;
884 trReturn.bottom = bottom + (T)tr.bottom;
885 return trReturn;
886 }
887
888 TRect<T> operator+(const TRect<int64_t>& tr)
889 {
890 TRect<T> trReturn;
891 trReturn.left = left + (T)tr.left;
892 trReturn.top = top + (T)tr.top;
893 trReturn.right = right + (T)tr.right;
894 trReturn.bottom = bottom + (T)tr.bottom;
895 return trReturn;
896 }
897
898 TRect<T> operator+(const TRect<float>& tr)
899 {
900 TRect<T> trReturn;
901 trReturn.left = left + (T)tr.left;
902 trReturn.top = top + (T)tr.top;
903 trReturn.right = right + (T)tr.right;
904 trReturn.bottom = bottom + (T)tr.bottom;
905 return trReturn;
906 }
907
908 TRect<T> operator+(const TRect<double>& tr)
909 {
910 TRect<T> trReturn;
911 trReturn.left = left + (T)tr.left;
912 trReturn.top = top + (T)tr.top;
913 trReturn.right = right + (T)tr.right;
914 trReturn.bottom = bottom + (T)tr.bottom;
915 return trReturn;
916 }
917
918 TRect<T> operator-(int32_t value)
919 {
920 TRect<T> trReturn;
921 trReturn.left = left - (T)value;
922 trReturn.top = top - (T)value;
923 trReturn.right = right - (T)value;
924 trReturn.bottom = bottom - (T)value;
925 return trReturn;
926 }
927
928 TRect<T> operator-(int64_t value)
929 {
930 TRect<T> trReturn;
931 trReturn.left = left - (T)value;
932 trReturn.top = top - (T)value;
933 trReturn.right = right - (T)value;
934 trReturn.bottom = bottom - (T)value;
935 return trReturn;
936 }
937
938 TRect<T> operator-(float value)
939 {
940 TRect<T> trReturn;
941 trReturn.left = left - (T)value;
942 trReturn.top = top - (T)value;
943 trReturn.right = right - (T)value;
944 trReturn.bottom = bottom - (T)value;
945 return trReturn;
946 }
947
948 TRect<T> operator-(double value)
949 {
950 TRect<T> trReturn;
951 trReturn.left = left - (T)value;
952 trReturn.top = top - (T)value;
953 trReturn.right = right - (T)value;
954 trReturn.bottom = bottom - (T)value;
955 return trReturn;
956 }
957
958 TRect<T> operator-(const TRect<int32_t>& tr)
959 {
960 TRect<T> trReturn;
961 trReturn.left = left - (T)tr.left;
962 trReturn.top = top - (T)tr.top;
963 trReturn.right = right - (T)tr.right;
964 trReturn.bottom = bottom - (T)tr.bottom;
965 return trReturn;
966 }
967
968 TRect<T> operator-(const TRect<int64_t>& tr)
969 {
970 TRect<T> trReturn;
971 trReturn.left = left - (T)tr.left;
972 trReturn.top = top - (T)tr.top;
973 trReturn.right = right - (T)tr.right;
974 trReturn.bottom = bottom - (T)tr.bottom;
975 return trReturn;
976 }
977
978 TRect<T> operator-(const TRect<float>& tr)
979 {
980 TRect<T> trReturn;
981 trReturn.left = left - (T)tr.left;
982 trReturn.top = top - (T)tr.top;
983 trReturn.right = right - (T)tr.right;
984 trReturn.bottom = bottom - (T)tr.bottom;
985 return trReturn;
986 }
987
988 TRect<T> operator-(const TRect<double>& tr)
989 {
990 TRect<T> trReturn;
991 trReturn.left = left - (T)tr.left;
992 trReturn.top = top - (T)tr.top;
993 trReturn.right = right - (T)tr.right;
994 trReturn.bottom = bottom - (T)tr.bottom;
995 return trReturn;
996 }
997
998 TRect<T> operator*(int32_t value)
999 {
1000 TRect<T> trReturn;
1001 trReturn.left = left * (T)value;
1002 trReturn.top = top * (T)value;
1003 trReturn.right = right * (T)value;
1004 trReturn.bottom = bottom * (T)value;
1005 return trReturn;
1006 }
1007
1008 TRect<T> operator*(int64_t value)
1009 {
1010 TRect<T> trReturn;
1011 trReturn.left = left * (T)value;
1012 trReturn.top = top * (T)value;
1013 trReturn.right = right * (T)value;
1014 trReturn.bottom = bottom * (T)value;
1015 return trReturn;
1016 }
1017
1018 TRect<T> operator*(float value)
1019 {
1020 TRect<T> trReturn;
1021 trReturn.left = left * (T)value;
1022 trReturn.top = top * (T)value;
1023 trReturn.right = right * (T)value;
1024 trReturn.bottom = bottom * (T)value;
1025 return trReturn;
1026 }
1027
1028 TRect<T> operator*(double value)
1029 {
1030 TRect<T> trReturn;
1031 trReturn.left = left * (T)value;
1032 trReturn.top = top * (T)value;
1033 trReturn.right = right * (T)value;
1034 trReturn.bottom = bottom * (T)value;
1035 return trReturn;
1036 }
1037
1038 TRect<T> operator*(const TRect<int32_t>& tr)
1039 {
1040 TRect<T> trReturn;
1041 trReturn.left = left * (T)tr.left;
1042 trReturn.top = top * (T)tr.top;
1043 trReturn.right = right * (T)tr.right;
1044 trReturn.bottom = bottom * (T)tr.bottom;
1045 return trReturn;
1046 }
1047
1048 TRect<T> operator*(const TRect<int64_t>& tr)
1049 {
1050 TRect<T> trReturn;
1051 trReturn.left = left * (T)tr.left;
1052 trReturn.top = top * (T)tr.top;
1053 trReturn.right = right * (T)tr.right;
1054 trReturn.bottom = bottom * (T)tr.bottom;
1055 return trReturn;
1056 }
1057
1058 TRect<T> operator*(const TRect<float>& tr)
1059 {
1060 TRect<T> trReturn;
1061 trReturn.left = left * (T)tr.left;
1062 trReturn.top = top * (T)tr.top;
1063 trReturn.right = right * (T)tr.right;
1064 trReturn.bottom = bottom * (T)tr.bottom;
1065 return trReturn;
1066 }
1067
1068 TRect<T> operator*(const TRect<double>& tr)
1069 {
1070 TRect<T> trReturn;
1071 trReturn.left = left * (T)tr.left;
1072 trReturn.top = top * (T)tr.top;
1073 trReturn.right = right * (T)tr.right;
1074 trReturn.bottom = bottom * (T)tr.bottom;
1075 return trReturn;
1076 }
1077
1078 TRect<T> operator/(int32_t value)
1079 {
1080 TRect<T> trReturn;
1081 trReturn.left = left / (T)value;
1082 trReturn.top = top / (T)value;
1083 trReturn.right = right / (T)value;
1084 trReturn.bottom = bottom / (T)value;
1085 return trReturn;
1086 }
1087
1088 TRect<T> operator/(int64_t value)
1089 {
1090 TRect<T> trReturn;
1091 trReturn.left = left / (T)value;
1092 trReturn.top = top / (T)value;
1093 trReturn.right = right / (T)value;
1094 trReturn.bottom = bottom / (T)value;
1095 return trReturn;
1096 }
1097
1098 TRect<T> operator/(float value)
1099 {
1100 TRect<T> trReturn;
1101 trReturn.left = left / (T)value;
1102 trReturn.top = top / (T)value;
1103 trReturn.right = right / (T)value;
1104 trReturn.bottom = bottom / (T)value;
1105 return trReturn;
1106 }
1107
1108 TRect<T> operator/(double value)
1109 {
1110 TRect<T> trReturn;
1111 trReturn.left = left / (T)value;
1112 trReturn.top = top / (T)value;
1113 trReturn.right = right / (T)value;
1114 trReturn.bottom = bottom / (T)value;
1115 return trReturn;
1116 }
1117
1118 TRect<T> operator/(const TRect<int32_t>& tr)
1119 {
1120 TRect<T> trReturn;
1121 trReturn.left = left / (T)tr.left;
1122 trReturn.top = top / (T)tr.top;
1123 trReturn.right = right / (T)tr.right;
1124 trReturn.bottom = bottom / (T)tr.bottom;
1125 return trReturn;
1126 }
1127
1128 TRect<T> operator/(const TRect<int64_t>& tr)
1129 {
1130 TRect<T> trReturn;
1131 trReturn.left = left / (T)tr.left;
1132 trReturn.top = top / (T)tr.top;
1133 trReturn.right = right / (T)tr.right;
1134 trReturn.bottom = bottom / (T)tr.bottom;
1135 return trReturn;
1136 }
1137
1138 TRect<T> operator/(const TRect<float>& tr)
1139 {
1140 TRect<T> trReturn;
1141 trReturn.left = left / (T)tr.left;
1142 trReturn.top = top / (T)tr.top;
1143 trReturn.right = right / (T)tr.right;
1144 trReturn.bottom = bottom / (T)tr.bottom;
1145 return trReturn;
1146 }
1147
1148 TRect<T> operator/(const TRect<double>& tr)
1149 {
1150 TRect<T> trReturn;
1151 trReturn.left = left / (T)tr.left;
1152 trReturn.top = top / (T)tr.top;
1153 trReturn.right = right / (T)tr.right;
1154 trReturn.bottom = bottom / (T)tr.bottom;
1155 return trReturn;
1156 }
1157
1158 friend TRect<T> operator+(int32_t value, const TRect<T>& tr)
1159 {
1160 return TRect<T>((T)value + tr.left, (T)value + tr.top, (T)value + tr.right, (T)value + tr.bottom);
1161 }
1162 friend TRect<T> operator+(int64_t value, const TRect<T>& tr)
1163 {
1164 return TRect<T>((T)value + tr.left, (T)value + tr.top, (T)value + tr.right, (T)value + tr.bottom);
1165 }
1166 friend TRect<T> operator+(float value, const TRect<T>& tr)
1167 {
1168 return TRect<T>((T)value + tr.left, (T)value + tr.top, (T)value + tr.right, (T)value + tr.bottom);
1169 }
1170 friend TRect<T> operator+(double value, const TRect<T>& tr)
1171 {
1172 return TRect<T>((T)value + tr.left, (T)value + tr.top, (T)value + tr.right, (T)value + tr.bottom);
1173 }
1174
1175 friend TRect<T> operator-(int32_t value, const TRect<T>& tr)
1176 {
1177 return TRect<T>((T)value - tr.left, (T)value - tr.top, (T)value - tr.right, (T)value - tr.bottom);
1178 }
1179 friend TRect<T> operator-(int64_t value, const TRect<T>& tr)
1180 {
1181 return TRect<T>((T)value - tr.left, (T)value - tr.top, (T)value - tr.right, (T)value - tr.bottom);
1182 }
1183 friend TRect<T> operator-(float value, const TRect<T>& tr)
1184 {
1185 return TRect<T>((T)value - tr.left, (T)value - tr.top, (T)value - tr.right, (T)value - tr.bottom);
1186 }
1187 friend TRect<T> operator-(double value, const TRect<T>& tr)
1188 {
1189 return TRect<T>((T)value - tr.left, (T)value - tr.top, (T)value - tr.right, (T)value - tr.bottom);
1190 }
1191
1192 friend TRect<T> operator*(int32_t value, const TRect<T>& tr)
1193 {
1194 return TRect<T>((T)value * tr.left, (T)value * tr.top, (T)value * tr.right, (T)value * tr.bottom);
1195 }
1196 friend TRect<T> operator*(int64_t value, const TRect<T>& tr)
1197 {
1198 return TRect<T>((T)value * tr.left, (T)value * tr.top, (T)value * tr.right, (T)value * tr.bottom);
1199 }
1200 friend TRect<T> operator*(float value, const TRect<T>& tr)
1201 {
1202 return TRect<T>((T)value * tr.left, (T)value * tr.top, (T)value * tr.right, (T)value * tr.bottom);
1203 }
1204 friend TRect<T> operator*(double value, const TRect<T>& tr)
1205 {
1206 return TRect<T>((T)value * tr.left, (T)value * tr.top, (T)value * tr.right, (T)value * tr.bottom);
1207 }
1208
1209 friend TRect<T> operator/(int32_t value, const TRect<T>& tr)
1210 {
1211 return TRect<T>((T)value / tr.left, (T)value / tr.top, (T)value / tr.right, (T)value / tr.bottom);
1212 }
1213 friend TRect<T> operator/(int64_t value, const TRect<T>& tr)
1214 {
1215 return TRect<T>((T)value / tr.left, (T)value / tr.top, (T)value / tr.right, (T)value / tr.bottom);
1216 }
1217 friend TRect<T> operator/(float value, const TRect<T>& tr)
1218 {
1219 return TRect<T>((T)value / tr.left, (T)value / tr.top, (T)value / tr.right, (T)value / tr.bottom);
1220 }
1221 friend TRect<T> operator/(double value, const TRect<T>& tr)
1222 {
1223 return TRect<T>((T)value / tr.left, (T)value / tr.top, (T)value / tr.right, (T)value / tr.bottom);
1224 }
1225 };
1226 #pragma pack(pop)
1227
1228 typedef TRect<int8_t> TRectC;
1229 typedef TRect<uint8_t> TRectUC;
1230 typedef TRect<int16_t> TRectS;
1231 typedef TRect<uint16_t> TRectUS;
1232 typedef TRect<int32_t> TRectL;
1233 typedef TRect<uint32_t> TRectUL;
1234 typedef TRect<int64_t> TRectLL;
1235 typedef TRect<uint64_t> TRectULL;
1236 typedef TRect<float> TRectF;
1237 typedef TRect<double> TRectD;
1238 }
1239}
Simplified class representing a rectangle.
Definition TRect.h:37