/* libgeglmm - a C++ wrapper for libgegl
 *
 * (c) 2008 Hubert Figuiere
 *
 * 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 3 of the License, or (at your option) any later version.
 *
 * This library 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with GEGL; if not, see <http://www.gnu.org/licenses/>.
 */



namespace Gegl {

Buffer::Buffer(const Rectangle & extent, const Babl * format)
:
  // Mark this class as non-derived to allow C++ vfuncs to be skipped.
  Glib::ObjectBase(0),
  Glib::Object(Glib::ConstructParams(buffer_class_.init(),
                                     "x", const_cast<const GeglRectangle*>(extent.gobj())->x,
                                     "y", const_cast<const GeglRectangle*>(extent.gobj())->y,
                                     "width", const_cast<const GeglRectangle*>(extent.gobj())->width,
                                     "height", const_cast<const GeglRectangle*>(extent.gobj())->height,
                                     "format", format, static_cast<char*>(0)))
{

}

void Buffer::save(const Glib::ustring &p1) const
{
  gegl_buffer_save(const_cast<GeglBuffer*>(gobj()), p1.c_str(), NULL);
}

}
