Skip to main content
Email Password   helpLost your password?
  • Download demo project - 21 Kb
  • Download source files - 4 Kb

    Sample Image - RotateByShear.gif

    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).

    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:

    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.

    Then 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.

  • You must Sign In to use this message board.
     
     
    Per page   
     FirstPrevNext
    GeneralMy vote of 1 Pin
    sujeshsasi
    19:57 5 Mar '09  
    Generalhave bugs in the demo Pin
    WeiHua zhang
    19:06 24 Oct '07  
    Generala show stopper bug Pin
    Xiaotian Guo
    21:12 7 Jul '03  
    GeneralRe: a show stopper bug Pin
    Jim the Bad
    7:06 11 Aug '05  
    GeneralRotation of BMP Pin
    Sandeep11_16
    5:21 3 Jun '03  
    GeneralSpeed optimized version Pin
    antontreskunov
    16:03 24 Apr '03  
    GeneralRe: Speed optimized version Pin
    yyt_yyt
    23:20 8 Jul '03  
    GeneralRe: Speed optimized version Pin
    Anonymous
    9:39 12 Jul '03  
    GeneralRe: Speed optimized version Pin
    pmidd
    10:23 17 Oct '03  
    GeneralRe: Speed optimized version Pin
    antontreskunov
    7:55 21 Oct '03  
    GeneralRe: Speed optimized version Pin
    Alexandre GRANVAUD
    3:52 14 Jan '08  
    Generalhow to get the ppm image from a bitmap? Pin
    AlanShen
    18:11 19 Apr '03  
    GeneralRe: how to get the ppm image from a bitmap? Pin
    tyjiang
    16:30 30 Jul '08  
    GeneralBMP Image Rotation about its own axes Pin
    Vaibhav Sanghavi
    21:26 24 Apr '02  
    GeneralRe: BMP Image Rotation about its own axes Pin
    Tili
    11:19 28 Sep '02  
    GeneralAlgorithm Pin
    Neil Younusov
    5:22 28 Feb '02  
    GeneralRe: Algorithm Pin
    land_lubber
    8:44 1 Oct '02  
    GeneralRe: Algorithm Pin
    Peter Merrill
    19:47 14 Jan '03  
    GeneralNice image! Pin
    Alvaro Mendez
    14:28 21 Aug '01  
    GeneralRe: Nice image! Pin
    Alexandre GRANVAUD
    3:51 14 Jan '08  
    GeneralCan you publish shrink code??? Pin
    objects
    16:28 30 Mar '01  
    GeneralNon-Rectangular Stretching Pin
    Subbi Iyer
    0:26 21 Feb '01  
    GeneralRe: Non-Rectangular Stretching Pin
    msg555
    11:24 14 Apr '06  
    GeneralRe: Non-Rectangular Stretching Pin
    gslin
    10:03 3 Nov '06  
    GeneralRelated Paper ?? Pin
    looker
    22:47 25 Jan '01  


    Last Updated 9 Jan 2000 | Advertise | Privacy | Terms of Use | Copyright © CodeProject, 1999-2009