2006-03-31 12:32:02 +02:00
|
|
|
/*****************************************************************************
|
|
|
|
*
|
|
|
|
* This file is part of Mapnik (c++ mapping toolkit)
|
2005-06-14 17:06:59 +02:00
|
|
|
*
|
2006-03-31 12:32:02 +02:00
|
|
|
* Copyright (C) 2006 Artem Pavlenko
|
2005-06-14 17:06:59 +02:00
|
|
|
*
|
2006-03-31 12:32:02 +02:00
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
2005-06-14 17:06:59 +02:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2006-03-31 12:32:02 +02:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
2005-06-14 17:06:59 +02:00
|
|
|
*
|
2006-03-31 12:32:02 +02:00
|
|
|
*****************************************************************************/
|
2005-06-14 17:06:59 +02:00
|
|
|
//$Id: graphics.cpp 17 2005-03-08 23:58:43Z pavlenko $
|
|
|
|
|
2007-10-08 19:42:41 +02:00
|
|
|
// mapnik
|
|
|
|
#include <mapnik/graphics.hpp>
|
|
|
|
#include <mapnik/image_util.hpp>
|
2005-06-14 17:06:59 +02:00
|
|
|
|
|
|
|
namespace mapnik
|
|
|
|
{
|
|
|
|
Image32::Image32(int width,int height)
|
|
|
|
:width_(width),
|
2006-10-04 13:22:18 +02:00
|
|
|
height_(height),
|
|
|
|
data_(width,height) {}
|
2005-06-14 17:06:59 +02:00
|
|
|
|
|
|
|
Image32::Image32(const Image32& rhs)
|
|
|
|
:width_(rhs.width_),
|
2006-10-04 13:22:18 +02:00
|
|
|
height_(rhs.height_),
|
2008-02-19 12:27:06 +01:00
|
|
|
data_(rhs.data_) {}
|
2005-06-14 17:06:59 +02:00
|
|
|
|
|
|
|
Image32::~Image32() {}
|
|
|
|
|
|
|
|
const ImageData32& Image32::data() const
|
|
|
|
{
|
|
|
|
return data_;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Image32::setBackground(const Color& background)
|
|
|
|
{
|
|
|
|
background_=background;
|
|
|
|
data_.set(background_.rgba());
|
|
|
|
}
|
|
|
|
|
|
|
|
const Color& Image32::getBackground() const
|
|
|
|
{
|
|
|
|
return background_;
|
|
|
|
}
|
|
|
|
}
|