36 #ifndef VIGRAEXT_IMPEXALPHA_HXX
37 #define VIGRAEXT_IMPEXALPHA_HXX
45 #include "vigra/imageinfo.hxx"
46 #include "vigra/impex.hxx"
47 #include "vigra/impexbase.hxx"
57 template <
class ValueType,
58 class ImageIterator,
class ImageAccessor,
59 class AlphaIterator,
class AlphaAccessor,
class AlphaScaler>
62 ImageIterator image_iterator, ImageAccessor image_accessor,
63 AlphaIterator alpha_iterator, AlphaAccessor alpha_accessor,
64 const AlphaScaler& alpha_scaler)
66 typedef typename ImageIterator::row_iterator ImageRowIterator;
67 typedef typename AlphaIterator::row_iterator AlphaRowIterator;
69 vigra_precondition(decoder->getNumExtraBands() == 1,
70 "vigra::detail::read_image_band_and_alpha: expecting exactly one alpha band");
71 vigra_precondition(decoder->getNumBands() - decoder->getNumExtraBands() == 1,
72 "vigra::detail::read_image_band_and_alpha: expecting exactly one image band");
74 const unsigned width(decoder->getWidth());
75 const unsigned height(decoder->getHeight());
76 const unsigned offset(decoder->getOffset());
78 for (
unsigned y = 0U; y != height; ++y)
80 decoder->nextScanline();
82 const ValueType* scanline0 =
static_cast<const ValueType*
>(decoder->currentScanlineOfBand(0));
83 const ValueType* scanline1 =
static_cast<const ValueType*
>(decoder->currentScanlineOfBand(1));
85 ImageRowIterator is(image_iterator.rowIterator());
86 const ImageRowIterator is_end(is + width);
87 AlphaRowIterator as(alpha_iterator.rowIterator());
91 image_accessor.set(*scanline0, is);
95 alpha_accessor.set(alpha_scaler(*scanline1), as);
106 template <
class ValueType,
107 class ImageIterator,
class ImageAccessor,
108 class AlphaIterator,
class AlphaAccessor,
class AlphaScaler>
111 ImageIterator image_iterator, ImageAccessor image_accessor,
112 AlphaIterator alpha_iterator, AlphaAccessor alpha_accessor,
113 const AlphaScaler& alpha_scaler)
115 typedef typename ImageIterator::row_iterator ImageRowIterator;
116 typedef typename AlphaIterator::row_iterator AlphaRowIterator;
118 vigra_precondition(decoder->getNumExtraBands() == 1,
119 "vigra::detail::read_image_bands_and_alpha: expecting exactly one alpha band");
120 vigra_precondition(decoder->getNumBands() - decoder->getNumExtraBands() == image_accessor.size(image_iterator),
121 "vigra::detail::read_image_bands_and_alpha: number of channels and image accessor do not match");
123 const unsigned width(decoder->getWidth());
124 const unsigned height(decoder->getHeight());
125 const unsigned offset(decoder->getOffset());
126 const unsigned accessor_size(image_accessor.size(image_iterator));
131 if (accessor_size == 3U)
133 const ValueType* scanline_0;
134 const ValueType* scanline_1;
135 const ValueType* scanline_2;
136 const ValueType* scanline_3;
138 for (
unsigned y = 0U; y != height; ++y)
140 decoder->nextScanline();
142 scanline_0 =
static_cast<const ValueType*
>(decoder->currentScanlineOfBand(0));
143 scanline_1 =
static_cast<const ValueType*
>(decoder->currentScanlineOfBand(1));
144 scanline_2 =
static_cast<const ValueType*
>(decoder->currentScanlineOfBand(2));
145 scanline_3 =
static_cast<const ValueType*
>(decoder->currentScanlineOfBand(3));
147 ImageRowIterator is(image_iterator.rowIterator());
148 const ImageRowIterator is_end(is + width);
149 AlphaRowIterator as(alpha_iterator.rowIterator());
153 image_accessor.setComponent(*scanline_0, is, 0);
154 image_accessor.setComponent(*scanline_1, is, 1);
155 image_accessor.setComponent(*scanline_2, is, 2);
156 alpha_accessor.set(alpha_scaler(*scanline_3), as);
157 scanline_0 += offset;
158 scanline_1 += offset;
159 scanline_2 += offset;
160 scanline_3 += offset;
172 std::vector<const ValueType*> scanlines(accessor_size + 1U);
174 for (
unsigned y = 0U; y != height; ++y)
176 decoder->nextScanline();
178 for (
unsigned i = 0U; i != accessor_size + 1U; ++i)
180 scanlines[i] =
static_cast<const ValueType*
>(decoder->currentScanlineOfBand(i));
183 ImageRowIterator is(image_iterator.rowIterator());
184 const ImageRowIterator is_end(is + width);
185 AlphaRowIterator as(alpha_iterator.rowIterator());
189 for (
unsigned i = 0U; i != accessor_size; ++i)
191 image_accessor.setComponent(*scanlines[i], is, static_cast<int>(i));
192 scanlines[i] += offset;
196 alpha_accessor.set(*scanlines[accessor_size], as);
197 scanlines[accessor_size] += offset;
212 threshold_((source.second - source.first)/255.0),
213 zero_(destination.first),
214 max_(destination.second)
218 template <
typename T>
237 template <
class ImageIterator,
class ImageAccessor,
238 class AlphaIterator,
class AlphaAccessor>
241 ImageIterator image_iterator, ImageAccessor image_accessor,
242 AlphaIterator alpha_iterator, AlphaAccessor alpha_accessor,
245 typedef typename ImageAccessor::value_type ImageValueType;
246 typedef typename AlphaAccessor::value_type AlphaValueType;
248 VIGRA_UNIQUE_PTR<Decoder> decoder(vigra::decoder(import_info));
254 switch (pixel_t_of_string(decoder->getPixelType()))
257 read_image_band_and_alpha<UInt8>(decoder.get(),
258 image_iterator, image_accessor,
259 alpha_iterator, alpha_accessor, alpha_rescaler);
261 case UNSIGNED_INT_16:
262 read_image_band_and_alpha<UInt16>(decoder.get(),
263 image_iterator, image_accessor,
264 alpha_iterator, alpha_accessor, alpha_rescaler);
266 case UNSIGNED_INT_32:
267 read_image_band_and_alpha<UInt32>(decoder.get(),
268 image_iterator, image_accessor,
269 alpha_iterator, alpha_accessor, alpha_rescaler);
272 read_image_band_and_alpha<Int16>(decoder.get(),
273 image_iterator, image_accessor,
274 alpha_iterator, alpha_accessor, alpha_rescaler);
277 read_image_band_and_alpha<Int32>(decoder.get(),
278 image_iterator, image_accessor,
279 alpha_iterator, alpha_accessor, alpha_rescaler);
282 read_image_band_and_alpha<float>(decoder.get(),
283 image_iterator, image_accessor,
284 alpha_iterator, alpha_accessor, alpha_rescaler);
287 read_image_band_and_alpha<double>(decoder.get(),
288 image_iterator, image_accessor,
289 alpha_iterator, alpha_accessor, alpha_rescaler);
292 vigra_fail(
"vigra::detail::importImageAlpha<scalar>: not reached");
299 template <
class ImageIterator,
class ImageAccessor,
300 class AlphaIterator,
class AlphaAccessor>
303 ImageIterator image_iterator, ImageAccessor image_accessor,
304 AlphaIterator alpha_iterator, AlphaAccessor alpha_accessor,
307 typedef typename ImageAccessor::value_type ImageValueType;
308 typedef typename AlphaAccessor::value_type AlphaValueType;
310 VIGRA_UNIQUE_PTR<Decoder> decoder(vigra::decoder(import_info));
316 switch (pixel_t_of_string(decoder->getPixelType()))
319 read_image_bands_and_alpha<UInt8>(decoder.get(),
320 image_iterator, image_accessor,
321 alpha_iterator, alpha_accessor, alpha_rescaler);
323 case UNSIGNED_INT_16:
324 read_image_bands_and_alpha<UInt16>(decoder.get(),
325 image_iterator, image_accessor,
326 alpha_iterator, alpha_accessor, alpha_rescaler);
328 case UNSIGNED_INT_32:
329 read_image_bands_and_alpha<UInt32>(decoder.get(),
330 image_iterator, image_accessor,
331 alpha_iterator, alpha_accessor, alpha_rescaler);
334 read_image_bands_and_alpha<Int16>(decoder.get(),
335 image_iterator, image_accessor,
336 alpha_iterator, alpha_accessor, alpha_rescaler);
339 read_image_bands_and_alpha<Int32>(decoder.get(),
340 image_iterator, image_accessor,
341 alpha_iterator, alpha_accessor, alpha_rescaler);
344 read_image_bands_and_alpha<float>(decoder.get(),
345 image_iterator, image_accessor,
346 alpha_iterator, alpha_accessor, alpha_rescaler);
349 read_image_bands_and_alpha<double>(decoder.get(),
350 image_iterator, image_accessor,
351 alpha_iterator, alpha_accessor, alpha_rescaler);
354 vigra_fail(
"vigra::detail::importImageAlpha<scalar>: not reached");
476 template <
class ImageIterator,
class ImageAccessor,
477 class AlphaIterator,
class AlphaAccessor>
480 ImageIterator image_iterator, ImageAccessor image_accessor,
481 AlphaIterator alpha_iterator, AlphaAccessor alpha_accessor)
483 typedef typename ImageAccessor::value_type ImageValueType;
484 typedef typename vigra::NumericTraits<ImageValueType>::isScalar is_scalar;
487 image_iterator, image_accessor,
488 alpha_iterator, alpha_accessor,
493 template <
class ImageIterator,
class ImageAccessor,
494 class AlphaIterator,
class AlphaAccessor>
497 pair<ImageIterator, ImageAccessor> image,
498 pair<AlphaIterator, AlphaAccessor> alpha)
501 image.first, image.second,
502 alpha.first, alpha.second);
507 template<
class ValueType,
508 class ImageIterator,
class ImageAccessor,
class ImageScaler,
509 class AlphaIterator,
class AlphaAccessor,
class AlphaScaler>
512 ImageIterator image_upper_left, ImageIterator image_lower_right, ImageAccessor image_accessor,
513 const ImageScaler& image_scaler,
514 AlphaIterator alpha_upper_left, AlphaAccessor alpha_accessor,
515 const AlphaScaler& alpha_scaler)
517 typedef typename ImageIterator::row_iterator ImageRowIterator;
518 typedef typename AlphaIterator::row_iterator AlphaRowIterator;
520 typedef detail::RequiresExplicitCast<ValueType> explicit_cast;
522 vigra_precondition(image_lower_right.x >= image_upper_left.x,
523 "vigra::detail::write_image_band_and_alpha: negative width");
524 vigra_precondition(image_lower_right.y >= image_upper_left.y,
525 "vigra::detail::write_image_band_and_alpha: negative height");
527 const unsigned width(static_cast<unsigned>(image_lower_right.x - image_upper_left.x));
528 const unsigned height(static_cast<unsigned>(image_lower_right.y - image_upper_left.y));
530 encoder->setWidth(width);
531 encoder->setHeight(height);
532 encoder->setNumBands(1 + 1);
533 encoder->finalizeSettings();
535 const unsigned offset(encoder->getOffset());
540 ImageIterator image_iterator(image_upper_left);
541 AlphaIterator alpha_iterator(alpha_upper_left);
543 for (
unsigned y = 0U; y != height; ++y)
545 ValueType* scanline0 =
static_cast<ValueType*
>(encoder->currentScanlineOfBand(0));
546 ValueType* scanline1 =
static_cast<ValueType*
>(encoder->currentScanlineOfBand(1));
548 ImageRowIterator is(image_iterator.rowIterator());
549 const ImageRowIterator is_end(is + width);
550 AlphaRowIterator as(alpha_iterator.rowIterator());
554 *scanline0 = explicit_cast::cast(image_scaler(image_accessor(is)));
558 *scanline1 = explicit_cast::cast(alpha_scaler(alpha_accessor(as)));
563 encoder->nextScanline();
571 template<
class ValueType,
572 class ImageIterator,
class ImageAccessor,
class ImageScaler,
573 class AlphaIterator,
class AlphaAccessor,
class AlphaScaler>
576 ImageIterator image_upper_left, ImageIterator image_lower_right, ImageAccessor image_accessor,
577 const ImageScaler& image_scaler,
578 AlphaIterator alpha_upper_left, AlphaAccessor alpha_accessor,
579 const AlphaScaler& alpha_scaler)
581 typedef typename ImageIterator::row_iterator ImageRowIterator;
582 typedef typename AlphaIterator::row_iterator AlphaRowIterator;
583 typedef detail::RequiresExplicitCast<ValueType> explicit_cast;
585 vigra_precondition(image_lower_right.x >= image_upper_left.x,
586 "vigra::detail::write_image_bands_and_alpha: negative width");
587 vigra_precondition(image_lower_right.y >= image_upper_left.y,
588 "vigra::detail::write_image_bands_and_alpha: negative height");
590 const unsigned width(static_cast<unsigned>(image_lower_right.x - image_upper_left.x));
591 const unsigned height(static_cast<unsigned>(image_lower_right.y - image_upper_left.y));
592 const unsigned accessor_size(image_accessor.size(image_upper_left));
594 encoder->setWidth(width);
595 encoder->setHeight(height);
596 encoder->setNumBands(accessor_size + 1U);
597 encoder->finalizeSettings();
599 const unsigned offset(encoder->getOffset());
604 ImageIterator image_iterator(image_upper_left);
605 AlphaIterator alpha_iterator(alpha_upper_left);
610 if (accessor_size == 3U)
612 ValueType* scanline_0;
613 ValueType* scanline_1;
614 ValueType* scanline_2;
615 ValueType* scanline_3;
617 for (
unsigned y = 0U; y != height; ++y)
619 scanline_0 =
static_cast<ValueType*
>(encoder->currentScanlineOfBand(0));
620 scanline_1 =
static_cast<ValueType*
>(encoder->currentScanlineOfBand(1));
621 scanline_2 =
static_cast<ValueType*
>(encoder->currentScanlineOfBand(2));
622 scanline_3 =
static_cast<ValueType*
>(encoder->currentScanlineOfBand(3));
624 ImageRowIterator is(image_iterator.rowIterator());
625 const ImageRowIterator is_end(is + width);
626 AlphaRowIterator as(alpha_iterator.rowIterator());
630 *scanline_0 = explicit_cast::cast(image_scaler(image_accessor.getComponent(is, 0)));
631 *scanline_1 = explicit_cast::cast(image_scaler(image_accessor.getComponent(is, 1)));
632 *scanline_2 = explicit_cast::cast(image_scaler(image_accessor.getComponent(is, 2)));
633 *scanline_3 = explicit_cast::cast(alpha_scaler(alpha_accessor(as)));
634 scanline_0 += offset;
635 scanline_1 += offset;
636 scanline_2 += offset;
637 scanline_3 += offset;
643 encoder->nextScanline();
651 std::vector<ValueType*> scanlines(accessor_size + 1U);
653 for (
unsigned y = 0U; y != height; ++y)
655 for (
unsigned i = 0U; i != accessor_size + 1U; ++i)
657 scanlines[i] =
static_cast<ValueType*
>(encoder->currentScanlineOfBand(i));
660 ImageRowIterator is(image_iterator.rowIterator());
661 const ImageRowIterator is_end(is + width);
662 AlphaRowIterator as(alpha_iterator.rowIterator());
666 for (
unsigned i = 0U; i != accessor_size; ++i)
668 *scanlines[i] = explicit_cast::cast(image_scaler(image_accessor.getComponent(is, static_cast<int>(i))));
669 scanlines[i] += offset;
673 *scanlines[accessor_size] = explicit_cast::cast(alpha_scaler(alpha_accessor(as)));
674 scanlines[accessor_size] += offset;
678 encoder->nextScanline();
687 template <
class ImageIterator,
class ImageAccessor,
688 class AlphaIterator,
class AlphaAccessor>
690 exportImageAlpha(ImageIterator image_upper_left, ImageIterator image_lower_right, ImageAccessor image_accessor,
691 AlphaIterator alpha_upper_left, AlphaAccessor alpha_accessor,
692 const ImageExportInfo& export_info,
695 typedef typename AlphaAccessor::value_type AlphaValueType;
697 VIGRA_UNIQUE_PTR<Encoder> encoder(vigra::encoder(export_info));
699 const std::string pixel_type(export_info.getPixelType());
700 const pixel_t type(pixel_t_of_string(pixel_type));
703 encoder->setPixelType(pixel_type);
709 if (alpha_source_range.first != mask_destination_range.first || alpha_source_range.second != mask_destination_range.second)
711 const linear_transform alpha_rescaler(alpha_source_range, mask_destination_range);
715 write_image_band_and_alpha<UInt8>(encoder.get(),
716 image_upper_left, image_lower_right, image_accessor, identity(),
717 alpha_upper_left, alpha_accessor, alpha_rescaler);
719 case UNSIGNED_INT_16:
720 write_image_band_and_alpha<UInt16>(encoder.get(),
721 image_upper_left, image_lower_right, image_accessor, identity(),
722 alpha_upper_left, alpha_accessor, alpha_rescaler);
724 case UNSIGNED_INT_32:
725 write_image_band_and_alpha<UInt32>(encoder.get(),
726 image_upper_left, image_lower_right, image_accessor, identity(),
727 alpha_upper_left, alpha_accessor, alpha_rescaler);
730 write_image_band_and_alpha<Int16>(encoder.get(),
731 image_upper_left, image_lower_right, image_accessor, identity(),
732 alpha_upper_left, alpha_accessor, alpha_rescaler);
735 write_image_band_and_alpha<Int32>(encoder.get(),
736 image_upper_left, image_lower_right, image_accessor, identity(),
737 alpha_upper_left, alpha_accessor, alpha_rescaler);
740 write_image_band_and_alpha<float>(encoder.get(),
741 image_upper_left, image_lower_right, image_accessor, identity(),
742 alpha_upper_left, alpha_accessor, alpha_rescaler);
745 write_image_band_and_alpha<double>(encoder.get(),
746 image_upper_left, image_lower_right, image_accessor, identity(),
747 alpha_upper_left, alpha_accessor, alpha_rescaler);
750 vigra_fail(
"vigra::detail::exportImageAlpha<scalar>: not reached");
758 write_image_band_and_alpha<UInt8>(encoder.get(),
759 image_upper_left, image_lower_right, image_accessor, identity(),
760 alpha_upper_left, alpha_accessor, identity());
762 case UNSIGNED_INT_16:
763 write_image_band_and_alpha<UInt16>(encoder.get(),
764 image_upper_left, image_lower_right, image_accessor, identity(),
765 alpha_upper_left, alpha_accessor, identity());
767 case UNSIGNED_INT_32:
768 write_image_band_and_alpha<UInt32>(encoder.get(),
769 image_upper_left, image_lower_right, image_accessor, identity(),
770 alpha_upper_left, alpha_accessor, identity());
773 write_image_band_and_alpha<Int16>(encoder.get(),
774 image_upper_left, image_lower_right, image_accessor, identity(),
775 alpha_upper_left, alpha_accessor, identity());
778 write_image_band_and_alpha<Int32>(encoder.get(),
779 image_upper_left, image_lower_right, image_accessor, identity(),
780 alpha_upper_left, alpha_accessor, identity());
783 write_image_band_and_alpha<float>(encoder.get(),
784 image_upper_left, image_lower_right, image_accessor, identity(),
785 alpha_upper_left, alpha_accessor, identity());
788 write_image_band_and_alpha<double>(encoder.get(),
789 image_upper_left, image_lower_right, image_accessor, identity(),
790 alpha_upper_left, alpha_accessor, identity());
793 vigra_fail(
"vigra::detail::exportImageAlpha<scalar>: not reached");
801 template <
class ImageIterator,
class ImageAccessor,
802 class AlphaIterator,
class AlphaAccessor>
804 exportImageAlpha(ImageIterator image_upper_left, ImageIterator image_lower_right, ImageAccessor image_accessor,
805 AlphaIterator alpha_upper_left, AlphaAccessor alpha_accessor,
806 const ImageExportInfo& export_info,
809 typedef typename AlphaAccessor::value_type AlphaValueType;
811 VIGRA_UNIQUE_PTR<Encoder> encoder(vigra::encoder(export_info));
813 const std::string pixel_type(export_info.getPixelType());
814 const pixel_t type(pixel_t_of_string(pixel_type));
815 encoder->setPixelType(pixel_type);
817 vigra_precondition(isBandNumberSupported(encoder->getFileType(), image_accessor.size(image_upper_left) + 1U),
818 "exportImageAlpha(): file format does not support requested number of bands (color channels)");
826 if (alpha_source_range.first != mask_destination_range.first || alpha_source_range.second != mask_destination_range.second)
828 const linear_transform alpha_rescaler(alpha_source_range, mask_destination_range);
832 write_image_bands_and_alpha<UInt8>(encoder.get(),
833 image_upper_left, image_lower_right, image_accessor, identity(),
834 alpha_upper_left, alpha_accessor, alpha_rescaler);
836 case UNSIGNED_INT_16:
837 write_image_bands_and_alpha<UInt16>(encoder.get(),
838 image_upper_left, image_lower_right, image_accessor, identity(),
839 alpha_upper_left, alpha_accessor, alpha_rescaler);
841 case UNSIGNED_INT_32:
842 write_image_bands_and_alpha<UInt32>(encoder.get(),
843 image_upper_left, image_lower_right, image_accessor, identity(),
844 alpha_upper_left, alpha_accessor, alpha_rescaler);
847 write_image_bands_and_alpha<Int16>(encoder.get(),
848 image_upper_left, image_lower_right, image_accessor, identity(),
849 alpha_upper_left, alpha_accessor, alpha_rescaler);
852 write_image_bands_and_alpha<Int32>(encoder.get(),
853 image_upper_left, image_lower_right, image_accessor, identity(),
854 alpha_upper_left, alpha_accessor, alpha_rescaler);
857 write_image_bands_and_alpha<float>(encoder.get(),
858 image_upper_left, image_lower_right, image_accessor, identity(),
859 alpha_upper_left, alpha_accessor, alpha_rescaler);
862 write_image_bands_and_alpha<double>(encoder.get(),
863 image_upper_left, image_lower_right, image_accessor, identity(),
864 alpha_upper_left, alpha_accessor, alpha_rescaler);
867 vigra_fail(
"vigra::detail::exportImageAlpha<scalar>: not reached");
875 write_image_bands_and_alpha<UInt8>(encoder.get(),
876 image_upper_left, image_lower_right, image_accessor, identity(),
877 alpha_upper_left, alpha_accessor, identity());
879 case UNSIGNED_INT_16:
880 write_image_bands_and_alpha<UInt16>(encoder.get(),
881 image_upper_left, image_lower_right, image_accessor, identity(),
882 alpha_upper_left, alpha_accessor, identity());
884 case UNSIGNED_INT_32:
885 write_image_bands_and_alpha<UInt32>(encoder.get(),
886 image_upper_left, image_lower_right, image_accessor, identity(),
887 alpha_upper_left, alpha_accessor, identity());
890 write_image_bands_and_alpha<Int16>(encoder.get(),
891 image_upper_left, image_lower_right, image_accessor, identity(),
892 alpha_upper_left, alpha_accessor, identity());
895 write_image_bands_and_alpha<Int32>(encoder.get(),
896 image_upper_left, image_lower_right, image_accessor, identity(),
897 alpha_upper_left, alpha_accessor, identity());
900 write_image_bands_and_alpha<float>(encoder.get(),
901 image_upper_left, image_lower_right, image_accessor, identity(),
902 alpha_upper_left, alpha_accessor, identity());
905 write_image_bands_and_alpha<double>(encoder.get(),
906 image_upper_left, image_lower_right, image_accessor, identity(),
907 alpha_upper_left, alpha_accessor, identity());
910 vigra_fail(
"vigra::detail::exportImageAlpha<non-scalar>: not reached");
1040 template <
class ImageIterator,
class ImageAccessor,
1041 class AlphaIterator,
class AlphaAccessor>
1043 exportImageAlpha(ImageIterator image_upper_left, ImageIterator image_lower_right, ImageAccessor image_accessor,
1044 AlphaIterator alpha_upper_left, AlphaAccessor alpha_accessor,
1045 const ImageExportInfo& export_info)
1047 typedef typename ImageAccessor::value_type ImageValueType;
1048 typedef typename vigra::NumericTraits<ImageValueType>::isScalar is_scalar;
1053 alpha_upper_left, alpha_accessor,
1057 catch (Encoder::TIFFCompressionException&)
1059 ImageExportInfo
info(export_info);
1061 info.setCompression(
"");
1063 alpha_upper_left, alpha_accessor,
1070 template <
class ImageIterator,
class ImageAccessor,
1071 class AlphaIterator,
class AlphaAccessor>
1074 pair<AlphaIterator, AlphaAccessor> alpha,
1075 ImageExportInfo
const & export_info)
1078 alpha.first, alpha.second,
1086 #endif // VIGRAEXT_IMPEXALPHA_HXX
double getMaxValForPixelType(const std::string &v)
void write_image_bands_and_alpha(Encoder *encoder, ImageIterator image_upper_left, ImageIterator image_lower_right, ImageAccessor image_accessor, const ImageScaler &image_scaler, AlphaIterator alpha_upper_left, AlphaAccessor alpha_accessor, const AlphaScaler &alpha_scaler)
void 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.
void read_image_band_and_alpha(Decoder *decoder, ImageIterator image_iterator, ImageAccessor image_accessor, AlphaIterator alpha_iterator, AlphaAccessor alpha_accessor, const AlphaScaler &alpha_scaler)
functions to manage ROI's
void exportImageAlpha(ImageIterator image_upper_left, ImageIterator image_lower_right, ImageAccessor image_accessor, AlphaIterator alpha_upper_left, AlphaAccessor alpha_accessor, const ImageExportInfo &export_info, VigraTrueType)
void importImageAlpha(const ImageImportInfo &import_info, ImageIterator image_iterator, ImageAccessor image_accessor, AlphaIterator alpha_iterator, AlphaAccessor alpha_accessor, VigraTrueType)
void 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...
void read_image_bands_and_alpha(Decoder *decoder, ImageIterator image_iterator, ImageAccessor image_accessor, AlphaIterator alpha_iterator, AlphaAccessor alpha_accessor, const AlphaScaler &alpha_scaler)
static void info(const char *fmt,...)
void write_image_band_and_alpha(Encoder *encoder, ImageIterator image_upper_left, ImageIterator image_lower_right, ImageAccessor image_accessor, const ImageScaler &image_scaler, AlphaIterator alpha_upper_left, AlphaAccessor alpha_accessor, const AlphaScaler &alpha_scaler)