Mercurial > hg > orthanc-stone
comparison Applications/Samples/SingleFrameEditorApplication.h @ 392:d87fe075d31b
to graveyard
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 09 Nov 2018 17:59:35 +0100 |
parents | d20d75f20c5d |
children | e7a494bdd956 |
comparison
equal
deleted
inserted
replaced
391:021480604c92 | 392:d87fe075d31b |
---|---|
45 #include <boost/math/special_functions/round.hpp> | 45 #include <boost/math/special_functions/round.hpp> |
46 | 46 |
47 | 47 |
48 namespace OrthancStone | 48 namespace OrthancStone |
49 { | 49 { |
50 static Matrix CreateOffsetMatrix(double dx, | |
51 double dy) | |
52 { | |
53 Matrix m = LinearAlgebra::IdentityMatrix(3); | |
54 m(0, 2) = dx; | |
55 m(1, 2) = dy; | |
56 return m; | |
57 } | |
58 | |
59 | |
60 static Matrix CreateScalingMatrix(double sx, | |
61 double sy) | |
62 { | |
63 Matrix m = LinearAlgebra::IdentityMatrix(3); | |
64 m(0, 0) = sx; | |
65 m(1, 1) = sy; | |
66 return m; | |
67 } | |
68 | |
69 | |
70 static Matrix CreateRotationMatrix(double angle) | |
71 { | |
72 Matrix m; | |
73 const double v[] = { cos(angle), -sin(angle), 0, | |
74 sin(angle), cos(angle), 0, | |
75 0, 0, 1 }; | |
76 LinearAlgebra::FillMatrix(m, 3, 3, v); | |
77 return m; | |
78 } | |
79 | |
80 | |
81 class BitmapStack : | 50 class BitmapStack : |
82 public IObserver, | 51 public IObserver, |
83 public IObservable | 52 public IObservable |
84 { | 53 { |
85 public: | 54 public: |
833 }; | 802 }; |
834 | 803 |
835 | 804 |
836 | 805 |
837 private: | 806 private: |
807 static Matrix CreateOffsetMatrix(double dx, | |
808 double dy) | |
809 { | |
810 Matrix m = LinearAlgebra::IdentityMatrix(3); | |
811 m(0, 2) = dx; | |
812 m(1, 2) = dy; | |
813 return m; | |
814 } | |
815 | |
816 | |
817 static Matrix CreateScalingMatrix(double sx, | |
818 double sy) | |
819 { | |
820 Matrix m = LinearAlgebra::IdentityMatrix(3); | |
821 m(0, 0) = sx; | |
822 m(1, 1) = sy; | |
823 return m; | |
824 } | |
825 | |
826 | |
827 static Matrix CreateRotationMatrix(double angle) | |
828 { | |
829 Matrix m; | |
830 const double v[] = { cos(angle), -sin(angle), 0, | |
831 sin(angle), cos(angle), 0, | |
832 0, 0, 1 }; | |
833 LinearAlgebra::FillMatrix(m, 3, 3, v); | |
834 return m; | |
835 } | |
836 | |
837 | |
838 class DicomBitmap : public Bitmap | 838 class DicomBitmap : public Bitmap |
839 { | 839 { |
840 private: | 840 private: |
841 std::auto_ptr<Orthanc::ImageAccessor> source_; // Content of PixelData | 841 std::auto_ptr<Orthanc::ImageAccessor> source_; // Content of PixelData |
842 std::auto_ptr<DicomFrameConverter> converter_; | 842 std::auto_ptr<DicomFrameConverter> converter_; |