#include #include #include typedef int BOOL; #define TRUE 1 #define FALSE 0 BOOL rgb24_split(const char *file, int width, int height) { if (file == NULL) { return FALSE; } FILE *fp = fopen(file, "rb+"); FILE *fp_r = fopen("./out/output_rgb24_r.y", "wb+"); FILE *fp_g = fopen("./out/output_rgb24_g.y", "wb+"); FILE *fp_b = fopen("./out/output_rgb24_b.y", "wb+"); unsigned char *data = (unsigned char *)malloc(width*height*3); memset(data, 0, width*height*3); fread(data, 1, width*height*3, fp); for(int i=0; i