I need to pass my UIImage to an image-processing algorithm that takes int array of the bitmap in rgb565
format.
Later, it returns image-processed int array which I need to convert back to UIImage.
See it's syntax:
int* ImageProcessingAlgorithm(int bitmapArray[], int width, int height);
I searched many places but none seem to have UIImage-to-int-array and vice versa conversion. Nearest I found was this but this deals with char array - I tried fitting it for my purpose but I keep getting various access errors and leaks in UIKit library functions. Maybe I am not managing memory properly or some mistake in int-to-unsigned char-to-int conversion.
I can deal with that part, but still I am not sure it fits my image processing algorithm format (rgb565
).
I am newbie to image processing and the image-processing algorithm is a black-box for me so I just need the array of ints that I can pass to and from this algorithm.
One thing that I am sure of is that this algorithm returns the same number of array elements that it takes as input - i.e. both input and output arrays represent the same number of image pixels.
Thanks for your help in advance.