|
Carlos Lopez |
a09598 |
/* === S Y N F I G ========================================================= */
|
|
Carlos Lopez |
a09598 |
/*! \file layer_bitmap.h
|
|
Carlos Lopez |
a09598 |
** \brief Template Header
|
|
Carlos Lopez |
a09598 |
**
|
|
Carlos Lopez |
a09598 |
** $Id$
|
|
Carlos Lopez |
a09598 |
**
|
|
Carlos Lopez |
a09598 |
** \legal
|
|
Carlos Lopez |
a09598 |
** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
|
|
Carlos Lopez |
e83454 |
** Copyright (c) 2012-2013 Carlos Lรณpez
|
|
Carlos Lopez |
a09598 |
**
|
|
Carlos Lopez |
a09598 |
** This package is free software; you can redistribute it and/or
|
|
Carlos Lopez |
a09598 |
** modify it under the terms of the GNU General Public License as
|
|
Carlos Lopez |
a09598 |
** published by the Free Software Foundation; either version 2 of
|
|
Carlos Lopez |
a09598 |
** the License, or (at your option) any later version.
|
|
Carlos Lopez |
a09598 |
**
|
|
Carlos Lopez |
a09598 |
** This package is distributed in the hope that it will be useful,
|
|
Carlos Lopez |
a09598 |
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Carlos Lopez |
a09598 |
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Carlos Lopez |
a09598 |
** General Public License for more details.
|
|
Carlos Lopez |
a09598 |
** \endlegal
|
|
Carlos Lopez |
a09598 |
*/
|
|
Carlos Lopez |
a09598 |
/* ========================================================================= */
|
|
Carlos Lopez |
a09598 |
|
|
Carlos Lopez |
a09598 |
/* === S T A R T =========================================================== */
|
|
Carlos Lopez |
a09598 |
|
|
Carlos Lopez |
a09598 |
#ifndef __SYNFIG_LAYER_BITMAP_H
|
|
Carlos Lopez |
a09598 |
#define __SYNFIG_LAYER_BITMAP_H
|
|
Carlos Lopez |
a09598 |
|
|
Carlos Lopez |
a09598 |
/* === H E A D E R S ======================================================= */
|
|
Carlos Lopez |
a09598 |
|
|
Carlos Lopez |
a09598 |
#include "layer_composite.h"
|
|
Diego Barrios Romero |
dcc14d |
#include <synfig surface.h=""></synfig>
|
|
|
0dde72 |
#include <synfig guid.h=""></synfig>
|
|
Carlos Lopez |
a09598 |
|
|
|
88c541 |
#include <synfig rendering="" surface.h=""></synfig>
|
|
|
3bd54c |
#include <synfig function="" packedsurface.h="" rendering="" software=""></synfig>
|
|
|
88c541 |
|
|
Carlos Lopez |
a09598 |
/* === M A C R O S ========================================================= */
|
|
Carlos Lopez |
a09598 |
|
|
Carlos Lopez |
a09598 |
/* === T Y P E D E F S ===================================================== */
|
|
Carlos Lopez |
a09598 |
|
|
Carlos Lopez |
a09598 |
/* === C L A S S E S & S T R U C T S ======================================= */
|
|
Carlos Lopez |
a09598 |
|
|
Carlos Lopez |
a09598 |
namespace synfig {
|
|
Carlos Lopez |
a09598 |
|
|
Carlos Lopez |
a09598 |
/*! \class Layer_Bitmap
|
|
Carlos Lopez |
a09598 |
** \todo writeme
|
|
Carlos Lopez |
a09598 |
*/
|
|
Carlos Lopez |
a09598 |
class Layer_Bitmap : public Layer_Composite, public Layer_NoDeform
|
|
Carlos Lopez |
a09598 |
{
|
|
Carlos Lopez |
a09598 |
const Color& filter(Color& c)const;
|
|
Carlos Lopez |
8bd3dc |
const CairoColor& filter(CairoColor& c)const;
|
|
|
0dde72 |
|
|
|
0dde72 |
GUID surface_modification_id;
|
|
Carlos Lopez |
a09598 |
public:
|
|
Carlos Lopez |
a09598 |
typedef etl::handle<layer_bitmap> Handle;</layer_bitmap>
|
|
Carlos Lopez |
a09598 |
|
|
Carlos Lopez |
fc08b3 |
ValueBase param_tl;
|
|
Carlos Lopez |
fc08b3 |
ValueBase param_br;
|
|
Carlos Lopez |
fc08b3 |
ValueBase param_c;
|
|
Carlos Lopez |
fc08b3 |
ValueBase param_gamma_adjust;
|
|
Carlos Lopez |
fc08b3 |
|
|
Rodolfo Ribeiro Gomes |
cfe072 |
mutable std::mutex mutex;
|
|
|
3bd54c |
mutable rendering::software::PackedSurface::Reader reader;
|
|
|
5e2754 |
mutable rendering::SurfaceResource::Handle rendering_surface;
|
|
Carlos Lopez |
a09598 |
mutable bool trimmed;
|
|
|
25c3c3 |
mutable unsigned int left, top, width, height;
|
|
Carlos Lopez |
a09598 |
|
|
Carlos Lopez |
a09598 |
|
|
Carlos Lopez |
a09598 |
Layer_Bitmap();
|
|
|
3bd54c |
|
|
|
0dde72 |
GUID get_surface_modification_id() const
|
|
|
0dde72 |
{ return surface_modification_id; }
|
|
|
0dde72 |
bool is_surface_modified() const
|
|
|
0dde72 |
{ return (bool)get_surface_modification_id(); }
|
|
|
0dde72 |
void add_surface_modification_id(const GUID &modification_id)
|
|
|
0dde72 |
{ surface_modification_id ^= modification_id; }
|
|
|
0dde72 |
void reset_surface_modification_id()
|
|
|
0dde72 |
{ surface_modification_id = GUID::zero(); }
|
|
|
0dde72 |
|
|
Diego Barrios Romero |
a6f9bd |
virtual bool set_param(const String & param, const ValueBase & value);
|
|
Carlos Lopez |
a09598 |
|
|
Carlos Lopez |
a09598 |
virtual ValueBase get_param(const String & param)const;
|
|
Carlos Lopez |
a09598 |
|
|
Carlos Lopez |
a09598 |
virtual Color get_color(Context context, const Point &pos)const;
|
|
Carlos Lopez |
036645 |
virtual CairoColor get_cairocolor(Context context, const Point &pos)const;
|
|
Carlos Lopez |
a09598 |
|
|
Carlos Lopez |
a09598 |
virtual Vocab get_param_vocab()const;
|
|
Carlos Lopez |
a09598 |
|
|
Carlos Lopez |
a09598 |
virtual Rect get_bounding_rect()const;
|
|
Carlos Lopez |
a09598 |
|
|
Carlos Lopez |
a09598 |
virtual bool accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const;
|
|
Carlos Lopez |
0595a1 |
virtual bool accelerated_cairorender(Context context, cairo_t *cr, int quality, const RendDesc &renddesc, ProgressCallback *cb)const;
|
|
Carlos Lopez |
a09598 |
|
|
Carlos Lopez |
a09598 |
virtual synfig::Layer::Handle hit_check(synfig::Context context, const synfig::Point &point)const;
|
|
Carlos Lopez |
f0d436 |
|
|
|
88c541 |
protected:
|
|
|
88c541 |
virtual rendering::Task::Handle build_composite_task_vfunc(ContextParams context_params)const;
|
|
Carlos Lopez |
a09598 |
}; // END of class Layer_Bitmap
|
|
Carlos Lopez |
a09598 |
|
|
Carlos Lopez |
a09598 |
}; // END of namespace synfig
|
|
Carlos Lopez |
a09598 |
|
|
Carlos Lopez |
a09598 |
/* === E N D =============================================================== */
|
|
Carlos Lopez |
a09598 |
|
|
Carlos Lopez |
a09598 |
#endif
|