Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Main Repositories
otb
Commits
f5cc04fc
Commit
f5cc04fc
authored
Feb 10, 2016
by
Stéphane Albert
Browse files
ENH: Added GDALOverviewsBuilder::ListResolutions().
parent
547f9d85
Changes
2
Hide whitespace changes
Inline
Side-by-side
Modules/IO/IOGDAL/include/otbGDALOverviewsBuilder.h
View file @
f5cc04fc
...
...
@@ -21,6 +21,7 @@
// #include "itkLightObject.h"
#include "itkProcessObject.h"
#include "itkSize.h"
#include "otbGDALDatasetWrapper.h"
#include "otbConfigure.h"
...
...
@@ -84,6 +85,9 @@ public:
typedef
itk
::
SmartPointer
<
Self
>
Pointer
;
typedef
itk
::
SmartPointer
<
const
Self
>
ConstPointer
;
typedef
itk
::
Size
<
2
>
Size
;
typedef
std
::
vector
<
Size
>
SizeVector
;
/** Method for creation through the object factory. */
itkNewMacro
(
Self
);
...
...
@@ -94,8 +98,11 @@ public:
unsigned
int
CountResolutions
(
unsigned
int
factor
,
unsigned
int
n
=
0
)
const
;
unsigned
int
GetOverviewsCount
()
const
;
void
ListResolutions
(
SizeVector
&
,
unsigned
int
factor
,
unsigned
int
count
)
;
void
ListResolutions
(
SizeVector
&
);
unsigned
int
GetOverviewsCount
()
const
;
GDALResampling
GetResamplingMethod
()
const
;
...
...
@@ -131,6 +138,7 @@ public:
protected:
GDALOverviewsBuilder
();
virtual
~
GDALOverviewsBuilder
()
{};
void
PrintSelf
(
std
::
ostream
&
os
,
itk
::
Indent
indent
)
const
;
...
...
Modules/IO/IOGDAL/src/otbGDALOverviewsBuilder.cxx
View file @
f5cc04fc
...
...
@@ -103,7 +103,7 @@ GDALOverviewsBuilder
unsigned
int
minSize
=
static_cast
<
unsigned
int
>
(
pow
(
factor
,
n
)
);
unsigned
int
count
=
1
;
unsigned
int
count
=
0
;
unsigned
int
size
=
std
::
min
(
...
...
@@ -121,6 +121,37 @@ GDALOverviewsBuilder
return
count
;
}
/***************************************************************************/
void
GDALOverviewsBuilder
::
ListResolutions
(
SizeVector
&
sizes
)
{
ListResolutions
(
sizes
,
m_ResolutionFactor
,
m_NbResolutions
);
}
/***************************************************************************/
void
GDALOverviewsBuilder
::
ListResolutions
(
SizeVector
&
sizes
,
unsigned
int
factor
,
unsigned
int
count
)
{
assert
(
!
m_GdalDataset
.
IsNull
()
);
Size
s
;
s
[
0
]
=
m_GdalDataset
->
GetWidth
();
s
[
1
]
=
m_GdalDataset
->
GetHeight
();
unsigned
int
n
=
std
::
min
(
count
,
CountResolutions
(
factor
,
0
)
);
for
(
unsigned
int
i
=
0
;
i
<
n
;
++
i
)
{
sizes
.
push_back
(
s
);
s
[
0
]
/=
factor
;
s
[
1
]
/=
factor
;
}
}
/***************************************************************************/
unsigned
int
GDALOverviewsBuilder
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment