Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
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
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
Antoine Belvire
otb
Commits
2b5d3b8c
Commit
2b5d3b8c
authored
16 years ago
by
Julien Michel
Browse files
Options
Downloads
Patches
Plain Diff
ENH: (Visu Refactoring) Changing default quicklook size
parent
ddada76e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Code/VisuRefac/otbImageLayerGenerator.h
+7
-0
7 additions, 0 deletions
Code/VisuRefac/otbImageLayerGenerator.h
Code/VisuRefac/otbImageLayerGenerator.txx
+8
-3
8 additions, 3 deletions
Code/VisuRefac/otbImageLayerGenerator.txx
with
15 additions
and
3 deletions
Code/VisuRefac/otbImageLayerGenerator.h
+
7
−
0
View file @
2b5d3b8c
...
...
@@ -103,6 +103,10 @@ public:
/** Activate/deactivate quicklook generation */
itkSetMacro
(
GenerateQuicklook
,
bool
);
itkBooleanMacro
(
GenerateQuicklook
);
/** Set/Get the screen ratio */
itkSetMacro
(
ScreenRatio
,
double
);
itkGetMacro
(
ScreenRatio
,
double
);
protected:
/** Constructor */
...
...
@@ -144,6 +148,9 @@ private:
/** Streaming resample filter */
ResampleFilterPointerType
m_Resampler
;
/** Which ratio of the screen size the quicklook size should be */
double
m_ScreenRatio
;
};
// end class
}
// end namespace otb
...
...
This diff is collapsed.
Click to expand it.
Code/VisuRefac/otbImageLayerGenerator.txx
+
8
−
3
View file @
2b5d3b8c
...
...
@@ -29,7 +29,7 @@ template < class TImageLayer >
ImageLayerGenerator<TImageLayer>
::ImageLayerGenerator() : m_Layer(), m_Image(), m_Quicklook(),
m_SubsamplingRate(1), m_GenerateQuicklook(true),
m_Resampler()
m_Resampler()
, m_ScreenRatio(0.25)
{
// Intialize output layer
m_Layer = ImageLayerType::New();
...
...
@@ -93,8 +93,8 @@ ImageLayerGenerator<TImageLayer>
typename ImageType::RegionType largestRegion = m_Image->GetLargestPossibleRegion();
// Shannon (finner generation could be added later)
unsigned int wrequested =
wscreen/2
;
unsigned int hrequested =
hscreen/2
;
unsigned int wrequested =
static_cast<unsigned int>(wscreen*m_ScreenRatio)
;
unsigned int hrequested =
static_cast<unsigned int>(hscreen*m_ScreenRatio)
;
// Compute ratio in both directions
unsigned int wratio = m_Image->GetLargestPossibleRegion().GetSize()[0]/wrequested;
...
...
@@ -137,8 +137,10 @@ ImageLayerGenerator<TImageLayer>
// If no subsampling is needed
if(ssrate == 1)
{
otbMsgDevMacro(<<"ImageLayerGenerator::GenerateQuicklook(): subsampling rate is 1, Image itself is used as quicklook");
m_Layer->SetHasQuicklook(true);
m_Layer->SetQuicklookSubsamplingRate(1);
m_Image->Update();
m_Layer->SetQuicklook(m_Image);
}
else
...
...
@@ -149,6 +151,9 @@ ImageLayerGenerator<TImageLayer>
m_Resampler->SetShrinkFactor(ssrate);
m_Resampler->Update();
otbMsgDevMacro(<<"ImageLayerGenerator::GenerateQuicklook(): Quicklook generated (ssrate= "<<ssrate<<", size= "<<m_Resampler->GetOutput()->GetLargestPossibleRegion().GetSize()<<")");
// Set the quicklook to the layer
m_Layer->SetQuicklook(m_Resampler->GetOutput());
m_Layer->SetHasQuicklook(true);
...
...
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