pyfast 4.12.0__cp36-abi3-macosx_11_0_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fast/README.md +41 -0
- fast/__init__.py +22 -0
- fast/bin/UFFviewer +0 -0
- fast/bin/fast_configuration.txt +14 -0
- fast/bin/runPipeline +0 -0
- fast/bin/systemCheck +0 -0
- fast/doc/bright-plotting-style.ini +66 -0
- fast/doc/dark-plotting-style.ini +66 -0
- fast/doc/fonts/UFL.txt +96 -0
- fast/doc/fonts/Ubuntu-Bold.ttf +0 -0
- fast/doc/fonts/Ubuntu-BoldItalic.ttf +0 -0
- fast/doc/fonts/Ubuntu-Italic.ttf +0 -0
- fast/doc/fonts/Ubuntu-Light.ttf +0 -0
- fast/doc/fonts/Ubuntu-LightItalic.ttf +0 -0
- fast/doc/fonts/Ubuntu-Medium.ttf +0 -0
- fast/doc/fonts/Ubuntu-MediumItalic.ttf +0 -0
- fast/doc/fonts/Ubuntu-Regular.ttf +0 -0
- fast/doc/fonts/UbuntuMono-Bold.ttf +0 -0
- fast/doc/fonts/UbuntuMono-BoldItalic.ttf +0 -0
- fast/doc/fonts/UbuntuMono-Italic.ttf +0 -0
- fast/doc/fonts/UbuntuMono-Regular.ttf +0 -0
- fast/doc/images/FAST_logo_square.png +0 -0
- fast/doc/images/fast_icon.ico +0 -0
- fast/doc/images/fast_icon.png +0 -0
- fast/entry_points.py +14 -0
- fast/fast.py +19833 -0
- fast/kernels/Algorithms/AirwaySegmentation/AirwaySegmentation.cl +85 -0
- fast/kernels/Algorithms/ApplyColormap/ApplyColormap.cl +146 -0
- fast/kernels/Algorithms/BinaryThresholding/BinaryThresholding2D.cl +61 -0
- fast/kernels/Algorithms/BinaryThresholding/BinaryThresholding3D.cl +61 -0
- fast/kernels/Algorithms/BlockMatching/BlockMatching.cl +257 -0
- fast/kernels/Algorithms/CenterlineExtraction/CenterlineExtraction.cl +153 -0
- fast/kernels/Algorithms/CoherentPointDrift/CoherentPointDrift.cl +0 -0
- fast/kernels/Algorithms/Color/ColorToGrayscale.cl +22 -0
- fast/kernels/Algorithms/Color/GrayscaleToColor.cl +19 -0
- fast/kernels/Algorithms/GaussianSmoothing/GaussianSmoothing2D.cl +35 -0
- fast/kernels/Algorithms/GaussianSmoothing/GaussianSmoothing3D.cl +75 -0
- fast/kernels/Algorithms/GradientVectorFlow/EulerGradientVectorFlow.cl +174 -0
- fast/kernels/Algorithms/GradientVectorFlow/MultigridGradientVectorFlow.cl +407 -0
- fast/kernels/Algorithms/HounsefieldConverter/HounsefieldConverter.cl +22 -0
- fast/kernels/Algorithms/ImageAdd/ImageAdd.cl +79 -0
- fast/kernels/Algorithms/ImageCaster/ImageCaster.cl +38 -0
- fast/kernels/Algorithms/ImageChannelConverter/ImageChannelConverter.cl +121 -0
- fast/kernels/Algorithms/ImageFlipper/ImageFlipper2D.cl +23 -0
- fast/kernels/Algorithms/ImageFlipper/ImageFlipper3D.cl +51 -0
- fast/kernels/Algorithms/ImageGradient/ImageGradient.cl +71 -0
- fast/kernels/Algorithms/ImageInverter/ImageInverter.cl +30 -0
- fast/kernels/Algorithms/ImageMultiply/ImageMultiply.cl +79 -0
- fast/kernels/Algorithms/ImagePatch/PatchStitcher2D.cl +22 -0
- fast/kernels/Algorithms/ImagePatch/PatchStitcher3D.cl +95 -0
- fast/kernels/Algorithms/ImageResampler/ImageResampler2D.cl +40 -0
- fast/kernels/Algorithms/ImageResampler/ImageResampler3D.cl +32 -0
- fast/kernels/Algorithms/ImageResizer/ImageResizer.cl +134 -0
- fast/kernels/Algorithms/ImageSharpening/ImageSharpening.cl +47 -0
- fast/kernels/Algorithms/ImageSlicer/ImageSlicer.cl +77 -0
- fast/kernels/Algorithms/ImageTransposer/ImageTransposer2D.cl +16 -0
- fast/kernels/Algorithms/ImageTransposer/ImageTransposer3D.cl +45 -0
- fast/kernels/Algorithms/IntensityClipping/IntensityClipping2D.cl +19 -0
- fast/kernels/Algorithms/IntensityClipping/IntensityClipping3D.cl +20 -0
- fast/kernels/Algorithms/IntensityNormalization/IntensityNormalization.cl +85 -0
- fast/kernels/Algorithms/IntensityNormalization/ZeroMeanUnitVariance.cl +76 -0
- fast/kernels/Algorithms/KalmanFilterModelSegmentation/AppearanceModels/RidgeEdge/RidgeEdgeModel.cl +81 -0
- fast/kernels/Algorithms/LabelModifier/LabelModifier.cl +20 -0
- fast/kernels/Algorithms/LaplacianOfGaussian/LaplacianOfGaussian2D.cl +27 -0
- fast/kernels/Algorithms/LevelSet/LevelSetSegmentation.cl +132 -0
- fast/kernels/Algorithms/LungSegmentation/LungSegmentation.cl +22 -0
- fast/kernels/Algorithms/MeshToSegmentation/MeshToSegmentation.cl +184 -0
- fast/kernels/Algorithms/Morphology/Dilation.cl +56 -0
- fast/kernels/Algorithms/Morphology/Erosion.cl +64 -0
- fast/kernels/Algorithms/NeuralNetwork/NeuralNetwork.cl +122 -0
- fast/kernels/Algorithms/NeuralNetwork/VertexTensorToSegmentation.cl +13 -0
- fast/kernels/Algorithms/NonLocalMeans/NonLocalMeans2D.cl +94 -0
- fast/kernels/Algorithms/SeededRegionGrowing/SeededRegionGrowing2D.cl +57 -0
- fast/kernels/Algorithms/SeededRegionGrowing/SeededRegionGrowing3D.cl +58 -0
- fast/kernels/Algorithms/Skeletonization/Skeletonization2D.cl +77 -0
- fast/kernels/Algorithms/SurfaceExtraction/SurfaceExtraction.cl +519 -0
- fast/kernels/Algorithms/SurfaceExtraction/SurfaceExtraction_no_3d_write.cl +739 -0
- fast/kernels/Algorithms/TemporalSmoothing/ImageMovingAverage.cl +66 -0
- fast/kernels/Algorithms/TemporalSmoothing/ImageWeightedMovingAverage.cl +74 -0
- fast/kernels/Algorithms/TissueSegmentation/TissueSegmentation.cl +18 -0
- fast/kernels/Algorithms/TubeSegmentationAndCenterlineExtraction/InverseGradientSegmentation.cl +203 -0
- fast/kernels/Algorithms/TubeSegmentationAndCenterlineExtraction/TubeSegmentationAndCenterlineExtraction.cl +566 -0
- fast/kernels/Algorithms/Ultrasound/EnvelopeAndLogCompressor.cl +45 -0
- fast/kernels/Algorithms/Ultrasound/ScanConverter.cl +76 -0
- fast/kernels/Algorithms/UltrasoundImageCropper/UltrasoundImageCropper.cl +31 -0
- fast/kernels/Algorithms/UltrasoundImageEnhancement/UltrasoundImageEnhancement.cl +27 -0
- fast/kernels/Algorithms/VectorMedianFilter/VectorMedianFilter.cl +31 -0
- fast/kernels/ImageFill.cl +30 -0
- fast/kernels/ImageMinMax.cl +196 -0
- fast/kernels/ImageSum.cl +170 -0
- fast/kernels/Tests/Algorithms/DoubleFilter.cl +7 -0
- fast/kernels/Visualization/BoundingBoxRenderer/BoundingBoxRenderer.frag +8 -0
- fast/kernels/Visualization/BoundingBoxRenderer/BoundingBoxRenderer.geom +69 -0
- fast/kernels/Visualization/BoundingBoxRenderer/BoundingBoxRenderer.vert +17 -0
- fast/kernels/Visualization/HeatmapRenderer/HeatmapRenderer.cl +51 -0
- fast/kernels/Visualization/ImagePyramidRenderer/ImagePyramidRenderer.frag +11 -0
- fast/kernels/Visualization/ImagePyramidRenderer/ImagePyramidRenderer.vert +15 -0
- fast/kernels/Visualization/ImageRenderer/ImageRenderer.vert +15 -0
- fast/kernels/Visualization/ImageRenderer/ImageRendererFLOAT.frag +18 -0
- fast/kernels/Visualization/ImageRenderer/ImageRendererINT.frag +18 -0
- fast/kernels/Visualization/ImageRenderer/ImageRendererUINT.frag +18 -0
- fast/kernels/Visualization/LineRenderer/LineRenderer.frag +8 -0
- fast/kernels/Visualization/LineRenderer/LineRenderer.geom +35 -0
- fast/kernels/Visualization/LineRenderer/LineRenderer.vert +20 -0
- fast/kernels/Visualization/LineRenderer/LineRenderer3D.frag +8 -0
- fast/kernels/Visualization/LineRenderer/LineRenderer3D.vert +20 -0
- fast/kernels/Visualization/LineRenderer/LineRendererJoints.frag +15 -0
- fast/kernels/Visualization/LineRenderer/LineRendererJoints.vert +24 -0
- fast/kernels/Visualization/SegmentationLabelRenderer/SegmentationLabelRenderer.frag +11 -0
- fast/kernels/Visualization/SegmentationLabelRenderer/SegmentationLabelRenderer.vert +16 -0
- fast/kernels/Visualization/SegmentationRenderer/SegmentationPyramidRenderer.frag +53 -0
- fast/kernels/Visualization/SegmentationRenderer/SegmentationRenderer.frag +52 -0
- fast/kernels/Visualization/SegmentationRenderer/SegmentationRenderer.vert +15 -0
- fast/kernels/Visualization/TextRenderer/TextRenderer.frag +11 -0
- fast/kernels/Visualization/TextRenderer/TextRenderer.vert +20 -0
- fast/kernels/Visualization/TriangleRenderer/TriangleRenderer.frag +49 -0
- fast/kernels/Visualization/TriangleRenderer/TriangleRenderer.vert +35 -0
- fast/kernels/Visualization/VectorFieldRenderer/VectorFieldColorRenderer.cl +30 -0
- fast/kernels/Visualization/VertexRenderer/VertexRenderer.frag +14 -0
- fast/kernels/Visualization/VertexRenderer/VertexRenderer.vert +23 -0
- fast/kernels/Visualization/View.cl +10 -0
- fast/kernels/Visualization/VolumeRenderer/AlphaBlendingVolumeRenderer.cl +211 -0
- fast/kernels/Visualization/VolumeRenderer/MaximumIntensityProjection.cl +139 -0
- fast/kernels/Visualization/VolumeRenderer/ThresholdVolumeRenderer.cl +178 -0
- fast/lib/_fast.abi3.so +0 -0
- fast/lib/libFAST.4.dylib +0 -0
- fast/lib/libInferenceEngineONNXRuntime.dylib +0 -0
- fast/lib/libJKQTCommonSharedLib_Release.4.0.0.dylib +0 -0
- fast/lib/libJKQTFastPlotterSharedLib_Release.4.0.0.dylib +0 -0
- fast/lib/libJKQTMathTextSharedLib_Release.4.0.0.dylib +0 -0
- fast/lib/libJKQTPlotterSharedLib_Release.4.0.0.dylib +0 -0
- fast/lib/libOpenIGTLink.3.dylib +0 -0
- fast/lib/libQt5Core.5.dylib +0 -0
- fast/lib/libQt5DBus.5.dylib +0 -0
- fast/lib/libQt5Gui.5.dylib +0 -0
- fast/lib/libQt5Multimedia.5.dylib +0 -0
- fast/lib/libQt5MultimediaWidgets.5.dylib +0 -0
- fast/lib/libQt5Network.5.dylib +0 -0
- fast/lib/libQt5OpenGL.5.dylib +0 -0
- fast/lib/libQt5PrintSupport.5.dylib +0 -0
- fast/lib/libQt5SerialPort.5.dylib +0 -0
- fast/lib/libQt5Svg.5.dylib +0 -0
- fast/lib/libQt5Widgets.5.dylib +0 -0
- fast/lib/libQt5Xml.5.dylib +0 -0
- fast/lib/libbrotlicommon.1.dylib +0 -0
- fast/lib/libbrotlidec.1.dylib +0 -0
- fast/lib/libbrotlienc.1.dylib +0 -0
- fast/lib/libdcmdata.17.dylib +0 -0
- fast/lib/libdcmimage.17.dylib +0 -0
- fast/lib/libdcmimgle.17.dylib +0 -0
- fast/lib/libdcmjpeg.17.dylib +0 -0
- fast/lib/libijg12.17.dylib +0 -0
- fast/lib/libijg12.dylib +0 -0
- fast/lib/libijg16.17.dylib +0 -0
- fast/lib/libijg16.dylib +0 -0
- fast/lib/libijg8.17.dylib +0 -0
- fast/lib/libijg8.dylib +0 -0
- fast/lib/libjxl.0.11.dylib +0 -0
- fast/lib/libjxl_cms.0.11.dylib +0 -0
- fast/lib/libjxl_threads.0.11.dylib +0 -0
- fast/lib/liboflog.17.dylib +0 -0
- fast/lib/libofstd.17.dylib +0 -0
- fast/lib/libonnxruntime.1.22.0.dylib +0 -0
- fast/lib/libonnxruntime.dylib +0 -0
- fast/lib/libopenslide.1.dylib +0 -0
- fast/lib/libz.1.dylib +0 -0
- fast/licenses/OpenIGTLink/LICENSE.txt +30 -0
- fast/licenses/OpenJPEG/LICENSE +39 -0
- fast/licenses/OpenSlide/COPYING.LESSER +504 -0
- fast/licenses/PCRE2/LICENCE.md +103 -0
- fast/licenses/cairo/COPYING +33 -0
- fast/licenses/cairo/COPYING-LGPL-2.1 +510 -0
- fast/licenses/cairo/COPYING-MPL-1.1 +470 -0
- fast/licenses/dcmtk/COPYRIGHT +1034 -0
- fast/licenses/eigen/COPYING.APACHE +203 -0
- fast/licenses/eigen/COPYING.BSD +26 -0
- fast/licenses/eigen/COPYING.GPL +674 -0
- fast/licenses/eigen/COPYING.LGPL +502 -0
- fast/licenses/eigen/COPYING.MINPACK +51 -0
- fast/licenses/eigen/COPYING.MPL2 +373 -0
- fast/licenses/eigen/COPYING.README +18 -0
- fast/licenses/fast/LICENSE +25 -0
- fast/licenses/gdk-pixbuf/COPYING +502 -0
- fast/licenses/glib/COPYING +175 -0
- fast/licenses/hdf5/COPYING +106 -0
- fast/licenses/jkqtplotter/LICENSE +505 -0
- fast/licenses/jpegxl/LICENSE.brotli +19 -0
- fast/licenses/jpegxl/LICENSE.highway +201 -0
- fast/licenses/jpegxl/LICENSE.jpeg-xl +27 -0
- fast/licenses/jpegxl/LICENSE.skcms +29 -0
- fast/licenses/jpegxl/PATENTS +22 -0
- fast/licenses/libdicom/LICENSE +21 -0
- fast/licenses/libjpeg-turbo/LICENSE.md +135 -0
- fast/licenses/libjpeg-turbo/README.ijg +260 -0
- fast/licenses/libpng/LICENSE +134 -0
- fast/licenses/libtiff/LICENSE.md +23 -0
- fast/licenses/onnxruntime/LICENSE +21 -0
- fast/licenses/onnxruntime/Privacy.md +21 -0
- fast/licenses/onnxruntime/ThirdPartyNotices.txt +6156 -0
- fast/licenses/opencl/LICENSE +201 -0
- fast/licenses/pixman/COPYING +42 -0
- fast/licenses/proxy-libintl/COPYING +482 -0
- fast/licenses/qt5/LICENSE.FDL +450 -0
- fast/licenses/qt5/LICENSE.GPL3-EXCEPT +704 -0
- fast/licenses/qt5/LICENSE.GPLv2 +292 -0
- fast/licenses/qt5/LICENSE.GPLv3 +686 -0
- fast/licenses/qt5/LICENSE.LGPLv21 +514 -0
- fast/licenses/qt5/LICENSE.LGPLv3 +175 -0
- fast/licenses/qt5/LICENSE.QT-LICENSE-AGREEMENT +1315 -0
- fast/licenses/semaphore/Semaphore_LICENSE.txt +17 -0
- fast/licenses/uthash/LICENSE +21 -0
- fast/licenses/zip/UNLICENSE +26 -0
- fast/licenses/zlib/README +115 -0
- fast/licenses/zlib-ng/LICENSE.md +19 -0
- fast/pipelines/uff_viewer/colormap_and_reject.fpl +26 -0
- fast/pipelines/uff_viewer/default.fpl +9 -0
- fast/pipelines/uff_viewer/non_local_means.fpl +34 -0
- fast/plugins/audio/libqtaudio_coreaudio.dylib +0 -0
- fast/plugins/bearer/libqgenericbearer.dylib +0 -0
- fast/plugins/generic/libqtuiotouchplugin.dylib +0 -0
- fast/plugins/iconengines/libqsvgicon.dylib +0 -0
- fast/plugins/imageformats/libqgif.dylib +0 -0
- fast/plugins/imageformats/libqicns.dylib +0 -0
- fast/plugins/imageformats/libqico.dylib +0 -0
- fast/plugins/imageformats/libqjpeg.dylib +0 -0
- fast/plugins/imageformats/libqmacheif.dylib +0 -0
- fast/plugins/imageformats/libqmacjp2.dylib +0 -0
- fast/plugins/imageformats/libqsvg.dylib +0 -0
- fast/plugins/imageformats/libqtga.dylib +0 -0
- fast/plugins/imageformats/libqtiff.dylib +0 -0
- fast/plugins/imageformats/libqwbmp.dylib +0 -0
- fast/plugins/imageformats/libqwebp.dylib +0 -0
- fast/plugins/mediaservice/libqavfcamera.dylib +0 -0
- fast/plugins/mediaservice/libqavfmediaplayer.dylib +0 -0
- fast/plugins/mediaservice/libqtmedia_audioengine.dylib +0 -0
- fast/plugins/platforms/libqcocoa.dylib +0 -0
- fast/plugins/platforms/libqminimal.dylib +0 -0
- fast/plugins/platforms/libqoffscreen.dylib +0 -0
- fast/plugins/platformthemes/libqxdgdesktopportal.dylib +0 -0
- fast/plugins/playlistformats/libqtmultimedia_m3u.dylib +0 -0
- fast/plugins/printsupport/libcocoaprintersupport.dylib +0 -0
- fast/plugins/sqldrivers/libqsqlite.dylib +0 -0
- fast/plugins/styles/libqmacstyle.dylib +0 -0
- pyfast-4.12.0.dist-info/METADATA +81 -0
- pyfast-4.12.0.dist-info/RECORD +248 -0
- pyfast-4.12.0.dist-info/WHEEL +5 -0
- pyfast-4.12.0.dist-info/entry_points.txt +5 -0
- pyfast-4.12.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#version 330 core
|
|
2
|
+
out vec4 FragColor;
|
|
3
|
+
|
|
4
|
+
in vec2 TexCoord;
|
|
5
|
+
|
|
6
|
+
uniform sampler2D ourTexture;
|
|
7
|
+
uniform float window;
|
|
8
|
+
uniform float level;
|
|
9
|
+
uniform float opacity;
|
|
10
|
+
|
|
11
|
+
void main()
|
|
12
|
+
{
|
|
13
|
+
vec4 color = vec4(texture(ourTexture, vec2(TexCoord.x, 1.0 - TexCoord.y)));
|
|
14
|
+
color.rgb = (color.rgb - level + window/2.0f) / window;
|
|
15
|
+
if(opacity >= 0.0)
|
|
16
|
+
color.w = opacity;
|
|
17
|
+
FragColor = clamp(color, 0.0f, 1.0f);
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#version 330 core
|
|
2
|
+
out vec4 FragColor;
|
|
3
|
+
|
|
4
|
+
in vec2 TexCoord;
|
|
5
|
+
|
|
6
|
+
uniform isampler2D ourTexture;
|
|
7
|
+
uniform float window;
|
|
8
|
+
uniform float level;
|
|
9
|
+
uniform float opacity;
|
|
10
|
+
|
|
11
|
+
void main()
|
|
12
|
+
{
|
|
13
|
+
vec4 color = vec4(texture(ourTexture, vec2(TexCoord.x, 1.0 - TexCoord.y)));
|
|
14
|
+
color.rgb = (color.rgb - level + window/2.0f) / window;
|
|
15
|
+
if(opacity >= 0.0)
|
|
16
|
+
color.w = opacity;
|
|
17
|
+
FragColor = clamp(color, 0.0f, 1.0f);
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#version 330 core
|
|
2
|
+
out vec4 FragColor;
|
|
3
|
+
|
|
4
|
+
in vec2 TexCoord;
|
|
5
|
+
|
|
6
|
+
uniform usampler2D ourTexture;
|
|
7
|
+
uniform float window;
|
|
8
|
+
uniform float level;
|
|
9
|
+
uniform float opacity;
|
|
10
|
+
|
|
11
|
+
void main() {
|
|
12
|
+
vec4 color = vec4(texture(ourTexture, vec2(TexCoord.x, 1.0 - TexCoord.y)));
|
|
13
|
+
color.rgb = (color.rgb - level + window/2.0f) / window; // Normalize RGB
|
|
14
|
+
color.a = color.a/255.0; // Normalize alpha
|
|
15
|
+
if(opacity >= 0.0)
|
|
16
|
+
color.w = opacity;
|
|
17
|
+
FragColor = clamp(color, 0.0f, 1.0f);
|
|
18
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#version 330
|
|
2
|
+
|
|
3
|
+
layout (lines) in; // now we can access 2 vertices
|
|
4
|
+
layout (triangle_strip, max_vertices = 4) out; // always (for now) producing 2 triangles (so 4 vertices)
|
|
5
|
+
in vec4 vertexColor[];
|
|
6
|
+
out vec4 geomColor;
|
|
7
|
+
|
|
8
|
+
uniform mat4 transform;
|
|
9
|
+
uniform mat4 viewTransform;
|
|
10
|
+
uniform mat4 perspectiveTransform;
|
|
11
|
+
uniform float thickness;
|
|
12
|
+
//uniform int viewportWidth;
|
|
13
|
+
//uniform int viewportHeight;
|
|
14
|
+
|
|
15
|
+
void main()
|
|
16
|
+
{
|
|
17
|
+
geomColor = vertexColor[0];
|
|
18
|
+
vec4 p1 = gl_in[0].gl_Position;
|
|
19
|
+
vec4 p2 = gl_in[1].gl_Position;
|
|
20
|
+
|
|
21
|
+
float size = (thickness/100.0)/(perspectiveTransform[0][0]/2.0); // percent to mm
|
|
22
|
+
vec2 dir = normalize((p2.xy - p1.xy));
|
|
23
|
+
vec4 offset = vec4(-dir.y, dir.x, 0, 0) * size * 0.5;
|
|
24
|
+
|
|
25
|
+
gl_Position = perspectiveTransform * viewTransform * transform * (p1 + offset);
|
|
26
|
+
EmitVertex();
|
|
27
|
+
gl_Position = perspectiveTransform * viewTransform * transform * (p1 - offset);
|
|
28
|
+
EmitVertex();
|
|
29
|
+
gl_Position = perspectiveTransform * viewTransform * transform * (p2 + offset);
|
|
30
|
+
EmitVertex();
|
|
31
|
+
gl_Position = perspectiveTransform * viewTransform * transform * (p2 - offset);
|
|
32
|
+
EmitVertex();
|
|
33
|
+
|
|
34
|
+
EndPrimitive();
|
|
35
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#version 330 core
|
|
2
|
+
layout (location = 0) in vec3 in_position;
|
|
3
|
+
layout (location = 1) in vec3 in_color;
|
|
4
|
+
|
|
5
|
+
out vec4 vertexColor;
|
|
6
|
+
|
|
7
|
+
uniform mat4 transform;
|
|
8
|
+
uniform mat4 viewTransform;
|
|
9
|
+
uniform mat4 perspectiveTransform;
|
|
10
|
+
uniform bool useGlobalColor;
|
|
11
|
+
uniform vec3 globalColor;
|
|
12
|
+
|
|
13
|
+
void main() {
|
|
14
|
+
gl_Position = vec4(in_position, 1.0);
|
|
15
|
+
if(useGlobalColor) {
|
|
16
|
+
vertexColor = vec4(globalColor, 1.0);
|
|
17
|
+
} else {
|
|
18
|
+
vertexColor = vec4(in_color, 1.0);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#version 330 core
|
|
2
|
+
layout (location = 0) in vec3 in_position;
|
|
3
|
+
layout (location = 1) in vec3 in_color;
|
|
4
|
+
|
|
5
|
+
out vec4 vertexColor;
|
|
6
|
+
|
|
7
|
+
uniform mat4 transform;
|
|
8
|
+
uniform mat4 viewTransform;
|
|
9
|
+
uniform mat4 perspectiveTransform;
|
|
10
|
+
uniform bool useGlobalColor;
|
|
11
|
+
uniform vec3 globalColor;
|
|
12
|
+
|
|
13
|
+
void main() {
|
|
14
|
+
gl_Position = perspectiveTransform * viewTransform * transform * vec4(in_position, 1.0);
|
|
15
|
+
if(useGlobalColor) {
|
|
16
|
+
vertexColor = vec4(globalColor, 1.0);
|
|
17
|
+
} else {
|
|
18
|
+
vertexColor = vec4(in_color, 1.0);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#version 330 core
|
|
2
|
+
|
|
3
|
+
out vec4 FragColor;
|
|
4
|
+
in vec4 vertex_color;
|
|
5
|
+
|
|
6
|
+
void main()
|
|
7
|
+
{
|
|
8
|
+
// Convert squares to circles
|
|
9
|
+
vec2 circCoord = gl_PointCoord - vec2(0.5, 0.5);
|
|
10
|
+
if(dot(circCoord, circCoord) > 0.25) { // x dot x = |x|*|x| = r^2, radius = 0.5, r^2=0.25
|
|
11
|
+
discard;
|
|
12
|
+
} else {
|
|
13
|
+
FragColor = vertex_color;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#version 330 core
|
|
2
|
+
layout (location = 0) in vec3 aPos;
|
|
3
|
+
layout (location = 1) in vec3 aColor;
|
|
4
|
+
|
|
5
|
+
out vec4 vertex_color;
|
|
6
|
+
|
|
7
|
+
uniform mat4 transform;
|
|
8
|
+
uniform mat4 viewTransform;
|
|
9
|
+
uniform mat4 perspectiveTransform;
|
|
10
|
+
uniform float pointSize;
|
|
11
|
+
uniform bool useGlobalColor;
|
|
12
|
+
uniform vec3 globalColor;
|
|
13
|
+
uniform int viewportWidth;
|
|
14
|
+
|
|
15
|
+
void main()
|
|
16
|
+
{
|
|
17
|
+
gl_Position = perspectiveTransform * viewTransform * transform * vec4(aPos, 1.0);
|
|
18
|
+
gl_PointSize = (pointSize/100.0)*viewportWidth; // gl_PointSize unit is in pixels
|
|
19
|
+
if(useGlobalColor) {
|
|
20
|
+
vertex_color = vec4(globalColor, 1.0);
|
|
21
|
+
} else {
|
|
22
|
+
vertex_color = vec4(aColor, 1.0);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#version 330 core
|
|
2
|
+
layout (location = 0) in vec3 aPos;
|
|
3
|
+
layout (location = 1) in vec2 aTexCoord;
|
|
4
|
+
|
|
5
|
+
out vec2 TexCoord;
|
|
6
|
+
|
|
7
|
+
uniform mat4 transform;
|
|
8
|
+
uniform mat4 viewTransform;
|
|
9
|
+
uniform mat4 perspectiveTransform;
|
|
10
|
+
uniform int positionType;
|
|
11
|
+
|
|
12
|
+
void main()
|
|
13
|
+
{
|
|
14
|
+
gl_Position = perspectiveTransform * viewTransform * transform * vec4(aPos, 1.0);
|
|
15
|
+
TexCoord = aTexCoord;
|
|
16
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
#version 330 core
|
|
2
|
+
layout (std140) uniform Colors {
|
|
3
|
+
vec4 color[256];
|
|
4
|
+
};
|
|
5
|
+
out vec4 FragColor;
|
|
6
|
+
|
|
7
|
+
in vec2 TexCoord;
|
|
8
|
+
|
|
9
|
+
// Using sampler2D here instead of usampler2d, due to texture compression
|
|
10
|
+
uniform sampler2D ourTexture;
|
|
11
|
+
uniform float opacity;
|
|
12
|
+
uniform float borderOpacity;
|
|
13
|
+
uniform int borderRadius;
|
|
14
|
+
|
|
15
|
+
void main()
|
|
16
|
+
{
|
|
17
|
+
uint in_label = uint(round(texture(ourTexture, vec2(TexCoord.x, TexCoord.y)).r*255)); // Texture compression is normalized
|
|
18
|
+
FragColor = vec4(0.0, 0.0, 0.0, 0.0);
|
|
19
|
+
vec2 size = textureSize(ourTexture, 0);
|
|
20
|
+
uint borderLabel = uint(0);
|
|
21
|
+
|
|
22
|
+
// Border check
|
|
23
|
+
bool isBorder = false;
|
|
24
|
+
if(borderRadius > 1 || borderOpacity != opacity) {
|
|
25
|
+
// Check neighbors
|
|
26
|
+
// If any neighbors have a different label, we are at the border
|
|
27
|
+
for(int a = -borderRadius; a <= borderRadius; ++a) {
|
|
28
|
+
for(int b = -borderRadius; b <= borderRadius; ++b) {
|
|
29
|
+
if(uint(round(texture(ourTexture, vec2(TexCoord.x + float(a)/size.x, (TexCoord.y + float(b)/size.y))).r*255)) != in_label){
|
|
30
|
+
if(borderRadius == 1 || length(vec2(a, b)) < borderRadius) {
|
|
31
|
+
if(in_label == uint(0)) {
|
|
32
|
+
// Outside
|
|
33
|
+
if(borderRadius > 1) {
|
|
34
|
+
borderLabel = uint(round(texture(ourTexture, vec2(TexCoord.x + float(a)/size.x, (TexCoord.y + float(b)/size.y))).r*255));
|
|
35
|
+
isBorder = true;
|
|
36
|
+
}
|
|
37
|
+
} else {
|
|
38
|
+
// Inside
|
|
39
|
+
isBorder = true;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if((in_label > uint(0) && in_label < uint(256)) || isBorder) {
|
|
48
|
+
if(isBorder && in_label == uint(0))
|
|
49
|
+
in_label = borderLabel;
|
|
50
|
+
FragColor = color[in_label];
|
|
51
|
+
FragColor.a = isBorder ? borderOpacity : opacity;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
#version 330 core
|
|
2
|
+
layout (std140) uniform Colors {
|
|
3
|
+
vec4 color[256];
|
|
4
|
+
};
|
|
5
|
+
out vec4 FragColor;
|
|
6
|
+
|
|
7
|
+
in vec2 TexCoord;
|
|
8
|
+
|
|
9
|
+
uniform usampler2D ourTexture;
|
|
10
|
+
uniform float opacity;
|
|
11
|
+
uniform float borderOpacity;
|
|
12
|
+
uniform int borderRadius;
|
|
13
|
+
|
|
14
|
+
void main()
|
|
15
|
+
{
|
|
16
|
+
uint in_label = texture(ourTexture, vec2(TexCoord.x, 1.0 - TexCoord.y)).r;
|
|
17
|
+
FragColor = vec4(0.0, 0.0, 0.0, 0.0);
|
|
18
|
+
vec2 size = textureSize(ourTexture, 0);
|
|
19
|
+
uint borderLabel = uint(0);
|
|
20
|
+
|
|
21
|
+
// Border check
|
|
22
|
+
bool isBorder = false;
|
|
23
|
+
if(borderRadius > 1 || borderOpacity != opacity) {
|
|
24
|
+
// Check neighbors
|
|
25
|
+
// If any neighbors have a different label, we are at the border
|
|
26
|
+
for(int a = -borderRadius; a <= borderRadius; ++a) {
|
|
27
|
+
for(int b = -borderRadius; b <= borderRadius; ++b) {
|
|
28
|
+
if(uint(texture(ourTexture, vec2(TexCoord.x + float(a)/size.x, 1.0 - (TexCoord.y + float(b)/size.y))).r) != in_label) {
|
|
29
|
+
if(borderRadius == 1 || length(vec2(a, b)) < borderRadius) {
|
|
30
|
+
if(in_label == uint(0)) {
|
|
31
|
+
// Outside
|
|
32
|
+
if(borderRadius > 1) {
|
|
33
|
+
borderLabel = uint(texture(ourTexture, vec2(TexCoord.x + float(a)/size.x, 1.0 - (TexCoord.y + float(b)/size.y))).r);
|
|
34
|
+
isBorder = true;
|
|
35
|
+
}
|
|
36
|
+
} else {
|
|
37
|
+
// Inside
|
|
38
|
+
isBorder = true;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if((in_label > uint(0) && in_label < uint(256)) || isBorder) {
|
|
47
|
+
if(isBorder && in_label == uint(0))
|
|
48
|
+
in_label = borderLabel;
|
|
49
|
+
FragColor = color[in_label];
|
|
50
|
+
FragColor.a = isBorder ? borderOpacity : opacity;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#version 330 core
|
|
2
|
+
layout (location = 0) in vec3 aPos;
|
|
3
|
+
layout (location = 1) in vec2 aTexCoord;
|
|
4
|
+
|
|
5
|
+
out vec2 TexCoord;
|
|
6
|
+
|
|
7
|
+
uniform mat4 transform;
|
|
8
|
+
uniform mat4 viewTransform;
|
|
9
|
+
uniform mat4 perspectiveTransform;
|
|
10
|
+
|
|
11
|
+
void main()
|
|
12
|
+
{
|
|
13
|
+
gl_Position = perspectiveTransform * viewTransform * transform * vec4(aPos, 1.0);
|
|
14
|
+
TexCoord = aTexCoord;
|
|
15
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#version 330 core
|
|
2
|
+
layout (location = 0) in vec3 aPos;
|
|
3
|
+
layout (location = 1) in vec2 aTexCoord;
|
|
4
|
+
|
|
5
|
+
out vec2 TexCoord;
|
|
6
|
+
|
|
7
|
+
uniform mat4 transform;
|
|
8
|
+
uniform mat4 viewTransform;
|
|
9
|
+
uniform mat4 perspectiveTransform;
|
|
10
|
+
uniform int positionType;
|
|
11
|
+
|
|
12
|
+
void main()
|
|
13
|
+
{
|
|
14
|
+
if(positionType == 2) {
|
|
15
|
+
gl_Position = perspectiveTransform * viewTransform * transform * vec4(aPos, 1.0);
|
|
16
|
+
} else {
|
|
17
|
+
gl_Position = transform * vec4(aPos, 1.0);
|
|
18
|
+
}
|
|
19
|
+
TexCoord = aTexCoord;
|
|
20
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#version 330 core
|
|
2
|
+
|
|
3
|
+
in vec3 Normal;
|
|
4
|
+
in vec3 FragPos;
|
|
5
|
+
in vec3 LightPos;
|
|
6
|
+
in vec3 ViewPos;
|
|
7
|
+
in vec3 Color;
|
|
8
|
+
|
|
9
|
+
out vec4 FragColor;
|
|
10
|
+
|
|
11
|
+
uniform float opacity;
|
|
12
|
+
uniform bool mode2D;
|
|
13
|
+
uniform bool ignoreInvertedNormals;
|
|
14
|
+
|
|
15
|
+
void main()
|
|
16
|
+
{
|
|
17
|
+
if(mode2D) {
|
|
18
|
+
FragColor = vec4(Color, opacity);
|
|
19
|
+
} else {
|
|
20
|
+
vec3 objectColor = Color;
|
|
21
|
+
vec3 lightColor = vec3(0.7, 0.7, 0.7);
|
|
22
|
+
vec3 ambientColor = vec3(0.2, 0.2, 0.2);
|
|
23
|
+
vec3 specularColor = vec3(1.0, 1.0, 1.0);
|
|
24
|
+
float shininess = 16;
|
|
25
|
+
|
|
26
|
+
// ambient
|
|
27
|
+
vec3 ambient = lightColor * ambientColor;
|
|
28
|
+
|
|
29
|
+
// diffuse
|
|
30
|
+
vec3 norm = normalize(Normal);
|
|
31
|
+
vec3 lightDir = normalize(LightPos - FragPos);
|
|
32
|
+
float diff;
|
|
33
|
+
if(ignoreInvertedNormals) {
|
|
34
|
+
diff = abs(dot(norm, lightDir));
|
|
35
|
+
} else {
|
|
36
|
+
diff = max(dot(norm, lightDir), 0.0);
|
|
37
|
+
}
|
|
38
|
+
vec3 diffuse = lightColor * (diff * objectColor);
|
|
39
|
+
|
|
40
|
+
// specular
|
|
41
|
+
vec3 viewDir = normalize(ViewPos - FragPos);
|
|
42
|
+
vec3 reflectDir = reflect(-lightDir, norm);
|
|
43
|
+
float spec = pow(max(dot(viewDir, reflectDir), 0.0), shininess);
|
|
44
|
+
vec3 specular = lightColor * (spec * specularColor);
|
|
45
|
+
|
|
46
|
+
vec3 result = ambient + diffuse + specular;
|
|
47
|
+
FragColor = vec4(result, opacity);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#version 330 core
|
|
2
|
+
layout (location = 0) in vec3 aPos;
|
|
3
|
+
layout (location = 1) in vec3 aNormal;
|
|
4
|
+
layout (location = 2) in vec3 aColor;
|
|
5
|
+
|
|
6
|
+
out vec3 Normal;
|
|
7
|
+
out vec3 FragPos;
|
|
8
|
+
out vec3 LightPos;
|
|
9
|
+
out vec3 ViewPos;
|
|
10
|
+
out vec3 Color;
|
|
11
|
+
|
|
12
|
+
uniform mat4 transform;
|
|
13
|
+
uniform mat4 viewTransform;
|
|
14
|
+
uniform mat4 perspectiveTransform;
|
|
15
|
+
uniform bool use_normals;
|
|
16
|
+
uniform bool useGlobalColor;
|
|
17
|
+
uniform vec3 globalColor;
|
|
18
|
+
|
|
19
|
+
void main()
|
|
20
|
+
{
|
|
21
|
+
gl_Position = perspectiveTransform * viewTransform * transform * vec4(aPos, 1.0);
|
|
22
|
+
if(use_normals) {
|
|
23
|
+
Normal = mat3(transpose(inverse(transform))) * aNormal;
|
|
24
|
+
} else {
|
|
25
|
+
Normal = vec3(1,0,0);
|
|
26
|
+
}
|
|
27
|
+
FragPos = vec3(transform * vec4(aPos, 1.0));
|
|
28
|
+
LightPos = vec3(inverse(viewTransform) * vec4(0.0, 0.0, 0.0, 1.0));
|
|
29
|
+
ViewPos = vec3(inverse(viewTransform) * vec4(0.0, 0.0, 0.0, 1.0));
|
|
30
|
+
if(useGlobalColor) {
|
|
31
|
+
Color = globalColor;
|
|
32
|
+
} else {
|
|
33
|
+
Color = aColor;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
__constant sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP | CLK_FILTER_NEAREST;
|
|
2
|
+
|
|
3
|
+
float3 hueToRGB(float H) {
|
|
4
|
+
float R = fabs(H * 6.0f - 3.0f) - 1;
|
|
5
|
+
float G = 2 - fabs(H * 6 - 2);
|
|
6
|
+
float B = 2 - fabs(H * 6 - 4);
|
|
7
|
+
return clamp((float3)(R, G, B), 0.0f, 1.0f);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
__kernel void renderToTexture(
|
|
11
|
+
__read_only image2d_t input,
|
|
12
|
+
__write_only image2d_t output,
|
|
13
|
+
__private float maxOpacity,
|
|
14
|
+
__private float maxVectorMagnitude
|
|
15
|
+
) {
|
|
16
|
+
const int2 position = {get_global_id(0), get_global_id(1)};
|
|
17
|
+
|
|
18
|
+
const float2 vector = read_imagef(input, sampler, position).xy;
|
|
19
|
+
|
|
20
|
+
// Calculate angle of vector
|
|
21
|
+
const float angle = (1.0f + atan2(vector.y, vector.x) / 3.141592f) / 2.0f; // mapping -pi,pi to 0,1
|
|
22
|
+
|
|
23
|
+
// Use angle as hue and then convert to RGB
|
|
24
|
+
const float3 color = hueToRGB(angle);
|
|
25
|
+
|
|
26
|
+
// Use vector magnitude as opacity
|
|
27
|
+
const float opacity = clamp(length(vector)/maxVectorMagnitude, 0.0f, maxOpacity);
|
|
28
|
+
|
|
29
|
+
write_imagef(output, position, (float4)(color.x, color.y, color.z, opacity));
|
|
30
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#version 330 core
|
|
2
|
+
layout (location = 0) in vec3 aPos;
|
|
3
|
+
layout (location = 1) in vec3 aColor;
|
|
4
|
+
|
|
5
|
+
out vec4 vertex_color;
|
|
6
|
+
|
|
7
|
+
uniform mat4 transform;
|
|
8
|
+
uniform mat4 viewTransform;
|
|
9
|
+
uniform mat4 perspectiveTransform;
|
|
10
|
+
uniform float pointSize;
|
|
11
|
+
uniform bool useGlobalColor;
|
|
12
|
+
uniform vec3 globalColor;
|
|
13
|
+
|
|
14
|
+
void main()
|
|
15
|
+
{
|
|
16
|
+
gl_PointSize = pointSize;
|
|
17
|
+
gl_Position = perspectiveTransform * viewTransform * transform * vec4(aPos, 1.0);
|
|
18
|
+
if(useGlobalColor) {
|
|
19
|
+
vertex_color = vec4(globalColor, 1.0);
|
|
20
|
+
} else {
|
|
21
|
+
vertex_color = vec4(aColor, 1.0);
|
|
22
|
+
}
|
|
23
|
+
}
|