interleave_channelsinterleave_channelsInterleaveChannelsInterleaveChannelsinterleave_channels (算子)

名称

interleave_channelsinterleave_channelsInterleaveChannelsInterleaveChannelsinterleave_channels — 从多通道图像创建交错图像。

签名

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)

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

HImage HImage::InterleaveChannels(const wchar_t* PixelFormat, const wchar_t* RowBytes, Hlong Alpha) const   ( Windows only)

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)

def interleave_channels(multichannel_image: HObject, pixel_format: str, row_bytes: Union[str, int], alpha: int) -> HObject

描述

算子 interleave_channelsinterleave_channelsInterleaveChannelsInterleaveChannelsInterleaveChannelsinterleave_channels creates an InterleavedImageInterleavedImageInterleavedImageInterleavedImageinterleavedImageinterleaved_image from the input MultichannelImageMultichannelImageMultichannelImageMultichannelImagemultichannelImagemultichannel_image containing three or four channels. This is useful to prepare a color image for visualization, e.g., by converting it to a .NET Bitmap.

Pixel format

The format of the pixels in InterleavedImageInterleavedImageInterleavedImageInterleavedImageinterleavedImageinterleaved_image is specified with PixelFormatPixelFormatPixelFormatPixelFormatpixelFormatpixel_format. 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" for BYTE images and 'rgb48'"rgb48""rgb48""rgb48""rgb48""rgb48", 'bgr48'"bgr48""bgr48""bgr48""bgr48""bgr48", 'rgba64'"rgba64""rgba64""rgba64""rgba64""rgba64", 'bgra64'"bgra64""bgra64""bgra64""bgra64""bgra64", 'argb64'"argb64""argb64""argb64""argb64""argb64" and 'abgr64'"abgr64""abgr64""abgr64""abgr64""abgr64" for UINT2 images, where 'a' denotes the 4th ('alpha') channel. Be aware that, in contrast to gen_image_interleavedgen_image_interleavedGenImageInterleavedGenImageInterleavedGenImageInterleavedgen_image_interleaved, LittleEndian byte ordering is used in PixelFormatPixelFormatPixelFormatPixelFormatpixelFormatpixel_format

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 alignment

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

执行信息

参数

MultichannelImageMultichannelImageMultichannelImageMultichannelImagemultichannelImagemultichannel_image (输入对象)  multichannel-image objectHImageHObjectHImageHobject (byte)

Input multichannel image.

InterleavedImageInterleavedImageInterleavedImageInterleavedImageinterleavedImageinterleaved_image (输出对象)  singlechannelimage objectHImageHObjectHImageHobject * (byte)

Output interleaved image.

PixelFormatPixelFormatPixelFormatPixelFormatpixelFormatpixel_format (输入控制)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Target format for InterleavedImage.

默认值: 'rgba' "rgba" "rgba" "rgba" "rgba" "rgba"

值列表: 'abgr'"abgr""abgr""abgr""abgr""abgr", 'abgr64'"abgr64""abgr64""abgr64""abgr64""abgr64", 'argb'"argb""argb""argb""argb""argb", 'argb64'"argb64""argb64""argb64""argb64""argb64", 'bgr'"bgr""bgr""bgr""bgr""bgr", 'bgr48'"bgr48""bgr48""bgr48""bgr48""bgr48", 'bgra'"bgra""bgra""bgra""bgra""bgra", 'bgra64'"bgra64""bgra64""bgra64""bgra64""bgra64", 'rgb'"rgb""rgb""rgb""rgb""rgb", 'rgb48'"rgb48""rgb48""rgb48""rgb48""rgb48", 'rgba'"rgba""rgba""rgba""rgba""rgba", 'rgba64'"rgba64""rgba64""rgba64""rgba64""rgba64"

RowBytesRowBytesRowBytesRowBytesrowBytesrow_bytes (输入控制)  integer HTupleUnion[str, int]HTupleHtuple (string / integer) (string / int / long) (HString / Hlong) (char* / Hlong)

Number of bytes in a row of the output image.

默认值: 'match' "match" "match" "match" "match" "match"

建议值: 'match'"match""match""match""match""match"

AlphaAlphaAlphaAlphaalphaalpha (输入控制)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Alpha value for three channel input images.

默认值: 255

建议值: 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;

另见

gen_image_interleavedgen_image_interleavedGenImageInterleavedGenImageInterleavedGenImageInterleavedgen_image_interleaved

模块

基础