Class BitRotator


  • final class BitRotator
    extends java.lang.Object
    IFFUtil

    Bit rotate methods based on Sue-Ken Yap, "A Fast 90-Degree Bitmap Rotator," in GRAPHICS GEMS II, James Arvo ed., Academic Press, 1991, ISBN 0-12-064480-0.

    Version:
    $Id: IFFUtil.java,v 1.0 06.mar.2006 13:31:35 haku Exp$
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static long[][] RTABLE  
    • Constructor Summary

      Constructors 
      Constructor Description
      BitRotator()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static void bitRotateCW​(byte[] pSrc, int pSrcPos, int pSrcStep, byte[] pDst, int pDstPos, int pDstStep)
      Rotate bits clockwise.
      private static long[] rtable​(int n)
      Creates a rotation table
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • RTABLE

        private static final long[][] RTABLE
    • Constructor Detail

      • BitRotator

        BitRotator()
    • Method Detail

      • rtable

        private static long[] rtable​(int n)
        Creates a rotation table
        Parameters:
        n - number of bits -1
        Returns:
        the rotation table
      • bitRotateCW

        static void bitRotateCW​(byte[] pSrc,
                                int pSrcPos,
                                int pSrcStep,
                                byte[] pDst,
                                int pDstPos,
                                int pDstStep)
        Rotate bits clockwise. The IFFImageReader uses this to convert pixel bits from planar to chunky. Bits from the source are rotated 90 degrees clockwise written to the destination.
        Parameters:
        pSrc - source pixel data
        pSrcPos - starting index of 8 x 8 bit source tile
        pSrcStep - byte offset between adjacent rows in source
        pDst - destination pixel data
        pDstPos - starting index of 8 x 8 bit destination tile
        pDstStep - byte offset between adjacent rows in destination