Solve the gamma problem (corrected locale when loading/saving settings file)
[synfig.git] / synfig-core / trunk / src / synfig / layer_bitmap.cpp
index c7eb0c2..27d3911 100644 (file)
@@ -1,27 +1,28 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file layer_bitmap.cpp
 **     \brief Template Header
 **
 **     $Id: layer_bitmap.cpp,v 1.2 2005/01/24 03:08:18 darco Exp $
 **
 **     \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
 */
 /* ========================================================================= */
 
 /* === H E A D E R S ======================================================= */
 
-#define SINFG_NO_ANGLE
+#define SYNFIG_NO_ANGLE
 
 #ifdef USING_PCH
 #      include "pch.h"
@@ -51,7 +52,7 @@
 
 /* === U S I N G =========================================================== */
 
-using namespace sinfg;
+using namespace synfig;
 using namespace std;
 using namespace etl;
 
@@ -61,7 +62,7 @@ using namespace etl;
 
 /* === M E T H O D S ======================================================= */
 
-sinfg::Layer_Bitmap::Layer_Bitmap():
+synfig::Layer_Bitmap::Layer_Bitmap():
     Layer_Composite    (1.0,Color::BLEND_COMPOSITE),
        tl                              (-0.5,0.5),
        br                              (0.5,-0.5),
@@ -72,7 +73,7 @@ sinfg::Layer_Bitmap::Layer_Bitmap():
 }
        
 bool
-sinfg::Layer_Bitmap::set_param(const String & param, ValueBase value)
+synfig::Layer_Bitmap::set_param(const String & param, ValueBase value)
 {
        IMPORT(tl);
        IMPORT(br);
@@ -88,7 +89,7 @@ sinfg::Layer_Bitmap::set_param(const String & param, ValueBase value)
 }
 
 ValueBase
-sinfg::Layer_Bitmap::get_param(const String & param)const
+synfig::Layer_Bitmap::get_param(const String & param)const
 {
        EXPORT(tl);
        EXPORT(br);
@@ -140,8 +141,8 @@ Layer_Bitmap::get_param_vocab()const
        return ret;
 }
 
-sinfg::Layer::Handle
-Layer_Bitmap::hit_check(sinfg::Context context, const sinfg::Point &pos)const
+synfig::Layer::Handle
+Layer_Bitmap::hit_check(synfig::Context context, const synfig::Point &pos)const
 {
        Point surface_pos;
        surface_pos=pos-tl;
@@ -161,7 +162,7 @@ Layer_Bitmap::hit_check(sinfg::Context context, const sinfg::Point &pos)const
 
 inline
 const Color&
-sinfg::Layer_Bitmap::filter(const Color& c)const
+synfig::Layer_Bitmap::filter(const Color& c)const
 {
        if(gamma_adjust==1.0)
                return c;
@@ -175,7 +176,7 @@ sinfg::Layer_Bitmap::filter(const Color& c)const
 }
 
 Color
-sinfg::Layer_Bitmap::get_color(Context context, const Point &pos)const
+synfig::Layer_Bitmap::get_color(Context context, const Point &pos)const
 {
        Point surface_pos;
 
@@ -335,7 +336,7 @@ Layer_Bitmap::accelerated_render(Context context,Surface *out_surface,int qualit
        //perhaps use a DDA algorithm... if faster... 
        //   will still want pixel fractions to be floating point since colors are
 
-       //sinfg::info("xstart:%d ystart:%d xend:%d yend:%d",x_start,y_start,x_end,y_end);
+       //synfig::info("xstart:%d ystart:%d xend:%d yend:%d",x_start,y_start,x_end,y_end);
        
        //start drawing at the start of the bitmap (either origin or corner of input...)
        //and get other info
@@ -353,7 +354,7 @@ Layer_Bitmap::accelerated_render(Context context,Surface *out_surface,int qualit
                
                if(indx > 1.7 || indy > 1.7)
                {
-                       /*sinfg::info("Decided to downsample? ratios - (%f,%f) -> (%d,%d)", 
+                       /*synfig::info("Decided to downsample? ratios - (%f,%f) -> (%d,%d)", 
                                                indx, indy, multw, multh);      */              
                        
                        //use sample rect here...
@@ -375,7 +376,7 @@ Layer_Bitmap::accelerated_render(Context context,Surface *out_surface,int qualit
                        }
                        
                        //Color c = (*out_surface)[0][0];
-                       //sinfg::info("ValueBase of first pixel = (%f,%f,%f,%f)",c.get_r(),c.get_g(),c.get_b(),c.get_a());
+                       //synfig::info("ValueBase of first pixel = (%f,%f,%f,%f)",c.get_r(),c.get_g(),c.get_b(),c.get_a());
                        
                        return true;
                }
@@ -384,7 +385,7 @@ Layer_Bitmap::accelerated_render(Context context,Surface *out_surface,int qualit
        //perform normal interpolation
        if(interp==0)
        {       
-               //sinfg::info("Decided to do nearest neighbor");
+               //synfig::info("Decided to do nearest neighbor");
                float iny, inx;
                int x,y;