tahoma2d/toonz/sources/colorfx/zigzagstyles.h

74 lines
1.9 KiB
C
Raw Normal View History

2016-05-17 03:04:11 +12:00
#pragma once
2016-03-19 06:57:51 +13:00
#ifndef ZIGZAG_STROKE_STYLE_H
#define ZIGZAG_STROKE_STYLE_H
#include "tpixel.h"
#ifdef POICIPENSO
class TZigzagStrokeStyle final : public TStrokeStyle {
2016-06-15 18:43:10 +12:00
TPixel32 m_color;
double m_density;
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
TZigzagStrokeStyle(const TPixel32 &color);
TZigzagStrokeStyle();
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
void invalidate() {}
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
void changeParameter(double delta);
TStrokeStyle *clone() const;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
void draw(double pixelSize, const TColorFunction * = 0);
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
void loadData(TInputStreamInterface &is) { is >> m_color >> m_density; }
void saveData(TOutputStreamInterface &os) const {
os << m_color << m_density;
}
bool isSaveSupported() { return true; }
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
int getTagId() const { return 115; };
bool operator==(const TStrokeStyle &style) const {
if (getTagId() != style.getTagId()) return false;
return m_color == ((TZigzagStrokeStyle &)style).m_color &&
m_density == ((TZigzagStrokeStyle &)style).m_density;
}
2016-03-19 06:57:51 +13:00
};
class TImageBasedZigzagStrokeStyle final : public TStrokeStyle {
2016-06-15 18:43:10 +12:00
TPixel32 m_color;
double m_textScale;
TRaster32P m_texture;
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
TImageBasedZigzagStrokeStyle(const TPixel32 &color);
TImageBasedZigzagStrokeStyle();
TImageBasedZigzagStrokeStyle(const TRaster32P texture);
void invalidate() {}
inline int realTextCoord(const int a, const int l) const;
void changeParameter(double delta);
TStrokeStyle *clone() const;
void draw(double pixelSize, const TColorFunction * = 0);
void loadData(TInputStreamInterface &is) { is >> m_color >> m_textScale; }
void saveData(TOutputStreamInterface &os) const {
os << m_color << m_textScale;
}
bool isSaveSupported() { return true; }
int getTagId() const { return 116; };
bool operator==(const TStrokeStyle &style) const {
if (getTagId() != style.getTagId()) return false;
return m_color == ((TImageBasedZigzagStrokeStyle &)style).m_color &&
m_textScale == ((TImageBasedZigzagStrokeStyle &)style).m_textScale;
}
2016-03-19 06:57:51 +13:00
};
#endif
#endif