Skip to content
Snippets Groups Projects
Commit 13d580d4 authored by Julien Michel's avatar Julien Michel
Browse files

new visu

parent 3b6411a2
No related branches found
No related tags found
No related merge requests found
......@@ -140,6 +140,7 @@ otbImageToGrayscaleAnaglyphImageFilterNew.cxx
otbImageToGrayscaleAnaglyphImageFilter.cxx
otbVectorImageToColorAnaglyphVectorImageFilterNew.cxx
otbVectorImageToColorAnaglyphVectorImageFilter.cxx
otbAlternateViewerTest.cxx
)
INCLUDE_DIRECTORIES("${OTBTesting_BINARY_DIR}")
......
#include "otbVectorImage.h"
#include "otbVectorRescaleIntensityImageFilter.h"
#include "otbImageFileReader.h"
#include "otbImageAlternateViewer.h"
#include "Fl/Fl.h"
int otbAlternateViewerTest(int argc, char* argv[])
{
const unsigned int Dimension = 2;
typedef double PixelType;
typedef otb::VectorImage<PixelType,Dimension> ImageType;
typedef otb::ImageFileReader<ImageType> ReaderType;
typedef otb::ImageAlternateViewer<PixelType> ViewerType;
ReaderType::Pointer reader = ReaderType::New();
reader->SetFileName(argv[1]);
reader->GenerateOutputInformation();
ImageType::PixelType min,max;
min.SetSize(reader->GetOutput()->GetNumberOfComponentsPerPixel());
max.SetSize(reader->GetOutput()->GetNumberOfComponentsPerPixel());
// min[0]=195;
// min[1]=241;
// min[2]=127;
// min[3]=130;
// max[0]=387;
// max[1]=602;
// max[2]=469;
// max[3]=740;
min.Fill(0);
max.Fill(255);
// RescalerType::Pointer rescaler = RescalerType::New();
// rescaler->SetOutputMinimum(min);
// rescaler->SetOutputMaximum(max);
// rescaler->SetInput(reader->GetOutput());
// rescaler->SetClampThreshold(atof(argv[2]));
// rescaler->GenerateOutputInformation();
Fl_Window window(512,512);
ViewerType::Pointer viewer = ViewerType::New();
viewer->SetImage(reader->GetOutput());
viewer->SetMinComponentValues(min);
viewer->SetMaxComponentValues(max);
viewer->SetRedChannelIndex(atoi(argv[2]));
viewer->SetGreenChannelIndex(atoi(argv[3]));
viewer->SetBlueChannelIndex(atoi(argv[4]));
window.end();
window.resizable(viewer.GetPointer());
viewer->Init("test de la nouvelle visu");
window.show();
viewer->Show();
Fl::check();
// window.resize(0,0,600,400);
// Fl::check();
// window.resize(0,0,600,600);
// Fl::check();
// window.resize(0,0,650,500);
// Fl::check();
// window.resize(0,0,700,500);
// Fl::check();
// window.resize(0,0,750,500);
// Fl::check();
// window.resize(0,0,800,500);
// Fl::check();
// window.resize(0,0,521,481);
Fl::run();
return EXIT_SUCCESS;
}
......@@ -28,7 +28,7 @@ int otbImageToGrayscaleAnaglyphImageFilter(int argc, char * argv[])
try
{
const unsigned int Dimension = 2;
typedef unsigned char PixelType;
typedef double PixelType;
typedef otb::Image<PixelType,Dimension> ImageType;
typedef otb::VectorImage<PixelType,Dimension> VectorImageType;
......
......@@ -42,4 +42,5 @@ REGISTER_TEST(otbImageToGrayscaleAnaglyphImageFilterNew);
REGISTER_TEST(otbImageToGrayscaleAnaglyphImageFilter);
REGISTER_TEST(otbVectorImageToColorAnaglyphVectorImageFilterNew);
REGISTER_TEST(otbVectorImageToColorAnaglyphVectorImageFilter);
REGISTER_TEST(otbAlternateViewerTest);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment