Main Page | Namespace List | Compound List | File List | Compound Members | File Members

transpose.cc

Go to the documentation of this file.
00001 /*--------------------------------------------------------------------
00002  *
00003  * (C) Copyright Koninklijke Philips Electronics NV 2006. 
00004  * All rights reserved. This software is licensed under the terms of
00005  * version 2.1 of the GNU Lesser General Public License as published 
00006  * by the Free Software Foundation. For licensing and warranty
00007  * information, see the file COPYING in the main directory.
00008  *
00009  *------------------------------------------------------------------*/
00010 
00011 #include "transpose.h"
00012 
00013 Transpose::Transpose(
00014   const Id&   n,
00015   In<VYApixel>&   ci, 
00016   Out<VYApixel>&  co)
00017 :
00018   Process(n),
00019   Cin(  id("Cin"),  ci),
00020   Cout( id("Cout"),   co)
00021 {
00022 }
00023 
00024 void Transpose::main()
00025 {
00026   int i,j,k,l;
00027       VYApixel block[64];
00028       VYApixel pixel;
00029 
00030   while (true)
00031   {
00032     read(Cin, block, 64);
00033   
00034     for (i=0; i<8; i++)
00035           {
00036             for (j=0; j<i; j++)
00037       {
00038         k = 8*i+j;
00039         l = i+8*j;
00040         pixel = block[k];
00041         block[k] = block[l];
00042         block[l] = pixel;
00043       } 
00044     }
00045     
00046     write(Cout, block, 64);
00047       }
00048 }

Generated on Wed Feb 15 14:52:45 2006 for jpegdec by doxygen 1.3.2