X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Fgamma.h;h=0d3da089e6bdc4b998f4edf0bae2c918ea24ecb6;hb=9459638ad6797b8139f1e9f0715c96076dbf0890;hp=ccb4dee158cc726d189689fe99a526b331a1d248;hpb=28f28705612902c15cd0702cc891fba35bf2d2df;p=synfig.git diff --git a/synfig-core/trunk/src/synfig/gamma.h b/synfig-core/trunk/src/synfig/gamma.h index ccb4dee..0d3da08 100644 --- a/synfig-core/trunk/src/synfig/gamma.h +++ b/synfig-core/trunk/src/synfig/gamma.h @@ -2,19 +2,20 @@ /*! \file gamma.h ** \brief Template Header ** -** $Id: gamma.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $ +** $Id$ ** ** \legal -** Copyright (c) 2002 Robert B. Quattlebaum Jr. +** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley ** -** This software and associated documentation -** are CONFIDENTIAL and PROPRIETARY property of -** the above-mentioned copyright holder. +** This package is free software; you can redistribute it and/or +** modify it under the terms of the GNU General Public License as +** published by the Free Software Foundation; either version 2 of +** the License, or (at your option) any later version. ** -** You may not copy, print, publish, or in any -** other way distribute this software without -** a prior written agreement with -** the copyright holder. +** This package is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** General Public License for more details. ** \endlegal */ /* ========================================================================= */ @@ -47,7 +48,7 @@ class Gamma float gamma_b; float black_level; float red_blue_level; - + unsigned char table_r_U16_to_U8[65536]; unsigned char table_g_U16_to_U8[65536]; unsigned char table_b_U16_to_U8[65536]; @@ -55,7 +56,7 @@ class Gamma float table_r_U8_to_F32[256]; float table_g_U8_to_F32[256]; float table_b_U8_to_F32[256]; - + public: Gamma(float x=1):black_level(0) { set_gamma(x); } @@ -74,11 +75,11 @@ public: float get_gamma_b()const { return gamma_b; } float get_black_level()const { return black_level; } float get_red_blue_level()const { return red_blue_level; } - + void refresh_gamma_r(); void refresh_gamma_g(); void refresh_gamma_b(); - + const unsigned char &r_U16_to_U8(int i)const { return table_r_U16_to_U8[i]; } const unsigned char &g_U16_to_U8(int i)const { return table_g_U16_to_U8[i]; } const unsigned char &b_U16_to_U8(int i)const { return table_b_U16_to_U8[i]; } @@ -99,7 +100,7 @@ public: float g_F32_to_F32(float x)const { return static_cast(pow(x,gamma_g)*(1.0f-black_level)+black_level); } float b_F32_to_F32(float x)const { return static_cast(pow(x,gamma_b)*(1.0f-black_level)+black_level); } }; // END of class Gamma - + }; // END of namespace synfig /* === E N D =============================================================== */