ClassesClassesClassesClasses | | | | Operators

interleave_channelsinterleave_channelsInterleaveChannelsinterleave_channelsInterleaveChannelsInterleaveChannels (Operator)

Name

interleave_channelsinterleave_channelsInterleaveChannelsinterleave_channelsInterleaveChannelsInterleaveChannels — Create an interleaved image from a multichannel image.

Signature

interleave_channels(MultichannelImage : InterleavedImage : PixelFormat, RowBytes, Alpha : )

Herror interleave_channels(const Hobject MultichannelImage, Hobject* InterleavedImage, const char* PixelFormat, const char* RowBytes, const Hlong Alpha)

Herror T_interleave_channels(const Hobject MultichannelImage, Hobject* InterleavedImage, const Htuple PixelFormat, const Htuple RowBytes, const Htuple Alpha)

Herror interleave_channels(Hobject MultichannelImage, Hobject* InterleavedImage, const HTuple& PixelFormat, const HTuple& RowBytes, const HTuple& Alpha)

HImage HImage::InterleaveChannels(const HTuple& PixelFormat, const HTuple& RowBytes, const HTuple& Alpha) const

void InterleaveChannels(const HObject& MultichannelImage, HObject* InterleavedImage, const HTuple& PixelFormat, const HTuple& RowBytes, const HTuple& Alpha)

HImage HImage::InterleaveChannels(const HString& PixelFormat, const HTuple& RowBytes, Hlong Alpha) const

HImage HImage::InterleaveChannels(const HString& PixelFormat, const HString& RowBytes, Hlong Alpha) const

HImage HImage::InterleaveChannels(const char* PixelFormat, const char* RowBytes, Hlong Alpha) const

void HOperatorSetX.InterleaveChannels(
[in] IHUntypedObjectX* MultichannelImage, [out] IHUntypedObjectX*InterleavedImage, [in] VARIANT PixelFormat, [in] VARIANT RowBytes, [in] VARIANT Alpha)

IHImageX* HImageX.InterleaveChannels(
[in] BSTR PixelFormat, [in] VARIANT RowBytes, [in] Hlong Alpha)

static void HOperatorSet.InterleaveChannels(HObject multichannelImage, out HObject interleavedImage, HTuple pixelFormat, HTuple rowBytes, HTuple alpha)

HImage HImage.InterleaveChannels(string pixelFormat, HTuple rowBytes, int alpha)

HImage HImage.InterleaveChannels(string pixelFormat, string rowBytes, int alpha)

Description

The operator interleave_channelsinterleave_channelsInterleaveChannelsinterleave_channelsInterleaveChannelsInterleaveChannels creates an InterleavedImageInterleavedImageInterleavedImageInterleavedImageInterleavedImageinterleavedImage from the input MultichannelImageMultichannelImageMultichannelImageMultichannelImageMultichannelImagemultichannelImage containing three or four channels. This is useful to prepare a color image for visualization, e.g., by converting it to a .NET Bitmap.

Pixelformat

The format of the pixels in InterleavedImageInterleavedImageInterleavedImageInterleavedImageInterleavedImageinterleavedImage is specified with PixelFormatPixelFormatPixelFormatPixelFormatPixelFormatpixelFormat. Possible formats are 'rgb'"rgb""rgb""rgb""rgb""rgb",'rgba'"rgba""rgba""rgba""rgba""rgba", 'argb'"argb""argb""argb""argb""argb",'bgr'"bgr""bgr""bgr""bgr""bgr",'bgra'"bgra""bgra""bgra""bgra""bgra", and 'abgr'"abgr""abgr""abgr""abgr""abgr", where 'a' denotes the 4th ('alpha') channel. Be aware that, in contrast to gen_image_interleavedgen_image_interleavedGenImageInterleavedgen_image_interleavedGenImageInterleavedGenImageInterleaved, LittleEndian byte ordering is used in PixelFormatPixelFormatPixelFormatPixelFormatPixelFormatpixelFormat.

Alpha channel

The alpha channel can be defined in the following ways:

channels domain
3 not specified/full Value of AlphaAlphaAlphaAlphaAlphaalpha is set for the complete image.
3 reduced Inside the domain: alpha is set to AlphaAlphaAlphaAlphaAlphaalpha. Outside the domain: alpha is set to zero.
4 Alpha is set to the respective value of the fourth channel, domain and AlphaAlphaAlphaAlphaAlphaalpha are ignored.

Row alignement

The number of bytes between the beginning of two rows in the output image can be set in RowBytesRowBytesRowBytesRowBytesRowBytesrowBytes, e.g. to fulfill specific alignment criteria. Set RowBytesRowBytesRowBytesRowBytesRowBytesrowBytes to 'match'"match""match""match""match""match" if no additional padding is required. RowBytesRowBytesRowBytesRowBytesRowBytesrowBytes must be at least the number of bytes in PixelFormatPixelFormatPixelFormatPixelFormatPixelFormatpixelFormat times the width of MultichannelImageMultichannelImageMultichannelImageMultichannelImageMultichannelImagemultichannelImage.

Parallelization

Parameters

MultichannelImageMultichannelImageMultichannelImageMultichannelImageMultichannelImagemultichannelImage (input_object)  multichannel-image objectHImageHImageHImageHImageXHobject (byte)

Input multichannel image.

InterleavedImageInterleavedImageInterleavedImageInterleavedImageInterleavedImageinterleavedImage (output_object)  singlechannelimage objectHImageHImageHImageHImageXHobject * (byte)

Output interleaved image.

PixelFormatPixelFormatPixelFormatPixelFormatPixelFormatpixelFormat (input_control)  string HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Target format for InterleavedImage.

Default value: 'rgba' "rgba" "rgba" "rgba" "rgba" "rgba"

List of values: 'abgr'"abgr""abgr""abgr""abgr""abgr", 'argb'"argb""argb""argb""argb""argb", 'bgr'"bgr""bgr""bgr""bgr""bgr", 'bgra'"bgra""bgra""bgra""bgra""bgra", 'rgb'"rgb""rgb""rgb""rgb""rgb", 'rgba'"rgba""rgba""rgba""rgba""rgba"

RowBytesRowBytesRowBytesRowBytesRowBytesrowBytes (input_control)  integer HTupleHTupleHTupleVARIANTHtuple (string / integer) (string / int / long) (HString / Hlong) (char* / Hlong) (BSTR / Hlong) (char* / Hlong)

Number of bytes in a row of the output image.

Default value: 'match' "match" "match" "match" "match" "match"

Suggested values: 'match'"match""match""match""match""match"

AlphaAlphaAlphaAlphaAlphaalpha (input_control)  integer HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Alpha value for three channel input images.

Default value: 255

Suggested values: 255, 0

Example (C#)

  HTuple type, width, height;
  HImage patras = new HImage("patras");

  HImage interleaved = patras.InterleaveChannels("argb", "match", 255);
  IntPtr ptr = interleaved.GetImagePointer1(out type, out width, out height);
          
  Image img = new Bitmap(width/4, height, width,
                         PixelFormat.Format32bppArgb, ptr);

  pictureBox.Image = img;
	

See also

gen_image_interleavedgen_image_interleavedGenImageInterleavedgen_image_interleavedGenImageInterleavedGenImageInterleaved

Module

Foundation


ClassesClassesClassesClasses | | | | Operators