Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Namespaces | Functions
VigraImpex

Namespaces

 vigra::detail
 

Functions

template<class ImageIterator , class ImageAccessor , class AlphaIterator , class AlphaAccessor >
void vigra::importImageAlpha (const ImageImportInfo &import_info, ImageIterator image_iterator, ImageAccessor image_accessor, AlphaIterator alpha_iterator, AlphaAccessor alpha_accessor)
 Read the image specified by the given vigra::ImageImportInfo object including its alpha channel. More...
 
template<class ImageIterator , class ImageAccessor , class AlphaIterator , class AlphaAccessor >
void vigra::importImageAlpha (ImageImportInfo const &import_info, pair< ImageIterator, ImageAccessor > image, pair< AlphaIterator, AlphaAccessor > alpha)
 
template<class ImageIterator , class ImageAccessor , class AlphaIterator , class AlphaAccessor >
void vigra::exportImageAlpha (ImageIterator image_upper_left, ImageIterator image_lower_right, ImageAccessor image_accessor, AlphaIterator alpha_upper_left, AlphaAccessor alpha_accessor, const ImageExportInfo &export_info)
 Write the image and its alpha channel to a file. More...
 
template<class ImageIterator , class ImageAccessor , class AlphaIterator , class AlphaAccessor >
void vigra::exportImageAlpha (triple< ImageIterator, ImageIterator, ImageAccessor > image, pair< AlphaIterator, AlphaAccessor > alpha, ImageExportInfo const &export_info)
 

Detailed Description

Function Documentation

template<class ImageIterator , class ImageAccessor , class AlphaIterator , class AlphaAccessor >
void vigra::exportImageAlpha ( ImageIterator  image_upper_left,
ImageIterator  image_lower_right,
ImageAccessor  image_accessor,
AlphaIterator  alpha_upper_left,
AlphaAccessor  alpha_accessor,
const ImageExportInfo &  export_info 
)
inline

Write the image and its alpha channel to a file.

See exportImage() for more information.

Declarations

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
exportImageAlpha(MultiArrayView<2, T1, S1> const & image,
MultiArrayView<2, T2, S2> const & alpha,
ImageExportInfo const & export_info);
template <class T1, class S1,
class T2, class S2>
void
exportImageAlpha(MultiArrayView<2, T1, S1> const & image,
MultiArrayView<2, T2, S2> const & alpha,
char const * filename)
template <class T1, class S1,
class T2, class S2>
void
exportImageAlpha(MultiArrayView<2, T1, S1> const & image,
MultiArrayView<2, T2, S2> const & alpha,
std::string const & filename)
}

{exportImageAlpha} pass ImageIterators and DataAccessors :

namespace vigra {
template <class ImageIterator, class ImageAccessor,
class AlphaIterator, class AlphaAccessor>
void
exportImageAlpha(ImageIterator imageUpperLeft, ImageIterator imageLowerRight, ImageAccessor imageAccessor,
AlphaIterator alphaUpperLeft, AlphaAccessor alphaAccessor,
const ImageExportInfo& exportInfo)
}

Use argument objects in conjunction with ArgumentObjectFactories :

namespace vigra {
template <class ImageIterator, class ImageAccessor,
class AlphaIterator, class AlphaAccessor>
void
exportImageAlpha(const triple<ImageIterator, ImageIterator, ImageAccessor>& image,
const pair<AlphaIterator, AlphaAccessor>& alpha,
const ImageExportInfo& exportInfo)
}

Usage:

#include <vigra/impexalpha.hxx>
Namespace: vigra

typedef UInt8 value_t;
MultiArray<2, value_t> alpha(width, height);
MultiArray<2, RGBValue<value_t> > image(width, height);
... // do some image processing
// specify the output filename
exportImageAlpha(image, alpha, "zorro.tif");
// use a ImageExportInfo if you need more control over the export
exportImageAlpha(image, alpha, ImageExportInfo("zorro.tif").setPixelType("FLOAT"));

{exportImageAlpha}

typedef UInt8 value_t;
ImageExportInfo info("zorro.tif");
if (info.isGrayscale())
{
BasicImage<value_t> alpha;
BasicImage<value_t> image;
...
exportImageAlpha(image.upperLeft(), image.lowerRight(), image.accessor(),
alpha.upperLeft(), alpha.accessor(),
}
else
{
BasicImage<value_t> alpha;
BasicImage<vigra::RGBValue<value_t> > image;
...
exportImageAlpha(image.upperLeft(), image.lowerRight(), image.accessor(),
alpha.upperLeft(), alpha.accessor(),
}

Preconditions

  • The same preconditions hold as for exportImage(), however the only image formats that support alpha channels are
  • TIFF and
  • PNG. In particular, JPEG does not support alpha channels.
  • The alpha channel always is scalar-valued, i.e. comprises a single band.

Definition at line 1043 of file impexalpha.hxx.

References vigra::detail::exportImageAlpha(), and celeste::info().

Referenced by correctRGB(), vigra::exportImageAlpha(), main(), SaveImage(), HuginBase::Nona::detail::saveRemapped(), StackImagesAndMask(), HuginBase::Nona::WeightedStitcher< ImageType, AlphaType >::stitch(), HuginBase::Nona::ReduceStitcher< ImageType, AlphaType >::stitch(), and HuginBase::Nona::SimpleStitcher< ImageType, AlphaType >::stitch().

template<class ImageIterator , class ImageAccessor , class AlphaIterator , class AlphaAccessor >
void vigra::exportImageAlpha ( triple< ImageIterator, ImageIterator, ImageAccessor >  image,
pair< AlphaIterator, AlphaAccessor >  alpha,
ImageExportInfo const &  export_info 
)
inline

Definition at line 1073 of file impexalpha.hxx.

References vigra::exportImageAlpha().

template<class ImageIterator , class ImageAccessor , class AlphaIterator , class AlphaAccessor >
void vigra::importImageAlpha ( const ImageImportInfo &  import_info,
ImageIterator  image_iterator,
ImageAccessor  image_accessor,
AlphaIterator  alpha_iterator,
AlphaAccessor  alpha_accessor 
)
inline

Read the image specified by the given vigra::ImageImportInfo object including its alpha channel.

See importImage() for more information.

Declarations

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
importImageAlpha(ImageImportInfo const & import_info,
MultiArrayView<2, T1, S1> image,
MultiArrayView<2, T2, S2> alpha);
}

{importImageAlpha} pass ImageIterators and DataAccessors :

namespace vigra {
template <class ImageIterator, class ImageAccessor,
class AlphaIterator, class AlphaAccessor>
void
importImageAlpha(const ImageImportInfo& importInfo,
ImageIterator imageIterator, ImageAccessor imageAccessor,
AlphaIterator alphaIterator, AlphaAccessor alphaAccessor)
}

Use argument objects in conjunction with ArgumentObjectFactories :

namespace vigra {
template <class ImageIterator, class ImageAccessor,
class AlphaIterator, class AlphaAccessor>
void
importImageAlpha(const ImageImportInfo& importInfo,
const pair<ImageIterator, ImageAccessor>& image,
const pair<AlphaIterator, AlphaAccessor>& alpha)
}

Usage:

#include <vigra/impexalpha.hxx>
Namespace: vigra

typedef UInt8 value_t;
ImageImportInfo info("zorro.tif");
if (info.isGrayscale())
{
MultiArray<2, value_t> alpha(info.shape());
MultiArray<2, value_t> image(info.shape());
importImageAlpha(info, image, alpha);
...
}
else
{
MultiArray<2, value_t> alpha(info.shape());
MultiArray<2, RGBValue<value_t> > image(info.shape());
importImageAlpha(info, image, alpha);
...
}

{importImageAlpha}

typedef UInt8 value_t;
ImageImportInfo info("zorro.tif");
if (info.isGrayscale())
{
BasicImage<value_t> alpha(info.size());
BasicImage<value_t> image(info.size());
image.upperLeft(), image.accessor(),
alpha.upperLeft(), alpha.accessor());
...
}
else
{
BasicImage<value_t> alpha(info.size());
BasicImage<vigra::RGBValue<value_t> > image(info.size());
image.upperLeft(), image.accessor(),
alpha.upperLeft(), alpha.accessor());
...
}

Preconditions

  • The same preconditions hold as for importImage(), however the only image formats that support alpha channels are
  • TIFF and
  • PNG. In particular, JPEG does not support alpha channels.
  • The alpha channel always is scalar-valued, i.e. comprises a single band.

Definition at line 479 of file impexalpha.hxx.

References vigra::detail::importImageAlpha().

Referenced by PanoDetector::AnalyzeImage(), HuginBase::Nona::FileRemapper< ImageType, AlphaType >::getRemapped(), HuginBase::ImageCache::importAndConvertAlphaImage(), vigra::importImageAlpha(), deghosting::Khan< PixelType >::importRGBImage(), loadAndConvertImage(), LoadAndMergeImages(), LoadGrayImageAndConvert(), LoadGrayImageAndFindLines(), LoadImageAndConvert(), LoadImageAndFindLines(), HuginBase::ImageCache::loadImageSafely(), loadImagesPyr(), main2(), PrintImageInfo(), processImg(), ResaveImageFill(), StackImagesAndMask(), and weightedAverageOfImageFiles().

template<class ImageIterator , class ImageAccessor , class AlphaIterator , class AlphaAccessor >
void vigra::importImageAlpha ( ImageImportInfo const &  import_info,
pair< ImageIterator, ImageAccessor >  image,
pair< AlphaIterator, AlphaAccessor >  alpha 
)
inline

Definition at line 496 of file impexalpha.hxx.

References vigra::importImageAlpha().