Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
VTK Examples
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VTK
VTK Examples
Commits
e3671ee5
Commit
e3671ee5
authored
5 years ago
by
Bharatesh Chakravarthi S B
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Create JPEGReader.java
Former-commit-id:
52c5e0a1
parent
c4fb44c6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Java/IO/JPEGReader.java
+52
-0
52 additions, 0 deletions
src/Java/IO/JPEGReader.java
with
52 additions
and
0 deletions
src/Java/IO/JPEGReader.java
0 → 100644
+
52
−
0
View file @
e3671ee5
import
vtk.vtkNativeLibrary
;
import
vtk.vtkRenderWindowInteractor
;
import
vtk.vtkJPEGReader
;
import
vtk.vtkImageViewer2
;
public
class
JPEGReader
{
// -----------------------------------------------------------------
// Load VTK library and print which library was not properly loaded
static
{
if
(!
vtkNativeLibrary
.
LoadAllNativeLibraries
())
{
for
(
vtkNativeLibrary
lib
:
vtkNativeLibrary
.
values
())
{
if
(!
lib
.
IsLoaded
())
{
System
.
out
.
println
(
lib
.
GetLibraryName
()
+
" not loaded"
);
}
}
}
vtkNativeLibrary
.
DisableOutputWindow
(
null
);
}
// -----------------------------------------------------------------
public
static
void
main
(
String
args
[])
{
//parse command line arguments
if
(
args
.
length
!=
1
)
{
System
.
err
.
println
(
"Usage: java -classpath ... Filename(.jpg) e.g Pileated.jpg "
);
return
;
}
String
inputFilename
=
args
[
0
];
//Read the image
vtkJPEGReader
jpegReader
=
new
vtkJPEGReader
();
jpegReader
.
SetFileName
(
inputFilename
);
// Visualize
vtkImageViewer2
imageViewer
=
new
vtkImageViewer2
();
imageViewer
.
SetInputConnection
(
jpegReader
.
GetOutputPort
()
);
vtkRenderWindowInteractor
renderWindowInteractor
=
new
vtkRenderWindowInteractor
();
imageViewer
.
SetupInteractor
(
renderWindowInteractor
);
imageViewer
.
Render
();
imageViewer
.
GetRenderer
().
ResetCamera
();
imageViewer
.
Render
();
renderWindowInteractor
.
Start
();
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment