- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I'm reading a grayscale JPEG. Rotating it 90 degrees, and writing the rotated image out to a new image.
Below is code:
I'm reading a grayscale JPEG. Rotating it 90 degrees, and writing the rotated image out to a new image.
Below is code:
[bash]ExcStatus res; CIppImage image; CStdFileInput fi; CStdFileOutput fo; if(!BaseStream::IsOk(fi.Open(source.c_str()))){ cout << "STREAM ERROR ON INPUT IMAGE" << endl; return -1; } res = DecodeImage(fi, image, &decTime); CIppImage rimage( image.Height(), image.Width(), image.NChannels(), image.Precision() ); IppiSize src_size = { image.Width(), image.Height() }; IppiRect src_rect = { 0, 0, image.Width(), image.Height() }; IppiRect dst_rect = { 0, 0, rimage.Width(), rimage.Height() }; double xShift = ((double)image.Width() ) / 2.0; double yShift = ((double)image.Height()) / 2.0; IppStatus rotStatus; rotStatus = ippiRotateCenter_8u_C1R ( image.DataPtr(), src_size, image.Step(), src_rect, rimage.DataPtr(), rimage.Step(), dst_rect, 90.0, xShift, yShift, IPPI_INTER_NN ); res = EncodeImage(rimage, fo, &encTime); if(!IsOk(res)){ cerr << "ENCODE IMAGE ERROR " << endl; return 1; }else{ cout << "ENCODE IMAGE SUCCESS ( " << encTime << " MSEC )" << endl; } [/bash]It always returns with "ENCODE IMAGE ERROR"
using UIC encoding.
The encoding function works fine if I don't rotate the image.
Any ideas why this would be happening? (ignore the markup in the source code viewer.. not sure why the forum web page added that)
Thanks!
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page