How can I manipulate / rotate a JPEG image in C ++?

I would like to use the compiled libjpeg-9 example.c and the transupp.c code and libraries to rotate the .jpg image in an Eclipse project.

Work progress to achieve this from the start: Compiling / using libjpeg on Windows for Eclipse

Trying to integrate do_rot_180 and read / write functions in one place: Need help compiling jpegtran.c code from libjpeg

-4
source share
2 answers

do_rot_180 function in transupp.c in libjpeg (you know how Q has a tag) does exactly what you want.

 LOCAL(void) do_rot_180 (j_decompress_ptr srcinfo, j_compress_ptr dstinfo, jvirt_barray_ptr *src_coef_arrays, jvirt_barray_ptr *dst_coef_arrays) /* 180 degree rotation is equivalent to * 1. Vertical mirroring; * 2. Horizontal mirroring. * These two steps are merged into a single processing routine. */ 

The function is used by jtransform_execute_transformation / JXFORM_ROT_180 and loslessy reorders the internal JPEG elements to achieve a rotation effect. This function demonstrates the use and rotation of a given file and the recording of a new modified file using the specified transformation (angle).

+5
source

Look at the imagemagick library ? it is a free and very powerful tool

+1
source

All Articles