Blame synfig-studio/src/synfigapp/vectorizer/centerlinevectorizer.h

Ankit Kumar Dwivedi 0944d7
/* === S Y N F I G ========================================================= */
Ankit Kumar Dwivedi 0944d7
/*!	\file centerlinevectorizer.h
Ankit Kumar Dwivedi 0944d7
**
Ankit Kumar Dwivedi 0944d7
**	$Id$
Ankit Kumar Dwivedi 0944d7
**
Ankit Kumar Dwivedi 0944d7
**	\legal
Ankit Kumar Dwivedi 0944d7
**	Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
Ankit Kumar Dwivedi 0944d7
**
Ankit Kumar Dwivedi 0944d7
**	This package is free software; you can redistribute it and/or
Ankit Kumar Dwivedi 0944d7
**	modify it under the terms of the GNU General Public License as
Ankit Kumar Dwivedi 0944d7
**	published by the Free Software Foundation; either version 2 of
Ankit Kumar Dwivedi 0944d7
**	the License, or (at your option) any later version.
Ankit Kumar Dwivedi 0944d7
**
Ankit Kumar Dwivedi 0944d7
**	This package is distributed in the hope that it will be useful,
Ankit Kumar Dwivedi 0944d7
**	but WITHOUT ANY WARRANTY; without even the implied warranty of
Ankit Kumar Dwivedi 0944d7
**	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Ankit Kumar Dwivedi 0944d7
**	General Public License for more details.
Ankit Kumar Dwivedi 0944d7
**	\endlegal
Ankit Kumar Dwivedi 0944d7
*/
Ankit Kumar Dwivedi 0944d7
/* ========================================================================= */
Ankit Kumar Dwivedi 0944d7
Ankit Kumar Dwivedi 0944d7
/* === S T A R T =========================================================== */
Ankit Kumar Dwivedi 0944d7
Ankit Kumar Dwivedi 7c1f39
#ifndef __SYNFIG_STUDIO_CENTERLINEVECTORIZER_H
Ankit Kumar Dwivedi 7c1f39
#define __SYNFIG_STUDIO_CENTERLINEVECTORIZER_H
Ankit Kumar Dwivedi 0944d7
Ankit Kumar Dwivedi 0944d7
/* === H E A D E R S ======================================================= */
Ankit Kumar Dwivedi 0944d7
#include "vectorizerparameters.h"
Ankit Kumar Dwivedi 0944d7
#include <etl handle=""></etl>
Ankit Kumar Dwivedi 0944d7
#include <synfig layer_bitmap.h="" layers=""></synfig>
Ankit Kumar Dwivedi 0944d7
#include <synfig vector.h=""></synfig>
ankit-kumar-dwivedi 2e10e1
#include <synfigapp uimanager.h=""></synfigapp>
Ankit Kumar Dwivedi 0944d7
/* === M A C R O S ========================================================= */
Ankit Kumar Dwivedi 0944d7
Ankit Kumar Dwivedi 0944d7
/* === T Y P E D E F S ===================================================== */
Ankit Kumar Dwivedi 0944d7
typedef etl::handle<synfig::layer_bitmap> Handle;</synfig::layer_bitmap>
Ankit Kumar Dwivedi 0944d7
Ankit Kumar Dwivedi 0944d7
Ankit Kumar Dwivedi 0944d7
/* === C L A S S E S & S T R U C T S ======================================= */
Ankit Kumar Dwivedi 0944d7
Ankit Kumar Dwivedi 0944d7
namespace studio {
Ankit Kumar Dwivedi 0944d7
Ankit Kumar Dwivedi 0944d7
//==============================
Ankit Kumar Dwivedi 0944d7
//    Core vectorizer class
Ankit Kumar Dwivedi 0944d7
//==============================
Ankit Kumar Dwivedi 0944d7
Ankit Kumar Dwivedi 0944d7
//! Contains specific vectorization methods and deals with partial progress
Ankit Kumar Dwivedi 0944d7
//! notifications (using Qt signals).
Ankit Kumar Dwivedi 0944d7
/*!VectorizerCore class is the lowest layer of a vectorization process, it
Ankit Kumar Dwivedi 0944d7
provides vectorization of a
Ankit Kumar Dwivedi 0944d7
single input raster image by calling the \b vectorize method.
Ankit Kumar Dwivedi 0944d7
Ankit Kumar Dwivedi 0944d7
It can also deal notifications about its progress status, and is receptive to
Ankit Kumar Dwivedi 0944d7
user cancels.
Ankit Kumar Dwivedi 0944d7
Ankit Kumar Dwivedi 0944d7
\sa VectorizerPopup, Vectorizer, VectorizerConfiguration classes.*/
Ankit Kumar Dwivedi 0944d7
class VectorizerCore
Ankit Kumar Dwivedi 0944d7
{
Ankit Kumar Dwivedi 0944d7
  int m_currPartial;
Ankit Kumar Dwivedi 0944d7
  int m_totalPartials;
Ankit Kumar Dwivedi 0944d7
Ankit Kumar Dwivedi 0944d7
  bool m_isCanceled;
Ankit Kumar Dwivedi 0944d7
Ankit Kumar Dwivedi 0944d7
public:
Ankit Kumar Dwivedi 0944d7
  VectorizerCore() : m_currPartial(0), m_isCanceled(false) {}
Ankit Kumar Dwivedi 0944d7
  ~VectorizerCore() {}
Ankit Kumar Dwivedi 0944d7
Ankit Kumar Dwivedi 07b15a
  //! Returns true if vectorization was aborted at user's request
Ankit Kumar Dwivedi 07b15a
  bool isCanceled() { return m_isCanceled; }
Ankit Kumar Dwivedi 07b15a
Ankit Kumar Dwivedi 0944d7
  /*!Calls the appropriate technique to convert \b image to vectors depending on c.*/
Ankit Kumar Dwivedi 0944d7
 
ankit-kumar-dwivedi 2e10e1
  std::vector< etl::handle<synfig::layer> > vectorize(const etl::handle<synfig::layer_bitmap> &image, const etl::handle<uiinterface> &ui_interface,const VectorizerConfiguration &c,const synfig::Gamma &gamma);</uiinterface></synfig::layer_bitmap></synfig::layer>
Ankit Kumar Dwivedi 0944d7
Ankit Kumar Dwivedi 0944d7
private:
a4bbdd
  std::vector< etl::handle<synfig::layer> > centerlineVectorize(Handle &image, const CenterlineConfiguration &configuration, const synfig::Gamma &gamma);</synfig::layer>
Ankit Kumar Dwivedi 0944d7
Ankit Kumar Dwivedi 0944d7
};
Ankit Kumar Dwivedi 0944d7
Ankit Kumar Dwivedi 0944d7
}; // END of namespace studio
Ankit Kumar Dwivedi 0944d7
Ankit Kumar Dwivedi 0944d7
/* === E N D =============================================================== */
Ankit Kumar Dwivedi 0944d7
a4bbdd
#endif