tahoma2d/toonz/sources/include/drawutil.h

75 lines
2 KiB
C
Raw Normal View History

2016-05-17 03:04:11 +12:00
#pragma once
2016-03-19 06:57:51 +13:00
//-----------------------------------------------------------------------------
// drawutil.h:
// Private header to common fuction in drawcurves.cpp and drawregions.cpp
//-----------------------------------------------------------------------------
#ifndef DRAWUTIL_H
#define DRAWUTIL_H
#include "tgl.h"
//#include "traster.h"
//#include "tcurves.h"
//#include "tregion.h"
class TRegion;
#undef DVAPI
#undef DVVAR
#ifdef TVECTORIMAGE_EXPORTS
#define DVAPI DV_EXPORT_API
#define DVVAR DV_EXPORT_VAR
#else
#define DVAPI DV_IMPORT_API
#define DVVAR DV_IMPORT_VAR
#endif
//=============================================================================
//! structure with information about texture to create
struct TextureInfoForGL {
2016-06-15 18:43:10 +12:00
// GLenum target,
// GLint level,
GLint internalformat;
GLsizei width;
GLsizei height;
// GLint border,
GLenum format;
GLenum type;
const GLvoid *pixels;
2016-03-19 06:57:51 +13:00
};
//=============================================================================
/**
*
*/
2016-06-15 18:43:10 +12:00
DVAPI TRasterP prepareTexture(const TRasterP &ras, TextureInfoForGL &texinfo);
2016-03-19 06:57:51 +13:00
/**
*
*/
2016-06-15 18:43:10 +12:00
DVAPI double computeStep(const TStroke &s, double pixelSize);
2016-03-19 06:57:51 +13:00
/**
* Draw stroke centerline between parameters from and to.
*/
2016-06-15 18:43:10 +12:00
DVAPI void drawStrokeCenterline(const TStroke &stroke, double pixelSize,
double from = 0.0, double to = 1.0);
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
DVAPI void stroke2polyline(std::vector<TPointD> &pnts, const TStroke &stroke,
double pixelSize, double w0 = 0.0, double w1 = 1.0,
bool lastRepeatable = false);
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
DVAPI void region2polyline(std::vector<T3DPointD> &pnts, const TRegion *region,
double pixeSize);
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
DVAPI TStroke *makeEllipticStroke(double thick, TPointD center, double radiusX,
double radiusY);
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
#endif // DRAWUTIL_H
2016-03-19 06:57:51 +13:00
//-----------------------------------------------------------------------------
// End Of File
//-----------------------------------------------------------------------------