Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

cxform.cc

Go to the documentation of this file.
00001 
00002 // Flash Plugin and Player
00003 // Copyright (C) 1998,1999 Olivier Debon
00004 // 
00005 // This program is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU General Public License
00007 // as published by the Free Software Foundation; either version 2
00008 // of the License, or (at your option) any later version.
00009 // 
00010 // This program is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 // 
00015 // You should have received a copy of the GNU General Public License
00016 // along with this program; if not, write to the Free Software
00017 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00018 // 
00020 //  Author : Olivier Debon  <odebon@club-internet.fr>
00021 //  
00022 
00023 #include "swf.h"
00024 
00025 #ifdef RCSID
00026 static char *rcsid = "$Id";
00027 #endif
00028 
00029 long
00030 Cxform::getRed(long v) {
00031         long val;
00032 
00033         val = (long)(ra*v+rb);
00034         if (val > 255) val = 255;
00035         else if (val < 0) val = 0;
00036         return val;
00037 }
00038 
00039 long
00040 Cxform::getGreen(long v) {
00041         long val;
00042 
00043         val = (long)(ga*v+gb);
00044         if (val > 255) val = 255;
00045         else if (val < 0) val = 0;
00046         return val;
00047 }
00048 
00049 long
00050 Cxform::getBlue(long v) {
00051         long val;
00052 
00053         val = (long)(ba*v+bb);
00054         if (val > 255) val = 255;
00055         else if (val < 0) val = 0;
00056         return val;
00057 }
00058 
00059 long
00060 Cxform::getAlpha(long v) {
00061         long val;
00062 
00063         val = (long)(aa*v+ab);
00064         if (val > 255) val = 255;
00065         else if (val < 0) val = 0;
00066         return val;
00067 }
00068 
00069 Color
00070 Cxform::getColor(Color color) {
00071         Color newColor;
00072 
00073         newColor.red = getRed(color.red);
00074         newColor.green = getGreen(color.green);
00075         newColor.blue = getBlue(color.blue);
00076         newColor.alpha = getAlpha(color.alpha);
00077 
00078         return newColor;
00079 }

Generated on Sat Nov 5 16:15:35 2005 for OPIE by  doxygen 1.4.2