gen_image_interleavedgen_image_interleavedGenImageInterleavedGenImageInterleavedgen_image_interleaved (Operator)

Name

gen_image_interleavedgen_image_interleavedGenImageInterleavedGenImageInterleavedgen_image_interleaved — Erzeugen eines dreikanaligen Bildes aus einem Zeiger auf die verschränkten Pixel.

Signatur

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)

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 HImage::GenImageInterleaved(void* PixelPointer, const wchar_t* ColorFormat, Hlong OriginalWidth, Hlong OriginalHeight, Hlong Alignment, const wchar_t* Type, Hlong ImageWidth, Hlong ImageHeight, Hlong StartRow, Hlong StartColumn, Hlong BitsPerChannel, Hlong BitShift)   ( Nur Windows)

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)

def gen_image_interleaved(pixel_pointer: int, color_format: str, original_width: int, original_height: int, alignment: int, type: str, image_width: int, image_height: int, start_row: int, start_column: int, bits_per_channel: int, bit_shift: int) -> HObject

Beschreibung

gen_image_interleavedgen_image_interleavedGenImageInterleavedGenImageInterleavedgen_image_interleaved erzeugt ein dreikanaliges Bild aus einem Eingabebild, dessen Pixel in PixelPointerPixelPointerPixelPointerpixelPointerpixel_pointer zeilensequentiell abgelegt sind. Die Größe des Eingabebildes muss in OriginalWidthOriginalWidthOriginalWidthoriginalWidthoriginal_width und OriginalHeightOriginalHeightOriginalHeightoriginalHeightoriginal_height übergeben werden, das Format der verschränkten Pixel in ColorFormatColorFormatColorFormatcolorFormatcolor_format.

Das Ausgabebild bekommt die Größe ImageWidthImageWidthImageWidthimageWidthimage_width * ImageHeightImageHeightImageHeightimageHeightimage_height. In Verbindung mit den Koordinaten der linken, oberen Ecke StartRowStartRowStartRowstartRowstart_row und StartColumnStartColumnStartColumnstartColumnstart_column lässt sich jeder beliebige Ausschnitt innerhalb des Eingabebildes erzeugen. Wird an ImageWidthImageWidthImageWidthimageWidthimage_width, ImageHeightImageHeightImageHeightimageHeightimage_height, StartRowStartRowStartRowstartRowstart_row und StartColumnStartColumnStartColumnstartColumnstart_column jeweils 0 übergeben, so erhält das Ausgabebild die gleichen Abmessungen wie das Eingabebild.

Es ist zu beachten, dass der Typ TypeTypeTypetypetype (siehe gen_image_constgen_image_constGenImageConstGenImageConstgen_image_const) des Ausgabebildes ImageRGBImageRGBImageRGBimageRGBimage_rgb so gewählt sein muss, dass sich die Farbwerte aus dem Eingabebild in ihrem vollen Umfang darstellen lassen. D.h. gen_image_interleavedgen_image_interleavedGenImageInterleavedGenImageInterleavedgen_image_interleaved erlaubt es nicht, aus einem Eingabebild mit 'rgb48'"rgb48""rgb48""rgb48""rgb48" Pixeln ein byte Bild zu erzeugen.

Wird bei den Formaten 'rgb48'"rgb48""rgb48""rgb48""rgb48", 'bgr48'"bgr48""bgr48""bgr48""bgr48", 'rgbx64'"rgbx64""rgbx64""rgbx64""rgbx64" und 'bgr64'"bgr64""bgr64""bgr64""bgr64" nicht der volle Umfang von 16 Bit pro Pixel und Kanal ausgeschöpft, so sollte in BitsPerChannelBitsPerChannelBitsPerChannelbitsPerChannelbits_per_channel die tatsächlich verwendete Anzahl von Bits übergeben werden. Außerdem können die Pixelwerte aus dem Eingabebild noch um BitShiftBitShiftBitShiftbitShiftbit_shift Bits nach rechts geshiftet werden.

Bei vierkanaligen Eingabebildern in den Formaten 'rgbx'"rgbx""rgbx""rgbx""rgbx", 'bgrx'"bgrx""bgrx""bgrx""bgrx", 'rgbx64'"rgbx64""rgbx64""rgbx64""rgbx64" und 'bgrx64'"bgrx64""bgrx64""bgrx64""bgrx64" wird der vierte Kanal ignoriert.

Der Speicher für das neue Bild wird von HALCON neu angelegt. Er kann also nach dem Aufruf freigegeben werden. Wie ein Zeigerwert übergeben wird hängt von der benutzten Operatorsignatur und der Programmierumgebung ab. Es ist sicherzustellen, dass die tatsächliche Speicheradresse unter der die Bilddaten gespeichert sind übergeben wird und nicht die Adresse der Zeigervariablen. Es ist darauf zu achten, dass 64-Bit-Zeiger auf 64-Bit-Architekturen nicht beschnitten werden.

Mögliche Werte für ColorFormatColorFormatColorFormatcolorFormatcolor_format:

'rgb555':

16 Bit RGB-Tripel (5 Bit pro Pixel und Kanal), wobei das Auffüllbit (X) das erste Bit ist. Das Bitmuster ist XRRRRRGG|GGGBBBBB.

'bgr555':

16 Bit BGR-Tripel (5 Bit pro Pixel und Kanal), wobei das Auffüllbit (X) das erste Bit ist. Das Bitmuster ist XBBBBBGG|GGGRRRRR.

'rgb5551':

16 Bit RGB-Tripel (5 Bit pro Pixel und Kanal), wobei das Auffüllbit (X) das letzte Bit ist. Das Bitmuster ist RRRRRGGG|GGBBBBBX.

'bgr5551':

16 Bit BGR-Tripel (5 Bit pro Pixel und Kanal), wobei das Auffüllbit (X) das letzte Bit ist. Das Bitmuster ist BBBBBGGG|GGRRRRRX.

'rgb565':

16 Bit RGB-Tripel (5 Bit pro Pixel und Kanal, 6 Bit für den Grünkanal). Das Bitmuster ist RRRRRGGG|GGGBBBBB.

'bgr565':

16 Bit BGR-Tripel (5 Bit pro Pixel und Kanal, 6 Bit für den Grünkanal). Das Bitmuster ist BBBBBGGG|GGGRRRRR.

'rgb':

24 Bit RGB-Tripel (8 Bit pro Pixel und Kanal)

'bgr':

24 Bit BGR-Tripel (8 Bit pro Pixel und Kanal)

'rgbx':

32 Bit RGBX-Quadrupel (8 Bit pro Pixel und Kanal)

'bgrx':

32 Bit BGRX-Quadrupel (8 Bit pro Pixel und Kanal)

'rgb48':

48 Bit RGB-Tripel (16 Bit pro Pixel und Kanal)

'bgr48':

48 Bit BGR-Tripel (16 Bit pro Pixel und Kanal)

'rgbx64':

64 Bit RGBX-Quadrupel (16 Bit pro Pixel und Kanal)

'bgrx64':

64 Bit BGRX-Quadrupel (16 Bit pro Pixel und Kanal)

Die Parameterwerte 'rgb555'"rgb555""rgb555""rgb555""rgb555", 'bgr555'"bgr555""bgr555""bgr555""bgr555", 'rgb565'"rgb565""rgb565""rgb565""rgb565", 'bgr565'"bgr565""bgr565""bgr565""bgr565", 'rgb5551'"rgb5551""rgb5551""rgb5551""rgb5551" und 'bgr5551'"bgr5551""bgr5551""bgr5551""bgr5551" können zudem das Suffix 'le' (Little Endian: Niederwertiges Byte wird zuerst erwartet) oder - was der Standard ist, falls das Suffix weggelassen wird - 'be' (Big Endian: Höherwertiges Byte wird zuerst erwartet) erhalten. Zum Beispiel ist das Bitmuster für ColorFormatColorFormatColorFormatcolorFormatcolor_format = 'rgb555'"rgb555""rgb555""rgb555""rgb555" XRRRRRGG|GGGBBBBB, während das Bitmuster für ColorFormatColorFormatColorFormatcolorFormatcolor_format = 'rgb555le'"rgb555le""rgb555le""rgb555le""rgb555le" GGGBBBBB|XRRRRRGG ist.

Achtung

gen_image_interleavedgen_image_interleavedGenImageInterleavedGenImageInterleavedgen_image_interleaved überprüft nicht, ob PixelPointerPixelPointerPixelPointerpixelPointerpixel_pointer einen gültigen Wert hat oder nicht. Es muss also darauf geachtet werden, dass der Wert gültig ist, da es sonst zum Programmabsturz kommen kann!

Ausführungsinformationen

Parameter

ImageRGBImageRGBImageRGBimageRGBimage_rgb (output_object)  image objectHImageHObjectHObjectHobject * (byte / uint2)

Erzeugtes Bild mit neuer Bildmatrix.

PixelPointerPixelPointerPixelPointerpixelPointerpixel_pointer (input_control)  pointer HTupleintHTupleHtuple (integer) (IntPtr) (Hlong) (Hlong)

Zeiger auf die verschränkten Pixel.

ColorFormatColorFormatColorFormatcolorFormatcolor_format (input_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Format der Eingabepixel.

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

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

OriginalWidthOriginalWidthOriginalWidthoriginalWidthoriginal_width (input_control)  extent.x HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Breite des Eingabebildes.

Default: 512

Wertevorschläge: 128, 256, 512, 1024

Wertebereich: 1 ≤ OriginalWidth OriginalWidth OriginalWidth originalWidth original_width (lin)

Minimale Schrittweite: 1

Empfohlene Schrittweite: 10

OriginalHeightOriginalHeightOriginalHeightoriginalHeightoriginal_height (input_control)  extent.y HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Höhe des Eingabebildes.

Default: 512

Wertevorschläge: 128, 256, 512, 1024

Wertebereich: 1 ≤ OriginalHeight OriginalHeight OriginalHeight originalHeight original_height (lin)

Minimale Schrittweite: 1

Empfohlene Schrittweite: 10

AlignmentAlignmentAlignmentalignmentalignment (input_control)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Reserviert.

TypeTypeTypetypetype (input_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Pixeltyp des Ausgabebildes.

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

Werteliste: 'byte'"byte""byte""byte""byte", 'uint2'"uint2""uint2""uint2""uint2"

ImageWidthImageWidthImageWidthimageWidthimage_width (input_control)  rectangle.extent.x HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Breite des Ausgabebildes.

Default: 0

Wertevorschläge: 128, 256, 512, 1024

Wertebereich: 0 ≤ ImageWidth ImageWidth ImageWidth imageWidth image_width (lin)

Minimale Schrittweite: 1

Empfohlene Schrittweite: 10

ImageHeightImageHeightImageHeightimageHeightimage_height (input_control)  rectangle.extent.y HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Höhe des Ausgabebildes.

Default: 0

Wertevorschläge: 128, 256, 512, 1024

Wertebereich: 0 ≤ ImageHeight ImageHeight ImageHeight imageHeight image_height (lin)

Minimale Schrittweite: 1

Empfohlene Schrittweite: 10

StartRowStartRowStartRowstartRowstart_row (input_control)  rectangle.origin.y HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Zeilennummer der oberen linken Ecke des gewünschten Bildausschnittes.

Default: 0

Wertevorschläge: -1, 0

StartColumnStartColumnStartColumnstartColumnstart_column (input_control)  rectangle.origin.x HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Spaltennummer der oberen linken Ecke des gewünschten Bildausschnittes.

Default: 0

Wertevorschläge: -1, 0

BitsPerChannelBitsPerChannelBitsPerChannelbitsPerChannelbits_per_channel (input_control)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Anzahl benutzter Bits pro Pixel und Kanal des Ausgabebildes (-1: Alle Bits werden benutzt).

Default: -1

Wertevorschläge: 5, 8, 10, 12, 16, -1

BitShiftBitShiftBitShiftbitShiftbit_shift (input_control)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Anzahl der Bits, um die die Farbwerte der Eingabepixel nach rechts geshiftet werden (nur für uint2 Bilder).

Default: 0

Wertevorschläge: 0, 2, 4, 6

Ergebnis

Sind die Parameterwerte korrekt, dann liefert gen_image_interleavedgen_image_interleavedGenImageInterleavedGenImageInterleavedgen_image_interleaved den Wert 2 ( H_MSG_TRUE) . Andernfalls wird eine Fehlerbehandlung durchgeführt.

Nachfolger

disp_colordisp_colorDispColorDispColordisp_color

Siehe auch

reduce_domainreduce_domainReduceDomainReduceDomainreduce_domain, paint_graypaint_grayPaintGrayPaintGraypaint_gray, paint_regionpaint_regionPaintRegionPaintRegionpaint_region, set_grayvalset_grayvalSetGrayvalSetGrayvalset_grayval, gen_image_constgen_image_constGenImageConstGenImageConstgen_image_const

Modul

Foundation