Creating a class in native module
Posted: Thu Apr 08, 2021 6:40 am
Hi there,
i want to create a simple image class as native module which is capable of performing image filtering (sobel operators, etc.) and transformation(eg. hough, color to gray, etc.) Both are basically a function which returns a new image.
imagine the api like
in short, it should be possible to do this:
To me it makes sense to implement this as image class but since native module development isn't well documented (sadly, source code isn't, too - no offense), I don't know how to start..
My image should look at least like this in c:
I've seen modframebuffer which has basically a cool design (lookup table for called function by frame format etc.) but it's a slightly heavy example to find out what i really have to do.. and it's no native module and I don't know what exactly has to be changed betweent both..
Can someone give me some hints here?
i want to create a simple image class as native module which is capable of performing image filtering (sobel operators, etc.) and transformation(eg. hough, color to gray, etc.) Both are basically a function which returns a new image.
imagine the api like
Code: Select all
image = Image(camera.capture(), 320, 240, Image.RGB565)
gray = image.transform(Image.grayscale)
edges = gray.filter(Image.sobel3)
Code: Select all
edges = Image(camera.capture(), 320, 240, Image.RGB565).transform(Image.grayscale).filter(Image.sobel3)
My image should look at least like this in c:
Code: Select all
typedef struct s_image_t {
unsigned int width;
unsigned int height;
unsigned int type;
char const *buffer;
}
Can someone give me some hints here?