| Table of Contents / Image / Creation | Operators |
gen_image1 — Create an image from a pointer to the pixels.
gen_image1( : Image : Type, Width, Height, PixelPointer : )
The operator gen_image1 creates an image of the size Width * Height. The pixels in PixelPointer are stored line-sequentially. The type of the given pixels (PixelPointer) must correspond to Type. The storage for the new image is newly created by HALCON. Thus, the storage on the PixelPointer can be released after the call. Since the type of the parameter PixelPointer is generic (long) a cast has to be used for the call.
Created image with new image matrix.
Pixel type.
Default value: 'byte'
List of values: 'byte', 'direction', 'cyclic', 'int1', 'int2', 'uint2', 'int4', 'real'
Width of image.
Default value: 512
Suggested values: 128, 256, 512, 1024
Typical range of values: 1 ≤ Width ≤ 512 (lin)
Minimum increment: 1
Recommended increment: 10
Restriction: Width >= 1
Height of image.
Default value: 512
Suggested values: 128, 256, 512, 1024
Typical range of values: 1 ≤ Height ≤ 512 (lin)
Minimum increment: 1
Recommended increment: 10
Restriction: Height >= 1
Pointer to first gray value.
void NewImage(Hobject *new)
{
unsigned char image[768*525];
int r,c;
for (r=0; r<525; r++)
for (c=0; c<768; c++)
image[r*768+c] = c % 255;
gen_image1(new,"byte",768,525,(long)image);
}
If the parameter values are correct, the operator gen_image1 returns the value 2 (H_MSG_TRUE). Otherwise an exception is raised.
gen_image_const, get_image_pointer1
gen_image3, gen_image1_extern, gen_image_const, get_image_pointer1
reduce_domain, paint_gray, paint_region, set_grayval
Foundation
| Table of Contents / Image / Creation | Operators |
| HALCON Reference Manual 10.0.2 | Copyright © 1996-2011 MVTec Software GmbH |