This function removes the specified channel from the source image and shifts the remaining channels without transforming pixel data.
|
Copy Code
|
|
|---|---|
AT_ERRCOUNT ACCUAPI IG_image_channel_remove(
HIGEAR hIGear,
AT_UINT position
);
|
|
| Name | Type | Description |
|---|---|---|
| hIGear | HIGEAR | HIGEAR handle of image. |
| position | AT_UINT | Index of channel to remove. |
Returns the number of ImageGear errors that occurred during this function call. If there are no errors, the return value is IGE_SUCCESS.
All pixel formats supported by ImageGear for C and C++, except:
None
|
Copy Code
|
|
|---|---|
/* Alter a 24-bit RGB image to use the red channel data for both red and blue channels */ AT_ERRCOUNT nErrcount; /* Number of errors on stack */ HIGEAR hImage; /* Handle of source image */ AT_CHANNEL_REF channel; /* Channel to add */ nErrcount = IG_load_file("test.jpg", &hImage); channel.hImage = hImage; channel.uNumber = 0; nErrcount = IG_image_channel_add(hImage, 3, &channel); nErrcount = IG_image_channel_remove(hImage, 2); nErrcount = IG_save_file(hImage, "test.bmp", IG_SAVE_BMP_UNCOMP); IG_image_delete(hImage); |
|