FLImaging 6.5.8.1
TPoint.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 TPoint
37 {
38 public:
39 T x;
40 T y;
41
42
43 TPoint()
44 {
45 }
46
47 TPoint(const TPoint<int8_t>& tp) : x((T)tp.x), y((T)tp.y)
48 {
49 }
50
51 TPoint(const TPoint<int8_t>* pTp) : x((T)pTp->x), y((T)pTp->y)
52 {
53 }
54
55 TPoint(const TPoint<uint8_t>& tp) : x((T)tp.x), y((T)tp.y)
56 {
57 }
58
59 TPoint(const TPoint<uint8_t>* pTp) : x((T)pTp->x), y((T)pTp->y)
60 {
61 }
62
63 TPoint(const TPoint<int16_t>& tp) : x((T)tp.x), y((T)tp.y)
64 {
65 }
66
67 TPoint(const TPoint<int16_t>* pTp) : x((T)pTp->x), y((T)pTp->y)
68 {
69 }
70
71 TPoint(const TPoint<uint16_t>& tp) : x((T)tp.x), y((T)tp.y)
72 {
73 }
74
75 TPoint(const TPoint<uint16_t>* pTp) : x((T)pTp->x), y((T)pTp->y)
76 {
77 }
78
79 TPoint(const TPoint<int32_t>& tp) : x((T)tp.x), y((T)tp.y)
80 {
81 }
82
83 TPoint(const TPoint<int32_t>* pTp) : x((T)pTp->x), y((T)pTp->y)
84 {
85 }
86
87 TPoint(const TPoint<uint32_t>& tp) : x((T)tp.x), y((T)tp.y)
88 {
89 }
90
91 TPoint(const TPoint<uint32_t>* pTp) : x((T)pTp->x), y((T)pTp->y)
92 {
93 }
94
95 TPoint(const TPoint<int64_t>& tp) : x((T)tp.x), y((T)tp.y)
96 {
97 }
98
99 TPoint(const TPoint<int64_t>* pTp) : x((T)pTp->x), y((T)pTp->y)
100 {
101 }
102
103 TPoint(const TPoint<uint64_t>& tp) : x((T)tp.x), y((T)tp.y)
104 {
105 }
106
107 TPoint(const TPoint<uint64_t>* pTp) : x((T)pTp->x), y((T)pTp->y)
108 {
109 }
110
111 TPoint(const TPoint<float>& tp) : x((T)tp.x), y((T)tp.y)
112 {
113 }
114
115 TPoint(const TPoint<float>* pTp) : x((T)pTp->x), y((T)pTp->y)
116 {
117 }
118
119 TPoint(const TPoint<double>& tp) : x((T)tp.x), y((T)tp.y)
120 {
121 }
122
123 TPoint(const TPoint<double>* pTp) : x((T)pTp->x), y((T)pTp->y)
124 {
125 }
126
127
128 TPoint(int8_t x, int8_t y) : x((T)x), y((T)y)
129 {
130 }
131
132 TPoint(uint8_t x, uint8_t y) : x((T)x), y((T)y)
133 {
134 }
135
136 TPoint(int16_t x, int16_t y) : x((T)x), y((T)y)
137 {
138 }
139
140 TPoint(uint16_t x, uint16_t y) : x((T)x), y((T)y)
141 {
142 }
143
144 TPoint(int32_t x, int32_t y) : x((T)x), y((T)y)
145 {
146 }
147
148 TPoint(uint32_t x, uint32_t y) : x((T)x), y((T)y)
149 {
150 }
151
152 TPoint(int64_t x, int64_t y) : x((T)x), y((T)y)
153 {
154 }
155
156 TPoint(uint64_t x, uint64_t y) : x((T)x), y((T)y)
157 {
158 }
159
160 TPoint(float x, float y) : x((T)x), y((T)y)
161 {
162 }
163
164 TPoint(double x, double y) : x((T)x), y((T)y)
165 {
166 }
167
168 void Set(const TPoint<int8_t>& tp)
169 {
170 x = (T)tp.x;
171 y = (T)tp.y;
172 }
173
174 void Set(const TPoint<int8_t>* pTp)
175 {
176 x = (T)pTp->x;
177 y = (T)pTp->y;
178 }
179
180 void Set(const TPoint<uint8_t>& tp)
181 {
182 x = (T)tp.x;
183 y = (T)tp.y;
184 }
185
186 void Set(const TPoint<uint8_t>* pTp)
187 {
188 x = (T)pTp->x;
189 y = (T)pTp->y;
190 }
191
192 void Set(const TPoint<int16_t>& tp)
193 {
194 x = (T)tp.x;
195 y = (T)tp.y;
196 }
197
198 void Set(const TPoint<int16_t>* pTp)
199 {
200 x = (T)pTp->x;
201 y = (T)pTp->y;
202 }
203
204 void Set(const TPoint<uint16_t>& tp)
205 {
206 x = (T)tp.x;
207 y = (T)tp.y;
208 }
209
210 void Set(const TPoint<uint16_t>* pTp)
211 {
212 x = (T)pTp->x;
213 y = (T)pTp->y;
214 }
215
216 void Set(const TPoint<int32_t>& tp)
217 {
218 x = (T)tp.x;
219 y = (T)tp.y;
220 }
221
222 void Set(const TPoint<int32_t>* pTp)
223 {
224 x = (T)pTp->x;
225 y = (T)pTp->y;
226 }
227
228 void Set(const TPoint<uint32_t>& tp)
229 {
230 x = (T)tp.x;
231 y = (T)tp.y;
232 }
233
234 void Set(const TPoint<uint32_t>* pTp)
235 {
236 x = (T)pTp->x;
237 y = (T)pTp->y;
238 }
239
240 void Set(const TPoint<int64_t>& tp)
241 {
242 x = (T)tp.x;
243 y = (T)tp.y;
244 }
245
246 void Set(const TPoint<int64_t>* pTp)
247 {
248 x = (T)pTp->x;
249 y = (T)pTp->y;
250 }
251
252 void Set(const TPoint<uint64_t>& tp)
253 {
254 x = (T)tp.x;
255 y = (T)tp.y;
256 }
257
258 void Set(const TPoint<uint64_t>* pTp)
259 {
260 x = (T)pTp->x;
261 y = (T)pTp->y;
262 }
263
264 void Set(const TPoint<float>& tp)
265 {
266 x = (T)tp.x;
267 y = (T)tp.y;
268 }
269
270 void Set(const TPoint<float>* pTp)
271 {
272 x = (T)pTp->x;
273 y = (T)pTp->y;
274 }
275
276 void Set(const TPoint<double>& tp)
277 {
278 x = (T)tp.x;
279 y = (T)tp.y;
280 }
281
282 void Set(const TPoint<double>* pTp)
283 {
284 x = (T)pTp->x;
285 y = (T)pTp->y;
286 }
287
288 void Set(int8_t x, int8_t y)
289 {
290 this->x = (T)x;
291 this->y = (T)y;
292 }
293
294 void Set(uint8_t x, uint8_t y)
295 {
296 this->x = (T)x;
297 this->y = (T)y;
298 }
299
300 void Set(int16_t x, int16_t y)
301 {
302 this->x = (T)x;
303 this->y = (T)y;
304 }
305
306 void Set(uint16_t x, uint16_t y)
307 {
308 this->x = (T)x;
309 this->y = (T)y;
310 }
311
312 void Set(int32_t x, int32_t y)
313 {
314 this->x = (T)x;
315 this->y = (T)y;
316 }
317
318 void Set(uint32_t x, uint32_t y)
319 {
320 this->x = (T)x;
321 this->y = (T)y;
322 }
323
324 void Set(int64_t x, int64_t y)
325 {
326 this->x = (T)x;
327 this->y = (T)y;
328 }
329
330 void Set(uint64_t x, uint64_t y)
331 {
332 this->x = (T)x;
333 this->y = (T)y;
334 }
335
336 void Set(float x, float y)
337 {
338 this->x = (T)x;
339 this->y = (T)y;
340 }
341
342 void Set(double x, double y)
343 {
344 this->x = (T)x;
345 this->y = (T)y;
346 }
347
348 const TPoint<T>& operator=(int32_t value)
349 {
350 x = y = (T)value;
351
352 return *this;
353 }
354
355 const TPoint<T>& operator=(int64_t value)
356 {
357 x = y = (T)value;
358
359 return *this;
360 }
361
362 const TPoint<T>& operator=(float value)
363 {
364 x = y = (T)value;
365
366 return *this;
367 }
368
369 const TPoint<T>& operator=(double value)
370 {
371 x = y = (T)value;
372
373 return *this;
374 }
375
376 const TPoint<T>& operator=(const TPoint<int32_t>& tp)
377 {
378 x = (T)tp.x;
379 y = (T)tp.y;
380
381 return *this;
382 }
383
384 const TPoint<T>& operator=(const TPoint<int64_t>& tp)
385 {
386 x = (T)tp.x;
387 y = (T)tp.y;
388
389 return *this;
390 }
391
392 const TPoint<T>& operator=(const TPoint<float>& tp)
393 {
394 x = (T)tp.x;
395 y = (T)tp.y;
396
397 return *this;
398 }
399
400 const TPoint<T>& operator=(const TPoint<double>& tp)
401 {
402 x = (T)tp.x;
403 y = (T)tp.y;
404
405 return *this;
406 }
407
408 bool operator==(const TPoint<int32_t>& tp) const
409 {
410 return x == (T)tp.x && y == (T)tp.y;
411 }
412
413 bool operator==(const TPoint<int64_t>& tp) const
414 {
415 return x == (T)tp.x && y == (T)tp.y;
416 }
417
418 bool operator==(const TPoint<float>& tp) const
419 {
420 return x == (T)tp.x && y == (T)tp.y;
421 }
422
423 bool operator==(const TPoint<double>& tp) const
424 {
425 return x == (T)tp.x && y == (T)tp.y;
426 }
427
428 bool operator!=(const TPoint<int32_t>& tp) const
429 {
430 return x != (T)tp.x || y != (T)tp.y;
431 }
432
433 bool operator!=(const TPoint<int64_t>& tp) const
434 {
435 return x != (T)tp.x || y != (T)tp.y;
436 }
437
438 bool operator!=(const TPoint<float>& tp) const
439 {
440 return x != (T)tp.x || y != (T)tp.y;
441 }
442
443 bool operator!=(const TPoint<double>& tp) const
444 {
445 return x != (T)tp.x || y != (T)tp.y;
446 }
447
448 const TPoint<T>& operator+=(int32_t value)
449 {
450 x += (T)value;
451 y += (T)value;
452
453 return *this;
454 }
455
456 const TPoint<T>& operator+=(int64_t value)
457 {
458 x += (T)value;
459 y += (T)value;
460
461 return *this;
462 }
463
464 const TPoint<T>& operator+=(float value)
465 {
466 x += (T)value;
467 y += (T)value;
468
469 return *this;
470 }
471
472 const TPoint<T>& operator+=(double value)
473 {
474 x += (T)value;
475 y += (T)value;
476
477 return *this;
478 }
479
480 const TPoint<T>& operator+=(const TPoint<int32_t>& tp)
481 {
482 x += (T)tp.x;
483 y += (T)tp.y;
484
485 return *this;
486 }
487
488 const TPoint<T>& operator+=(const TPoint<int64_t>& tp)
489 {
490 x += (T)tp.x;
491 y += (T)tp.y;
492
493 return *this;
494 }
495
496 const TPoint<T>& operator+=(const TPoint<float>& tp)
497 {
498 x += (T)tp.x;
499 y += (T)tp.y;
500
501 return *this;
502 }
503
504 const TPoint<T>& operator+=(const TPoint<double>& tp)
505 {
506 x += (T)tp.x;
507 y += (T)tp.y;
508
509 return *this;
510 }
511
512 const TPoint<T>& operator-=(int32_t value)
513 {
514 x -= (T)value;
515 y -= (T)value;
516
517 return *this;
518 }
519
520 const TPoint<T>& operator-=(int64_t value)
521 {
522 x -= (T)value;
523 y -= (T)value;
524
525 return *this;
526 }
527
528 const TPoint<T>& operator-=(float value)
529 {
530 x -= (T)value;
531 y -= (T)value;
532
533 return *this;
534 }
535
536 const TPoint<T>& operator-=(double value)
537 {
538 x -= (T)value;
539 y -= (T)value;
540
541 return *this;
542 }
543
544 const TPoint<T>& operator-=(const TPoint<int32_t>& tp)
545 {
546 x -= (T)tp.x;
547 y -= (T)tp.y;
548
549 return *this;
550 }
551
552 const TPoint<T>& operator-=(const TPoint<int64_t>& tp)
553 {
554 x -= (T)tp.x;
555 y -= (T)tp.y;
556
557 return *this;
558 }
559
560 const TPoint<T>& operator-=(const TPoint<float>& tp)
561 {
562 x -= (T)tp.x;
563 y -= (T)tp.y;
564
565 return *this;
566 }
567
568 const TPoint<T>& operator-=(const TPoint<double>& tp)
569 {
570 x -= (T)tp.x;
571 y -= (T)tp.y;
572
573 return *this;
574 }
575
576 const TPoint<T>& operator*=(int32_t value)
577 {
578 x *= (T)value;
579 y *= (T)value;
580
581 return *this;
582 }
583
584 const TPoint<T>& operator*=(int64_t value)
585 {
586 x *= (T)value;
587 y *= (T)value;
588
589 return *this;
590 }
591
592 const TPoint<T>& operator*=(float value)
593 {
594 x *= (T)value;
595 y *= (T)value;
596
597 return *this;
598 }
599
600 const TPoint<T>& operator*=(double value)
601 {
602 x *= (T)value;
603 y *= (T)value;
604
605 return *this;
606 }
607
608 const TPoint<T>& operator*=(const TPoint<int32_t>& tp)
609 {
610 x *= (T)tp.x;
611 y *= (T)tp.y;
612
613 return *this;
614 }
615
616 const TPoint<T>& operator*=(const TPoint<int64_t>& tp)
617 {
618 x *= (T)tp.x;
619 y *= (T)tp.y;
620
621 return *this;
622 }
623
624 const TPoint<T>& operator*=(const TPoint<float>& tp)
625 {
626 x *= (T)tp.x;
627 y *= (T)tp.y;
628
629 return *this;
630 }
631
632 const TPoint<T>& operator*=(const TPoint<double>& tp)
633 {
634 x *= (T)tp.x;
635 y *= (T)tp.y;
636
637 return *this;
638 }
639
640 const TPoint<T>& operator/=(int32_t value)
641 {
642 x /= (T)value;
643 y /= (T)value;
644
645 return *this;
646 }
647
648 const TPoint<T>& operator/=(int64_t value)
649 {
650 x /= (T)value;
651 y /= (T)value;
652
653 return *this;
654 }
655
656 const TPoint<T>& operator/=(float value)
657 {
658 x /= (T)value;
659 y /= (T)value;
660
661 return *this;
662 }
663
664 const TPoint<T>& operator/=(double value)
665 {
666 x /= (T)value;
667 y /= (T)value;
668
669 return *this;
670 }
671
672 const TPoint<T>& operator/=(const TPoint<int32_t>& tp)
673 {
674 x /= (T)tp.x;
675 y /= (T)tp.y;
676
677 return *this;
678 }
679
680 const TPoint<T>& operator/=(const TPoint<int64_t>& tp)
681 {
682 x /= (T)tp.x;
683 y /= (T)tp.y;
684
685 return *this;
686 }
687
688 const TPoint<T>& operator/=(const TPoint<float>& tp)
689 {
690 x /= (T)tp.x;
691 y /= (T)tp.y;
692
693 return *this;
694 }
695
696 const TPoint<T>& operator/=(const TPoint<double>& tp)
697 {
698 x /= (T)tp.x;
699 y /= (T)tp.y;
700
701 return *this;
702 }
703
704 TPoint<T> operator+(int32_t value) const
705 {
706 TPoint<T> tpReturn;
707 tpReturn.x = x + (T)value;
708 tpReturn.y = y + (T)value;
709 return tpReturn;
710 }
711
712 TPoint<T> operator+(int64_t value) const
713 {
714 TPoint<T> tpReturn;
715 tpReturn.x = x + (T)value;
716 tpReturn.y = y + (T)value;
717 return tpReturn;
718 }
719
720 TPoint<T> operator+(float value) const
721 {
722 TPoint<T> tpReturn;
723 tpReturn.x = x + (T)value;
724 tpReturn.y = y + (T)value;
725 return tpReturn;
726 }
727
728 TPoint<T> operator+(double value) const
729 {
730 TPoint<T> tpReturn;
731 tpReturn.x = x + (T)value;
732 tpReturn.y = y + (T)value;
733 return tpReturn;
734 }
735
736 TPoint<T> operator+(const TPoint<int32_t>& tp) const
737 {
738 TPoint<T> tpReturn;
739 tpReturn.x = x + (T)tp.x;
740 tpReturn.y = y + (T)tp.y;
741 return tpReturn;
742 }
743
744 TPoint<T> operator+(const TPoint<int64_t>& tp) const
745 {
746 TPoint<T> tpReturn;
747 tpReturn.x = x + (T)tp.x;
748 tpReturn.y = y + (T)tp.y;
749 return tpReturn;
750 }
751
752 TPoint<T> operator+(const TPoint<float>& tp) const
753 {
754 TPoint<T> tpReturn;
755 tpReturn.x = x + (T)tp.x;
756 tpReturn.y = y + (T)tp.y;
757 return tpReturn;
758 }
759
760 TPoint<T> operator+(const TPoint<double>& tp) const
761 {
762 TPoint<T> tpReturn;
763 tpReturn.x = x + (T)tp.x;
764 tpReturn.y = y + (T)tp.y;
765 return tpReturn;
766 }
767
768 TPoint<T> operator-(int32_t value) const
769 {
770 TPoint<T> tpReturn;
771 tpReturn.x = x - (T)value;
772 tpReturn.y = y - (T)value;
773 return tpReturn;
774 }
775
776 TPoint<T> operator-(int64_t value) const
777 {
778 TPoint<T> tpReturn;
779 tpReturn.x = x - (T)value;
780 tpReturn.y = y - (T)value;
781 return tpReturn;
782 }
783
784 TPoint<T> operator-(float value) const
785 {
786 TPoint<T> tpReturn;
787 tpReturn.x = x - (T)value;
788 tpReturn.y = y - (T)value;
789 return tpReturn;
790 }
791
792 TPoint<T> operator-(double value) const
793 {
794 TPoint<T> tpReturn;
795 tpReturn.x = x - (T)value;
796 tpReturn.y = y - (T)value;
797 return tpReturn;
798 }
799
800 TPoint<T> operator-(const TPoint<int32_t>& tp) const
801 {
802 TPoint<T> tpReturn;
803 tpReturn.x = x - (T)tp.x;
804 tpReturn.y = y - (T)tp.y;
805 return tpReturn;
806 }
807
808 TPoint<T> operator-(const TPoint<int64_t>& tp) const
809 {
810 TPoint<T> tpReturn;
811 tpReturn.x = x - (T)tp.x;
812 tpReturn.y = y - (T)tp.y;
813 return tpReturn;
814 }
815
816 TPoint<T> operator-(const TPoint<float>& tp) const
817 {
818 TPoint<T> tpReturn;
819 tpReturn.x = x - (T)tp.x;
820 tpReturn.y = y - (T)tp.y;
821 return tpReturn;
822 }
823
824 TPoint<T> operator-(const TPoint<double>& tp) const
825 {
826 TPoint<T> tpReturn;
827 tpReturn.x = x - (T)tp.x;
828 tpReturn.y = y - (T)tp.y;
829 return tpReturn;
830 }
831
832 TPoint<T> operator*(int32_t value) const
833 {
834 TPoint<T> tpReturn;
835 tpReturn.x = x * (T)value;
836 tpReturn.y = y * (T)value;
837 return tpReturn;
838 }
839
840 TPoint<T> operator*(int64_t value) const
841 {
842 TPoint<T> tpReturn;
843 tpReturn.x = x * (T)value;
844 tpReturn.y = y * (T)value;
845 return tpReturn;
846 }
847
848 TPoint<T> operator*(float value) const
849 {
850 TPoint<T> tpReturn;
851 tpReturn.x = x * (T)value;
852 tpReturn.y = y * (T)value;
853 return tpReturn;
854 }
855
856 TPoint<T> operator*(double value) const
857 {
858 TPoint<T> tpReturn;
859 tpReturn.x = x * (T)value;
860 tpReturn.y = y * (T)value;
861 return tpReturn;
862 }
863
864 TPoint<T> operator*(const TPoint<int32_t>& tp) const
865 {
866 TPoint<T> tpReturn;
867 tpReturn.x = x * (T)tp.x;
868 tpReturn.y = y * (T)tp.y;
869 return tpReturn;
870 }
871
872 TPoint<T> operator*(const TPoint<int64_t>& tp) const
873 {
874 TPoint<T> tpReturn;
875 tpReturn.x = x * (T)tp.x;
876 tpReturn.y = y * (T)tp.y;
877 return tpReturn;
878 }
879
880 TPoint<T> operator*(const TPoint<float>& tp) const
881 {
882 TPoint<T> tpReturn;
883 tpReturn.x = x * (T)tp.x;
884 tpReturn.y = y * (T)tp.y;
885 return tpReturn;
886 }
887
888 TPoint<T> operator*(const TPoint<double>& tp) const
889 {
890 TPoint<T> tpReturn;
891 tpReturn.x = x * (T)tp.x;
892 tpReturn.y = y * (T)tp.y;
893 return tpReturn;
894 }
895
896 TPoint<T> operator/(int32_t value) const
897 {
898 TPoint<T> tpReturn;
899 tpReturn.x = x / (T)value;
900 tpReturn.y = y / (T)value;
901 return tpReturn;
902 }
903
904 TPoint<T> operator/(int64_t value) const
905 {
906 TPoint<T> tpReturn;
907 tpReturn.x = x / (T)value;
908 tpReturn.y = y / (T)value;
909 return tpReturn;
910 }
911
912 TPoint<T> operator/(float value) const
913 {
914 TPoint<T> tpReturn;
915 tpReturn.x = x / (T)value;
916 tpReturn.y = y / (T)value;
917 return tpReturn;
918 }
919
920 TPoint<T> operator/(double value) const
921 {
922 TPoint<T> tpReturn;
923 tpReturn.x = x / (T)value;
924 tpReturn.y = y / (T)value;
925 return tpReturn;
926 }
927
928 TPoint<T> operator/(const TPoint<int32_t>& tp) const
929 {
930 TPoint<T> tpReturn;
931 tpReturn.x = x / (T)tp.x;
932 tpReturn.y = y / (T)tp.y;
933 return tpReturn;
934 }
935
936 TPoint<T> operator/(const TPoint<int64_t>& tp) const
937 {
938 TPoint<T> tpReturn;
939 tpReturn.x = x / (T)tp.x;
940 tpReturn.y = y / (T)tp.y;
941 return tpReturn;
942 }
943
944 TPoint<T> operator/(const TPoint<float>& tp) const
945 {
946 TPoint<T> tpReturn;
947 tpReturn.x = x / (T)tp.x;
948 tpReturn.y = y / (T)tp.y;
949 return tpReturn;
950 }
951
952 TPoint<T> operator/(const TPoint<double>& tp) const
953 {
954 TPoint<T> tpReturn;
955 tpReturn.x = x / (T)tp.x;
956 tpReturn.y = y / (T)tp.y;
957 return tpReturn;
958 }
959
960 friend TPoint<T> operator+(int32_t value, const TPoint<T>& tp)
961 {
962 return TPoint<T>((T)value + tp.x, (T)value + tp.y);
963 }
964 friend TPoint<T> operator+(int64_t value, const TPoint<T>& tp)
965 {
966 return TPoint<T>((T)value + tp.x, (T)value + tp.y);
967 }
968 friend TPoint<T> operator+(float value, const TPoint<T>& tp)
969 {
970 return TPoint<T>((T)value + tp.x, (T)value + tp.y);
971 }
972 friend TPoint<T> operator+(double value, const TPoint<T>& tp)
973 {
974 return TPoint<T>((T)value + tp.x, (T)value + tp.y);
975 }
976
977 friend TPoint<T> operator-(int32_t value, const TPoint<T>& tp)
978 {
979 return TPoint<T>((T)value - tp.x, (T)value - tp.y);
980 }
981 friend TPoint<T> operator-(int64_t value, const TPoint<T>& tp)
982 {
983 return TPoint<T>((T)value - tp.x, (T)value - tp.y);
984 }
985 friend TPoint<T> operator-(float value, const TPoint<T>& tp)
986 {
987 return TPoint<T>((T)value - tp.x, (T)value - tp.y);
988 }
989 friend TPoint<T> operator-(double value, const TPoint<T>& tp)
990 {
991 return TPoint<T>((T)value - tp.x, (T)value - tp.y);
992 }
993
994 friend TPoint<T> operator*(int32_t value, const TPoint<T>& tp)
995 {
996 return TPoint<T>((T)value * tp.x, (T)value * tp.y);
997 }
998 friend TPoint<T> operator*(int64_t value, const TPoint<T>& tp)
999 {
1000 return TPoint<T>((T)value * tp.x, (T)value * tp.y);
1001 }
1002 friend TPoint<T> operator*(float value, const TPoint<T>& tp)
1003 {
1004 return TPoint<T>((T)value * tp.x, (T)value * tp.y);
1005 }
1006 friend TPoint<T> operator*(double value, const TPoint<T>& tp)
1007 {
1008 return TPoint<T>((T)value * tp.x, (T)value * tp.y);
1009 }
1010
1011 friend TPoint<T> operator/(int32_t value, const TPoint<T>& tp)
1012 {
1013 return TPoint<T>((T)value / tp.x, (T)value / tp.y);
1014 }
1015 friend TPoint<T> operator/(int64_t value, const TPoint<T>& tp)
1016 {
1017 return TPoint<T>((T)value / tp.x, (T)value / tp.y);
1018 }
1019 friend TPoint<T> operator/(float value, const TPoint<T>& tp)
1020 {
1021 return TPoint<T>((T)value / tp.x, (T)value / tp.y);
1022 }
1023 friend TPoint<T> operator/(double value, const TPoint<T>& tp)
1024 {
1025 return TPoint<T>((T)value / tp.x, (T)value / tp.y);
1026 }
1027 };
1028 #pragma pack(pop)
1029
1030 typedef TPoint<int8_t> TPointC;
1031 typedef TPoint<uint8_t> TPointUC;
1032 typedef TPoint<int16_t> TPointS;
1033 typedef TPoint<uint16_t> TPointUS;
1034 typedef TPoint<int32_t> TPointL;
1035 typedef TPoint<uint32_t> TPointUL;
1036 typedef TPoint<int64_t> TPointLL;
1038 typedef TPoint<float> TPointF;
1039 typedef TPoint<double> TPointD;
1040 }
1041}
점을 표현하는 간략화된 클래스
Definition TPoint.h:37