- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
I'm trying to rotate a bitmap by 90 degrees, but cannot seem to manage it. My bitmap is 200 * 100 24 bit. In particular it is the roi mapping that I am having difficulty with, I can get 180 degrees to work, but 90 degrees results in a cropped image. Can anyone point me in the right direction, preferably with a code snippet.
Thanks
Chris
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Chris,
Since you have a rectangular image (200x100) the rotation of 90 degrees will crop the image as ithas to since its trying to put 200 pixels in the vertical 100 pixel direction. If you rotate the full 180 then the (upside down) rectangle fits without cropping. To avoid cropping therefore you will need to create a new image and copy the rotated image to it. The new image can be 200 w x 100 h to avoid cropping or 200 x 200 if you don't mind black sides.
Rick
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
there is a piece of code to demonstrate
#define Width 200
#define Height 100
Ipp8u src[Width * Height * 3];
Ipp8u dst[Height * Width * 3];
int srcStep = Width * 3;
int dstStep = Height * 3;
IppiRect srcROI = {0,0, Width, Height};
IppiSize srcSize = {Width, Height};
IppiSize dstROI = {0, 0, Height, Width};
ippiRotate_8u_C1R(src, srcSize, srcStep, srcROI, dst, dstStep, dstROI, 90, 0, Height - 1, IPPI_INTER_NN);
And of course, you cam use ippiMirror function if you need only 90/180/and so on rotation
Regards,
Vladimir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you, got my head around it now.
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