High quality image rotation (rotate by shear)
Posted
by Eran Yariv
on May 1st, 1999
Unlike traditional rotation of images, where every n'th pixel is sampled and copied to the result image, this template provides much more accurate image rotation features (weighing the pixels).
The template is instantiated with a specific pixel format and must be inherited to support pixel access functions for a specific bitmap implementation. This provides abstaction of the rotation mechanism from the actual bitmap representation.
Major features:
- Provides professional quality image rotation.
- Code is optimized for image quality, not speed.
- Rotated image retains size and aspect ratio of source image (destination image size is usally bigger).
- Supports double precision rotation angles (0..360).
- Supports generic bitmap structures. Specific bitmap structure is defined by inheritance.
- Template based - no need for libraries, DLLs etc. No linkage problems.
How to use the rotation template:
You must derive you own class from the rotation template.For example:
class CRotateByShearRGB : public CRotateByShear<COLORREF>will define a concrete class where each pixel is of COLORREF type.
Next, you must override 5 abstract functions which support creation, destruction of bitmap buffers and pixel level access to the bitmap buffers.
Next, you instantiate your derived class and call the AllocAndRotate(...) function which allocates a new destination bitmap buffer and rotates the input image into it.
That's it.
For further instructions please view the attached sample command-line project (Rotate.cpp).
It is a simple command line utility which reads PPM (ASCII or binary) image file into a DIB structure, rotates it and saves it to another PPM image file.

Comments
Jordan shoes mentioned Gene to go for the brand, a segment of Nike
Posted by TaddyGaffic on 04/22/2013 02:35pmIn focus groups conducted at 80 community-based organizations around the country, Motivational Educational Entertainment of Philadelphia [url=http://northernroofing.co.uk/roofins.cfm]nike free run 3[/url] identified disturbing trends among youths ages 16 to 20. The "Just Say No" message of abstinence-only campaigns has been lost on this group of young people, who grew up during an era when the hip-hop sensibility of getting cash and clothes did not incorporate values of conscientious sexual behavior or social responsibility. Rappers who mingle [url=http://markwarren.org.uk/goodbuy.cfm]nike free run uk[/url] with glamorous-looking half-naked women rarely mention contraception while they're listing the number of compromising sexual situations they've been in lately. There are number of good brands in the market like Adidas, Nike, Reebok, Asics, Brooks, Puma etc. Most of these brands have shoes tailored for professional and amateur tennis players. New advanced technologies have made these shoes more player-friendly. After that, I eventually like to try to get down to the 150-160 range. I not entirely sure if that a healthy number for a gal my height or not, and I haven looked into it. But, I know that when I was 180 I still didn feel that [url=http://markwarren.org.uk/goodbuy.cfm]nike free run uk[/url] fit, so I think an extra 20 or so will help with that.. Lotto sneakers selling price are generally liable along with using the form of sneakers you choose on. Your Lotto sneakers established fact because of their style along with good quality plus the create. That they create sneakers coming from all varieties much like the loafers,Puma II Shoes, new sandals, sneakers along with task tennis shoes or anything else
ReplyMost lazy coder
Posted by Legacy on 09/23/2002 12:00amOriginally posted by: Akash Kava
No GUI, no facility for direct Bitmap images.. you need to design your code in better way to make it template free, templates are old fasion of designs.
ReplyBugs
Posted by Legacy on 04/26/2002 12:00amOriginally posted by: Grohotov Andrey
Reply
Rotation at the centre of true colour image
Posted by Legacy on 01/25/2002 12:00amOriginally posted by: halim
Could you give examples of rotating about another point in the true colour image (e.g. the center of the image while maintainig the original size of the input image)
ReplyPPM tool
Posted by Legacy on 07/23/2001 12:00amOriginally posted by: wrsun0413
http://cust.nol.at/ppee/SLOWVIEW/dload.html
ReplyHow cam i use it in VB
Posted by Legacy on 07/04/2001 12:00amOriginally posted by: Kanhai Chhugani
Hi I would like to use this in VB, can u provide any thing like that....
such as a VB class file or a COM Dll file etc....
Thanks
Kanhai Chhugani
Replywhat is ppm?
Posted by Legacy on 04/20/2001 12:00amOriginally posted by: Oh Sun
What is ppm? Is a graphic file format?
ReplyWhere can i get ppm file?
RotateByShear doesn't work with white background color
Posted by Legacy on 07/22/1999 12:00amOriginally posted by: Laurent MOTTAIS
if you change your code by
ReplyCOLORREF *pDst = Rot.AllocAndRotate (
Src.m_Bits,
Src.m_Size,
dAngle,
&sDst,
RGB(255,255,255)
);
the destination file is not correctly rotate !..
Where to find MSVCP60.DLL?
Posted by Legacy on 05/05/1999 12:00amOriginally posted by: lsteo
ReplyPPM?
Posted by Legacy on 05/04/1999 12:00amOriginally posted by: Bill Oatman
Looks interesting, but how about adding a 'LoadBMP' function to CDIB so bitmaps can be loaded. I still haven't found a graphics package that will save in PPM format.
Reply