i learning how use generic image library in boost, , following codes illustrate how write raw data jpeg file:
int main(void) { unsigned char *src_pixels; int src_row_bytes = 200; src_pixels = new unsigned char [200*500]; for(int i=0; i<500; i++) { for(int j=0; j<200; j++) src_pixels[i*200+j]= j; } char *dst_pixels; dst_pixels = new char [200*500]; for(int i=0; i<500; i++) { for(int j=0; j<200; j++) dst_pixels[i*200+j]= j; } gray8c_view_t my_view = interleaved_view(200,500,(const gray8_pixel_t*)src_pixels,src_row_bytes); gray8s_view_t your_view = interleaved_view(200,500,( gray8s_pixel_t*)dst_pixels,src_row_bytes); jpeg_write_view("c:/file_1_copy.jpg", my_view); jpeg_write_view("c:/file_2_copy.jpg", your_view); delete []src_pixels; delete []dst_pixels; return 0; }
however, seems jpeg_write_view("c:/file_2_copy.jpg", your_view);
cannot compiled, , following error messages given:
error 2 error c2338: jpeg_write_support<view>::is_supported
i not how make compile. suggestion appreciated.
`
Comments
Post a Comment