ClassesClassesClassesClasses | | | | Operators

gen_image_interleavedgen_image_interleavedGenImageInterleavedgen_image_interleavedGenImageInterleavedGenImageInterleaved (Operator)

Name

gen_image_interleavedgen_image_interleavedGenImageInterleavedgen_image_interleavedGenImageInterleavedGenImageInterleaved — Create a three-channel image from a pointer to the interleaved pixels.

Signature

gen_image_interleaved( : ImageRGB : PixelPointer, ColorFormat, OriginalWidth, OriginalHeight, Alignment, Type, ImageWidth, ImageHeight, StartRow, StartColumn, BitsPerChannel, BitShift : )

Herror gen_image_interleaved(Hobject* ImageRGB, const Hlong PixelPointer, const char* ColorFormat, const Hlong OriginalWidth, const Hlong OriginalHeight, const Hlong Alignment, const char* Type, const Hlong ImageWidth, const Hlong ImageHeight, const Hlong StartRow, const Hlong StartColumn, const Hlong BitsPerChannel, const Hlong BitShift)

Herror T_gen_image_interleaved(Hobject* ImageRGB, const Htuple PixelPointer, const Htuple ColorFormat, const Htuple OriginalWidth, const Htuple OriginalHeight, const Htuple Alignment, const Htuple Type, const Htuple ImageWidth, const Htuple ImageHeight, const Htuple StartRow, const Htuple StartColumn, const Htuple BitsPerChannel, const Htuple BitShift)

Herror gen_image_interleaved(Hobject* ImageRGB, const HTuple& PixelPointer, const HTuple& ColorFormat, const HTuple& OriginalWidth, const HTuple& OriginalHeight, const HTuple& Alignment, const HTuple& Type, const HTuple& ImageWidth, const HTuple& ImageHeight, const HTuple& StartRow, const HTuple& StartColumn, const HTuple& BitsPerChannel, const HTuple& BitShift)

HImage HImage::GenImageInterleaved(const HTuple& PixelPointer, const HTuple& ColorFormat, const HTuple& OriginalWidth, const HTuple& OriginalHeight, const HTuple& Alignment, const HTuple& Type, const HTuple& ImageWidth, const HTuple& ImageHeight, const HTuple& StartRow, const HTuple& StartColumn, const HTuple& BitsPerChannel, const HTuple& BitShift)

void GenImageInterleaved(HObject* ImageRGB, const HTuple& PixelPointer, const HTuple& ColorFormat, const HTuple& OriginalWidth, const HTuple& OriginalHeight, const HTuple& Alignment, const HTuple& Type, const HTuple& ImageWidth, const HTuple& ImageHeight, const HTuple& StartRow, const HTuple& StartColumn, const HTuple& BitsPerChannel, const HTuple& BitShift)

void HImage::GenImageInterleaved(void* PixelPointer, const HString& ColorFormat, Hlong OriginalWidth, Hlong OriginalHeight, Hlong Alignment, const HString& Type, Hlong ImageWidth, Hlong ImageHeight, Hlong StartRow, Hlong StartColumn, Hlong BitsPerChannel, Hlong BitShift)

void HImage::GenImageInterleaved(void* PixelPointer, const char* ColorFormat, Hlong OriginalWidth, Hlong OriginalHeight, Hlong Alignment, const char* Type, Hlong ImageWidth, Hlong ImageHeight, Hlong StartRow, Hlong StartColumn, Hlong BitsPerChannel, Hlong BitShift)

void HOperatorSetX.GenImageInterleaved(
[out] IHUntypedObjectX*ImageRGB, [in] VARIANT PixelPointer, [in] VARIANT ColorFormat, [in] VARIANT OriginalWidth, [in] VARIANT OriginalHeight, [in] VARIANT Alignment, [in] VARIANT Type, [in] VARIANT ImageWidth, [in] VARIANT ImageHeight, [in] VARIANT StartRow, [in] VARIANT StartColumn, [in] VARIANT BitsPerChannel, [in] VARIANT BitShift)

void HImageX.GenImageInterleaved(
[in] Hlong PixelPointer, [in] BSTR ColorFormat, [in] Hlong OriginalWidth, [in] Hlong OriginalHeight, [in] Hlong Alignment, [in] BSTR Type, [in] Hlong ImageWidth, [in] Hlong ImageHeight, [in] Hlong StartRow, [in] Hlong StartColumn, [in] Hlong BitsPerChannel, [in] Hlong BitShift)

static void HOperatorSet.GenImageInterleaved(out HObject imageRGB, HTuple pixelPointer, HTuple colorFormat, HTuple originalWidth, HTuple originalHeight, HTuple alignment, HTuple type, HTuple imageWidth, HTuple imageHeight, HTuple startRow, HTuple startColumn, HTuple bitsPerChannel, HTuple bitShift)

void HImage.GenImageInterleaved(IntPtr pixelPointer, string colorFormat, int originalWidth, int originalHeight, int alignment, string type, int imageWidth, int imageHeight, int startRow, int startColumn, int bitsPerChannel, int bitShift)

Description

The operator gen_image_interleavedgen_image_interleavedGenImageInterleavedgen_image_interleavedGenImageInterleavedGenImageInterleaved creates a three-channel image from an input image, whose pixels are stored line-sequentially in PixelPointerPixelPointerPixelPointerPixelPointerPixelPointerpixelPointer. The size of the input image has to be passed in OriginalWidthOriginalWidthOriginalWidthOriginalWidthOriginalWidthoriginalWidth and OriginalHeightOriginalHeightOriginalHeightOriginalHeightOriginalHeightoriginalHeight, the format of the interleaved pixels in ColorFormatColorFormatColorFormatColorFormatColorFormatcolorFormat.

The output image will be sized ImageWidthImageWidthImageWidthImageWidthImageWidthimageWidth * ImageHeightImageHeightImageHeightImageHeightImageHeightimageHeight. Together with the coordinates of upper left corner StartRowStartRowStartRowStartRowStartRowstartRow and StartColumnStartColumnStartColumnStartColumnStartColumnstartColumn any section of the input image can be extracted. When a 0 is passed to ImageWidthImageWidthImageWidthImageWidthImageWidthimageWidth, ImageHeightImageHeightImageHeightImageHeightImageHeightimageHeight, StartRowStartRowStartRowStartRowStartRowstartRow, and StartColumnStartColumnStartColumnStartColumnStartColumnstartColumn, the output image will have the same dimensions as the input image.

Note that the image type TypeTypeTypeTypeTypetype (see gen_image_constgen_image_constGenImageConstgen_image_constGenImageConstGenImageConst) of the output image ImageRGBImageRGBImageRGBImageRGBImageRGBimageRGB has to be chosen such that the whole range of possible color values of the input image can be represented. I.e. gen_image_interleavedgen_image_interleavedGenImageInterleavedgen_image_interleavedGenImageInterleavedGenImageInterleaved does not allow to create a byte image from an input image with ColorFormatColorFormatColorFormatColorFormatColorFormatcolorFormat 'rgb48'"rgb48""rgb48""rgb48""rgb48""rgb48".

When the formats 'rgb48'"rgb48""rgb48""rgb48""rgb48""rgb48", 'bgr48'"bgr48""bgr48""bgr48""bgr48""bgr48", 'rgbx64'"rgbx64""rgbx64""rgbx64""rgbx64""rgbx64", and 'bgr64'"bgr64""bgr64""bgr64""bgr64""bgr64" do not use the full range of 16 bits per channel and pixel, the number of actually used bits should be passed in BitsPerChannelBitsPerChannelBitsPerChannelBitsPerChannelBitsPerChannelbitsPerChannel. Furthermore, the pixel values of the input image can be shifted by BitShiftBitShiftBitShiftBitShiftBitShiftbitShift bits to the right.

The fourth channel of four-channel input images in the formats 'rgbx'"rgbx""rgbx""rgbx""rgbx""rgbx", 'bgrx'"bgrx""bgrx""bgrx""bgrx""bgrx", 'rgbx64'"rgbx64""rgbx64""rgbx64""rgbx64""rgbx64", and 'bgrx64'"bgrx64""bgrx64""bgrx64""bgrx64""bgrx64" is simply discarded.

The storage for the new image is newly created by HALCON. Thus, it can be released after the call. Note that how to pass a pointer value depends on the used operator signature and programming environment. Make sure to pass the actual memory address where the image data is stored, not the address of a pointer variable. Care must be taken not to truncate 64-bit pointers on 64-bit architectures.

Possible values for ColorFormatColorFormatColorFormatColorFormatColorFormatcolorFormat:

'rgb555':

16 bit rgb triple (5 bit per pixel and channel), the padding bit (X) being the first bit. The bit pattern is XRRRRRGG|GGGBBBBB.

'bgr555':

16 bit bgr triple (5 bit per pixel and channel), the padding bit (X) being the first bit. The bit pattern is XBBBBBGG|GGGRRRRR.

'rgb5551':

16 bit rgb triple (5 bit per pixel and channel), the padding bit (X) being the last bit. The bit pattern is RRRRRGGG|GGBBBBBX.

'bgr5551':

16 bit bgr triple (5 bit per pixel and channel), the padding bit (X) being the last bit. The bit pattern is BBBBBGGG|GGRRRRRX.

'rgb565':

16 bit rgb triple (5 bit per pixel and channel, 6 bit for the green channel). The bit pattern is RRRRRGGG|GGGBBBBB.

'bgr565':

16 bit bgr triple (5 bit per pixel and channel, 6 bit for the green channel). The bit pattern is BBBBBGGG|GGGRRRRR.

'rgb':

24 bit rgb triple (8 bit per pixel and channel)

'bgr':

24 bit bgr triple (8 bit per pixel and channel)

'rgbx':

32 bit rgb quadruple (8 bit per pixel and channel)

'bgrx':

32 bit bgr quadruple (8 bit per pixel and channel)

'rgb48':

48 bit rgb triple (16 bit per pixel and channel)

'bgr48':

48 bit bgr triple (16 bit per pixel and channel)

'rgbx64':

64 bit rgb quadruple (16 bit per pixel and channel)

'bgrx64':

64 bit bgr quadruple (16 bit per pixel and channel)

The values 'rgb555'"rgb555""rgb555""rgb555""rgb555""rgb555", 'bgr555'"bgr555""bgr555""bgr555""bgr555""bgr555", 'rgb565'"rgb565""rgb565""rgb565""rgb565""rgb565", 'bgr565'"bgr565""bgr565""bgr565""bgr565""bgr565", 'rgb5551'"rgb5551""rgb5551""rgb5551""rgb5551""rgb5551" and 'bgr5551'"bgr5551""bgr5551""bgr5551""bgr5551""bgr5551" can be used with the suffix 'le' (Little Endian: Lower byte is expected first) or - which is the default if the suffix is omitted - 'be' (Big Endian: Higher byte is expected first). For example, the bit pattern for ColorFormatColorFormatColorFormatColorFormatColorFormatcolorFormat = 'rgb555'"rgb555""rgb555""rgb555""rgb555""rgb555" is XRRRRRGG|GGGBBBBB, while the bit pattern for ColorFormatColorFormatColorFormatColorFormatColorFormatcolorFormat = 'rgb555le'"rgb555le""rgb555le""rgb555le""rgb555le""rgb555le" is GGGBBBBB|XRRRRRGG.

Parallelization

Parameters

ImageRGBImageRGBImageRGBImageRGBImageRGBimageRGB (output_object)  image objectHImageHImageHImageHImageXHobject * (byte / uint2)

Created image with new image matrix.

PixelPointerPixelPointerPixelPointerPixelPointerPixelPointerpixelPointer (input_control)  pointer HTupleHTupleHTupleVARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong) (Hlong)

Pointer to interleaved pixels.

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

Format of the input pixels.

Default value: 'rgb' "rgb" "rgb" "rgb" "rgb" "rgb"

List of values: 'bgr'"bgr""bgr""bgr""bgr""bgr", 'bgr48'"bgr48""bgr48""bgr48""bgr48""bgr48", 'bgr555'"bgr555""bgr555""bgr555""bgr555""bgr555", 'bgr5551'"bgr5551""bgr5551""bgr5551""bgr5551""bgr5551", 'bgr5551be'"bgr5551be""bgr5551be""bgr5551be""bgr5551be""bgr5551be", 'bgr5551le'"bgr5551le""bgr5551le""bgr5551le""bgr5551le""bgr5551le", 'bgr555be'"bgr555be""bgr555be""bgr555be""bgr555be""bgr555be", 'bgr555le'"bgr555le""bgr555le""bgr555le""bgr555le""bgr555le", 'bgr565'"bgr565""bgr565""bgr565""bgr565""bgr565", 'bgr565be'"bgr565be""bgr565be""bgr565be""bgr565be""bgr565be", 'bgr565le'"bgr565le""bgr565le""bgr565le""bgr565le""bgr565le", 'bgrx'"bgrx""bgrx""bgrx""bgrx""bgrx", 'bgrx64'"bgrx64""bgrx64""bgrx64""bgrx64""bgrx64", 'rgb'"rgb""rgb""rgb""rgb""rgb", 'rgb48'"rgb48""rgb48""rgb48""rgb48""rgb48", 'rgb555'"rgb555""rgb555""rgb555""rgb555""rgb555", 'rgb5551'"rgb5551""rgb5551""rgb5551""rgb5551""rgb5551", 'rgb5551be'"rgb5551be""rgb5551be""rgb5551be""rgb5551be""rgb5551be", 'rgb5551le'"rgb5551le""rgb5551le""rgb5551le""rgb5551le""rgb5551le", 'rgb555be'"rgb555be""rgb555be""rgb555be""rgb555be""rgb555be", 'rgb555le'"rgb555le""rgb555le""rgb555le""rgb555le""rgb555le", 'rgb565'"rgb565""rgb565""rgb565""rgb565""rgb565", 'rgb565be'"rgb565be""rgb565be""rgb565be""rgb565be""rgb565be", 'rgb565le'"rgb565le""rgb565le""rgb565le""rgb565le""rgb565le", 'rgbx'"rgbx""rgbx""rgbx""rgbx""rgbx", 'rgbx64'"rgbx64""rgbx64""rgbx64""rgbx64""rgbx64"

OriginalWidthOriginalWidthOriginalWidthOriginalWidthOriginalWidthoriginalWidth (input_control)  extent.x HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Width of input image.

Default value: 512

Suggested values: 128, 256, 512, 1024

Typical range of values: 1 ≤ OriginalWidth OriginalWidth OriginalWidth OriginalWidth OriginalWidth originalWidth (lin)

Minimum increment: 1

Recommended increment: 10

OriginalHeightOriginalHeightOriginalHeightOriginalHeightOriginalHeightoriginalHeight (input_control)  extent.y HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Height of input image.

Default value: 512

Suggested values: 128, 256, 512, 1024

Typical range of values: 1 ≤ OriginalHeight OriginalHeight OriginalHeight OriginalHeight OriginalHeight originalHeight (lin)

Minimum increment: 1

Recommended increment: 10

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

Reserved.

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

Pixel type of output image.

Default value: 'byte' "byte" "byte" "byte" "byte" "byte"

List of values: 'byte'"byte""byte""byte""byte""byte", 'uint2'"uint2""uint2""uint2""uint2""uint2"

ImageWidthImageWidthImageWidthImageWidthImageWidthimageWidth (input_control)  rectangle.extent.x HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Width of output image.

Default value: 0

Suggested values: 128, 256, 512, 1024

Typical range of values: 0 ≤ ImageWidth ImageWidth ImageWidth ImageWidth ImageWidth imageWidth (lin)

Minimum increment: 1

Recommended increment: 10

ImageHeightImageHeightImageHeightImageHeightImageHeightimageHeight (input_control)  rectangle.extent.y HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Height of output image.

Default value: 0

Suggested values: 128, 256, 512, 1024

Typical range of values: 0 ≤ ImageHeight ImageHeight ImageHeight ImageHeight ImageHeight imageHeight (lin)

Minimum increment: 1

Recommended increment: 10

StartRowStartRowStartRowStartRowStartRowstartRow (input_control)  rectangle.origin.y HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Line number of upper left corner of desired image part.

Default value: 0

Suggested values: -1, 0

StartColumnStartColumnStartColumnStartColumnStartColumnstartColumn (input_control)  rectangle.origin.x HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Column number of upper left corner of desired image part.

Default value: 0

Suggested values: -1, 0

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

Number of used bits per pixel and channel of the output image (-1: All bits are used).

Default value: -1

Suggested values: 5, 8, 10, 12, 16, -1

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

Number of bits that the color values of the input pixels are shifted to the right (only uint2 images).

Default value: 0

Suggested values: 0, 2, 4, 6

Result

If the parameter values are correct, the operator gen_image_interleavedgen_image_interleavedGenImageInterleavedgen_image_interleavedGenImageInterleavedGenImageInterleaved returns the value 2 (H_MSG_TRUE). Otherwise an exception is raised.

Possible Successors

disp_colordisp_colorDispColordisp_colorDispColorDispColor

See also

reduce_domainreduce_domainReduceDomainreduce_domainReduceDomainReduceDomain, paint_graypaint_grayPaintGraypaint_grayPaintGrayPaintGray, paint_regionpaint_regionPaintRegionpaint_regionPaintRegionPaintRegion, set_grayvalset_grayvalSetGrayvalset_grayvalSetGrayvalSetGrayval, gen_image_constgen_image_constGenImageConstgen_image_constGenImageConstGenImageConst

Module

Foundation


ClassesClassesClassesClasses | | | | Operators