|
Shinya Kitaoka |
810553 |
#pragma once
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#ifndef TCOLORSTYLES_H
|
|
Toshihiro Shimizu |
890ddd |
#define TCOLORSTYLES_H
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#include "tfilepath.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "traster.h"
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#include <qstring></qstring>
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#undef DVAPI
|
|
Toshihiro Shimizu |
890ddd |
#undef DVVAR
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#ifdef TVRENDER_EXPORTS
|
|
Toshihiro Shimizu |
890ddd |
#define DVAPI DV_EXPORT_API
|
|
Toshihiro Shimizu |
890ddd |
#define DVVAR DV_EXPORT_VAR
|
|
Toshihiro Shimizu |
890ddd |
#else
|
|
Toshihiro Shimizu |
890ddd |
#define DVAPI DV_IMPORT_API
|
|
Toshihiro Shimizu |
890ddd |
#define DVVAR DV_IMPORT_VAR
|
|
Toshihiro Shimizu |
890ddd |
#endif
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
class TStroke;
|
|
Toshihiro Shimizu |
890ddd |
class TRegion;
|
|
Toshihiro Shimizu |
890ddd |
class TStrokeProp;
|
|
Toshihiro Shimizu |
890ddd |
class TRegionProp;
|
|
Toshihiro Shimizu |
890ddd |
class TVectorRenderData;
|
|
Toshihiro Shimizu |
890ddd |
class TFlash;
|
|
Toshihiro Shimizu |
890ddd |
class TInputStreamInterface;
|
|
Toshihiro Shimizu |
890ddd |
class TOutputStreamInterface;
|
|
Toshihiro Shimizu |
890ddd |
class TRasterStyleFx;
|
|
Toshihiro Shimizu |
890ddd |
class QStringList;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//************************************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//************************************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
class DVAPI TRasterStyleFx {
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Shinya Kitaoka |
120a6e |
struct Params {
|
|
Shinya Kitaoka |
120a6e |
TRasterP m_r;
|
|
Shinya Kitaoka |
120a6e |
TPoint m_p;
|
|
Shinya Kitaoka |
120a6e |
TRasterP m_rOrig;
|
|
Shinya Kitaoka |
120a6e |
int m_colorIndex;
|
|
Shinya Kitaoka |
120a6e |
int m_frame;
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
public:
|
|
Shinya Kitaoka |
120a6e |
Params(const TRasterP &r, const TPoint &p, const TRasterP &rOrig, int index,
|
|
Shinya Kitaoka |
120a6e |
int frame)
|
|
Shinya Kitaoka |
120a6e |
: m_r(r), m_p(p), m_rOrig(rOrig), m_colorIndex(index), m_frame(frame) {
|
|
Shinya Kitaoka |
120a6e |
assert(m_r);
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Shinya Kitaoka |
120a6e |
virtual ~TRasterStyleFx() {}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
virtual bool isInkStyle() const = 0;
|
|
Shinya Kitaoka |
120a6e |
virtual bool isPaintStyle() const = 0;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
virtual bool inkFxNeedRGBMRaster() const { return false; }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
virtual bool compute(const Params ¶ms) const = 0;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
virtual void getEnlargement(int &borderIn, int &borderOut) const {
|
|
Shinya Kitaoka |
120a6e |
borderIn = borderOut = 0;
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//************************************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//************************************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
/*!
|
|
Toshihiro Shimizu |
890ddd |
\brief Abstract class representing a color style in a Toonz palette.
|
|
Toshihiro Shimizu |
890ddd |
*/
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
class DVAPI TColorStyle : public TSmartObject {
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Shinya Kitaoka |
120a6e |
//! Helper class to declare color styles
|
|
Shinya Kitaoka |
120a6e |
class Declaration {
|
|
Shinya Kitaoka |
120a6e |
public:
|
|
Shinya Kitaoka |
120a6e |
Declaration(TColorStyle *style) { declare(style); }
|
|
Shinya Kitaoka |
120a6e |
};
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
enum ParamType {
|
|
Shinya Kitaoka |
120a6e |
BOOL,
|
|
Shinya Kitaoka |
120a6e |
INT, //!< Integer parameter type.
|
|
Shinya Kitaoka |
120a6e |
ENUM, //!< Enum parameter type (maps to integer values).
|
|
Shinya Kitaoka |
120a6e |
DOUBLE, //!< Double parameter type (getParamType() default).
|
|
Shinya Kitaoka |
120a6e |
FILEPATH //!< TFilePath parameter type.
|
|
Shinya Kitaoka |
120a6e |
};
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
struct double_tag {};
|
|
Shinya Kitaoka |
120a6e |
struct bool_tag {};
|
|
Shinya Kitaoka |
120a6e |
struct int_tag {};
|
|
Shinya Kitaoka |
120a6e |
struct TFilePath_tag {};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
private:
|
|
Shinya Kitaoka |
120a6e |
std::wstring m_name;
|
|
Shinya Kitaoka |
120a6e |
std::wstring m_globalName;
|
|
Shinya Kitaoka |
120a6e |
std::wstring m_originalName;
|
|
Shinya Kitaoka |
38fd86 |
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
int m_versionNumber;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
unsigned int m_flags;
|
|
Shinya Kitaoka |
120a6e |
bool m_enabled;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
bool m_isEditedFromOriginal;
|
|
Shinya Kitaoka |
38fd86 |
|
|
Shinya Kitaoka |
38fd86 |
|
|
Toshihiro Shimizu |
890ddd |
|
|
shun_iwasawa |
e897af |
TPoint m_pickedPosition; // picked position from color model by using style
|
|
shun_iwasawa |
e897af |
// picker tool with "organize palette" option.
|
|
shun_iwasawa |
e897af |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Shinya Kitaoka |
120a6e |
TRaster32P m_icon;
|
|
Shinya Kitaoka |
120a6e |
bool m_validIcon;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Shinya Kitaoka |
120a6e |
static int m_currentFrame;
|
|
Shinya Kitaoka |
120a6e |
//! \deprecated Should be done better
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Shinya Kitaoka |
120a6e |
TColorStyle();
|
|
Shinya Kitaoka |
120a6e |
TColorStyle(
|
|
Shinya Kitaoka |
120a6e |
const TColorStyle &other);
|
|
Shinya Kitaoka |
120a6e |
virtual ~TColorStyle();
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
virtual TColorStyle *clone() const = 0;
|
|
Shinya Kitaoka |
120a6e |
virtual TColorStyle ©(
|
|
Shinya Kitaoka |
120a6e |
const TColorStyle &other)
|
|
Shinya Kitaoka |
120a6e |
{
|
|
Shinya Kitaoka |
120a6e |
assignBlend(other, other, 0.0);
|
|
Shinya Kitaoka |
120a6e |
return *this;
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
bool operator==(const TColorStyle &cs) const;
|
|
Shinya Kitaoka |
120a6e |
bool operator!=(const TColorStyle &cs) { return !operator==(cs); }
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
virtual TStrokeProp *makeStrokeProp(
|
|
Shinya Kitaoka |
120a6e |
const TStroke
|
|
Shinya Kitaoka |
120a6e |
*stroke) = 0;
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
virtual TRegionProp *makeRegionProp(
|
|
Shinya Kitaoka |
120a6e |
const TRegion
|
|
Shinya Kitaoka |
120a6e |
*region) = 0;
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
virtual bool isRasterStyle() const {
|
|
Shinya Kitaoka |
120a6e |
return false;
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
virtual TRasterStyleFx *getRasterStyleFx() {
|
|
Shinya Kitaoka |
120a6e |
return 0;
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
//! else returns 0.
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
virtual bool isRegionStyle()
|
|
Shinya Kitaoka |
120a6e |
const = 0;
|
|
Shinya Kitaoka |
120a6e |
virtual bool isStrokeStyle()
|
|
Shinya Kitaoka |
120a6e |
const = 0;
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
// General functions
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
void setName(std::wstring name) {
|
|
Shinya Kitaoka |
120a6e |
m_name = name;
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
std::wstring getName() const {
|
|
Shinya Kitaoka |
120a6e |
return m_name;
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
/*! \detail
|
|
Shinya Kitaoka |
120a6e |
The \a global name contains information about palette id.
|
|
Shinya Kitaoka |
120a6e |
*/
|
|
Shinya Kitaoka |
120a6e |
void setGlobalName(std::wstring name) {
|
|
Shinya Kitaoka |
120a6e |
m_globalName = name;
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
std::wstring getGlobalName() const {
|
|
Shinya Kitaoka |
120a6e |
return m_globalName;
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
void setOriginalName(std::wstring name) {
|
|
Shinya Kitaoka |
120a6e |
m_originalName = name;
|
|
Shinya Kitaoka |
120a6e |
} //!< If the style is originally copied from studio palette, set this.
|
|
Shinya Kitaoka |
120a6e |
std::wstring getOriginalName() const {
|
|
Shinya Kitaoka |
120a6e |
return m_originalName;
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
void setIsEditedFlag(bool edited) {
|
|
Shinya Kitaoka |
120a6e |
m_isEditedFromOriginal = edited;
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
38fd86 |
|
|
Shinya Kitaoka |
38fd86 |
|
|
Shinya Kitaoka |
120a6e |
bool getIsEditedFlag() const {
|
|
Shinya Kitaoka |
120a6e |
return m_isEditedFromOriginal;
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
38fd86 |
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
void assignNames(
|
|
Shinya Kitaoka |
120a6e |
const TColorStyle *src);
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
unsigned int getFlags() const { return m_flags; }
|
|
Shinya Kitaoka |
120a6e |
void setFlags(unsigned int flags) {
|
|
Shinya Kitaoka |
120a6e |
m_flags = flags;
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
|
|
shun_iwasawa |
e897af |
void setPickedPosition(const TPoint &pos) { m_pickedPosition = pos; }
|
|
shun_iwasawa |
e897af |
TPoint getPickedPosition() const { return m_pickedPosition; }
|
|
shun_iwasawa |
e897af |
|
|
Shinya Kitaoka |
120a6e |
// Color-related functions
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
/*! \detail
|
|
Shinya Kitaoka |
120a6e |
Raster or vector pattern image styles, for example, return false.
|
|
Shinya Kitaoka |
120a6e |
*/
|
|
Shinya Kitaoka |
120a6e |
virtual bool hasMainColor() const {
|
|
Shinya Kitaoka |
120a6e |
return false;
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
virtual TPixel32 getMainColor() const {
|
|
Shinya Kitaoka |
120a6e |
return TPixel32::Black;
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
virtual void setMainColor(const TPixel32 &color) {
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
/*! \detail
|
|
Shinya Kitaoka |
120a6e |
For example a bubble styles has two colors.
|
|
Shinya Kitaoka |
120a6e |
By default it returns \p 1 if the style has only a main color else
|
|
Shinya Kitaoka |
120a6e |
returns \p 0 if the style has no color.
|
|
Shinya Kitaoka |
120a6e |
*/
|
|
Shinya Kitaoka |
120a6e |
virtual int getColorParamCount() const {
|
|
Shinya Kitaoka |
120a6e |
return hasMainColor() ? 1 : 0;
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
/*! \detail
|
|
Shinya Kitaoka |
120a6e |
Returns the main color by default.
|
|
Shinya Kitaoka |
120a6e |
*/
|
|
Shinya Kitaoka |
120a6e |
virtual TPixel32 getColorParamValue(int index) const {
|
|
Shinya Kitaoka |
120a6e |
return getMainColor();
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
virtual void setColorParamValue(int index, const TPixel32 &color) {
|
|
Shinya Kitaoka |
120a6e |
setMainColor(color);
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
virtual TPixel32 getAverageColor() const {
|
|
Shinya Kitaoka |
120a6e |
return getMainColor();
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
// Parameters-related functions
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
/*! \detail
|
|
Shinya Kitaoka |
120a6e |
For example: a the general cleanup style has two parameters, brightness and
|
|
Shinya Kitaoka |
120a6e |
contrast and
|
|
Shinya Kitaoka |
120a6e |
a black cleanup style has in addition a black and white threshold, therefore
|
|
Shinya Kitaoka |
120a6e |
4 parameters.
|
|
Shinya Kitaoka |
120a6e |
*/
|
|
Shinya Kitaoka |
120a6e |
virtual int getParamCount() const {
|
|
Shinya Kitaoka |
120a6e |
return 0;
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
virtual ParamType getParamType(int paramIdx) const {
|
|
Shinya Kitaoka |
120a6e |
assert(0 <= paramIdx && paramIdx < getParamCount());
|
|
Shinya Kitaoka |
120a6e |
return DOUBLE;
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
|
|
|
bf1d82 |
virtual bool hasParamDefault(int index) const {
|
|
|
bf1d82 |
return false;
|
|
|
bf1d82 |
} //!< Value of parameter can be reset to default.
|
|
|
bf1d82 |
|
|
|
bf1d82 |
virtual void setParamDefault(int index) {
|
|
|
bf1d82 |
assert(false);
|
|
|
bf1d82 |
} //!< Reset value of parameter to default.
|
|
|
bf1d82 |
|
|
|
bf1d82 |
virtual bool isParamDefault(int index) const {
|
|
|
bf1d82 |
return false;
|
|
|
bf1d82 |
} //!< Check if current value of parameter equals to default
|
|
|
bf1d82 |
|
|
Shinya Kitaoka |
120a6e |
virtual void setParamValue(int index, bool value) {
|
|
Shinya Kitaoka |
120a6e |
assert(false);
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
virtual bool getParamValue(bool_tag, int index) const {
|
|
Shinya Kitaoka |
120a6e |
assert(false);
|
|
Shinya Kitaoka |
120a6e |
return bool();
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
virtual void setParamValue(int index, int value) {
|
|
Shinya Kitaoka |
120a6e |
assert(false);
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
virtual int getParamValue(int_tag, int index) const {
|
|
Shinya Kitaoka |
120a6e |
assert(false);
|
|
Shinya Kitaoka |
120a6e |
return int();
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
virtual void getParamRange(int index, int &min, int &max) const {
|
|
Shinya Kitaoka |
120a6e |
assert(false);
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
virtual void getParamRange(int pIndex, QStringList &stringItems) const {
|
|
Shinya Kitaoka |
120a6e |
assert(false);
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
//! extension value in text form.
|
|
Shinya Kitaoka |
120a6e |
virtual void setParamValue(int index, double value) {
|
|
Shinya Kitaoka |
120a6e |
assert(false);
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
virtual double getParamValue(double_tag, int index) const {
|
|
Shinya Kitaoka |
120a6e |
assert(false);
|
|
Shinya Kitaoka |
120a6e |
return double();
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
virtual void getParamRange(int index, double &min, double &max) const {
|
|
Shinya Kitaoka |
120a6e |
assert(false);
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
virtual void setParamValue(int index, const TFilePath &fp) {
|
|
Shinya Kitaoka |
120a6e |
assert(false);
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
virtual TFilePath getParamValue(TFilePath_tag, int index) const {
|
|
Shinya Kitaoka |
120a6e |
assert(false);
|
|
Shinya Kitaoka |
120a6e |
return TFilePath();
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
/*! \detail
|
|
Shinya Kitaoka |
120a6e |
This function is provided to animate a palette style. Given two keyframe
|
|
Shinya Kitaoka |
120a6e |
styles \p a and \p b, it calculates their linear interpolation at parameter
|
|
Shinya Kitaoka |
120a6e |
\p t and assigns the result to this style instance.
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
\param a Style value at parameter <tt>t = 0</tt>.
|
|
Shinya Kitaoka |
120a6e |
\param b Style value at parameter <tt>t = 1</tt>.
|
|
Shinya Kitaoka |
120a6e |
\param t Interpolation parameter.
|
|
Shinya Kitaoka |
120a6e |
*/
|
|
Shinya Kitaoka |
120a6e |
void assignBlend(const TColorStyle &a, const TColorStyle &b,
|
|
Shinya Kitaoka |
120a6e |
double t);
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
// Description-related functions
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
/*! \detail
|
|
Shinya Kitaoka |
120a6e |
For example for a stroke style we have "Constant", "Chain", "Rope", "Tulle",
|
|
Shinya Kitaoka |
120a6e |
etc...
|
|
Shinya Kitaoka |
120a6e |
*/
|
|
Shinya Kitaoka |
120a6e |
virtual QString getDescription()
|
|
Shinya Kitaoka |
120a6e |
const = 0;
|
|
Shinya Kitaoka |
120a6e |
virtual QString getParamNames(int index)
|
|
Shinya Kitaoka |
120a6e |
const;
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
// Drawing-related functions
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
virtual void drawStroke(TFlash &flash, const TStroke *stroke)
|
|
Shinya Kitaoka |
120a6e |
const;
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
// I/O-related functions
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
virtual int getTagId()
|
|
Shinya Kitaoka |
120a6e |
const = 0;
|
|
Shinya Kitaoka |
120a6e |
virtual void getObsoleteTagIds(std::vector<int> &) const {};
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
void save(TOutputStreamInterface &) const;
|
|
Shinya Kitaoka |
38fd86 |
|
|
Shinya Kitaoka |
38fd86 |
|
|
Shinya Kitaoka |
38fd86 |
|
|
Shinya Kitaoka |
120a6e |
static TColorStyle *load(TInputStreamInterface &);
|
|
Shinya Kitaoka |
38fd86 |
|
|
Shinya Kitaoka |
38fd86 |
|
|
Shinya Kitaoka |
38fd86 |
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
static TColorStyle *create(
|
|
Shinya Kitaoka |
120a6e |
int tagId);
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
static void declare(
|
|
Shinya Kitaoka |
120a6e |
TColorStyle *style);
|
|
Shinya Kitaoka |
120a6e |
static void getAllTags(std::vector<int> &tags);</int>
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
// Misc functions
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
/*! \detail
|
|
Shinya Kitaoka |
120a6e |
It is used when updates must be done after changes or creation of new styles.
|
|
Shinya Kitaoka |
120a6e |
*/
|
|
Shinya Kitaoka |
120a6e |
void invalidateIcon() {
|
|
Shinya Kitaoka |
120a6e |
m_validIcon = false;
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
virtual const TRaster32P &getIcon(
|
|
Shinya Kitaoka |
120a6e |
const TDimension &d);
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
bool isEnabled() const {
|
|
Shinya Kitaoka |
120a6e |
return m_enabled;
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
void enable(bool on) {
|
|
Shinya Kitaoka |
120a6e |
m_enabled = on;
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
int getVersionNumber() const {
|
|
Shinya Kitaoka |
120a6e |
return m_versionNumber;
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Shinya Kitaoka |
120a6e |
virtual void makeIcon(const TDimension &d);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
virtual void loadData(TInputStreamInterface &) = 0;
|
|
Shinya Kitaoka |
120a6e |
virtual void saveData(TOutputStreamInterface &) const = 0;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
virtual void loadData(int, TInputStreamInterface &) {
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
void updateVersionNumber();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Shinya Kitaoka |
120a6e |
TColorStyle &operator=(
|
|
Shinya Kitaoka |
120a6e |
const TColorStyle &other);
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
9f5a1b |
#ifdef _WIN32
|
|
Toshihiro Shimizu |
890ddd |
template class DVAPI TSmartPointerT<tcolorstyle>;</tcolorstyle>
|
|
Toshihiro Shimizu |
890ddd |
#endif
|
|
Toshihiro Shimizu |
890ddd |
typedef TSmartPointerT<tcolorstyle> TColorStyleP;</tcolorstyle>
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
#endif
|