"Fossies" - the Fresh Open Source Software Archive

Member "motion-Release-4.3.0/src/rotate.h" (14 Jan 2020, 1635 Bytes) of package /linux/misc/motion-Release-4.3.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "rotate.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2  *    rotate.h
    3  *
    4  *    Include file for handling image rotation.
    5  *
    6  *    Copyright 2004-2005, Per Jonsson (per@pjd.nu)
    7  *
    8  *    This software is distributed under the GNU Public license
    9  *    Version 2.  See also the file 'COPYING'.
   10  */
   11 #ifndef _INCLUDE_ROTATE_H
   12 #define _INCLUDE_ROTATE_H
   13 
   14 #include "motion.h" /* for struct context */
   15 
   16 /**
   17  * rotate_init
   18  *
   19  *  Sets up rotation data by allocating a temporary buffer for 90/270 degrees
   20  *  rotation, and by determining the right rotate-180-degrees function.
   21  *
   22  * Parameters:
   23  *
   24  *  cnt - current thread's context structure
   25  *
   26  * Returns: nothing
   27  */
   28 void rotate_init(struct context *cnt);
   29 
   30 /**
   31  * rotate_deinit
   32  *
   33  *  Frees memory allocated by rotate_init.
   34  *
   35  * Parameters:
   36  *
   37  *   cnt - current thread's context structure
   38  */
   39 void rotate_deinit(struct context *cnt);
   40 
   41 /**
   42  * rotate_map
   43  *
   44  *  Rotates the image stored in img according to the rotation data
   45  *  available in cnt. Rotation is performed clockwise. Supports 90,
   46  *  180 and 270 degrees rotation. 180 degrees rotation is performed
   47  *  in-place by simply reversing the image data, which is a very
   48  *  fast operation. 90 and 270 degrees rotation are performed using
   49  *  a temporary buffer and a somewhat more complicated algorithm,
   50  *  which makes them slower.
   51  *
   52  *  Note that to the caller, all rotations will seem as they are
   53  *  performed in-place.
   54  *
   55  * Parameters:
   56  *
   57  *   img_data - the image data to rotate
   58  *   cnt - current thread's context structure
   59  *
   60  * Returns:
   61  *
   62  *   0  - success
   63  *   -1 - failure (rare, shouldn't happen)
   64  */
   65 int rotate_map(struct context *cnt, struct image_data *img_data);
   66 
   67 #endif