Blame toonz/sources/toonzlib/sandor_fxs/CallParam.cpp
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
// CallParam.cpp: implementation of the CCallParam class.
|
|
Toshihiro Shimizu |
890ddd |
//
|
|
Toshihiro Shimizu |
890ddd |
//////////////////////////////////////////////////////////////////////
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#include <math.h></math.h>
|
|
Toshihiro Shimizu |
890ddd |
#include <stdlib.h></stdlib.h>
|
|
Toshihiro Shimizu |
890ddd |
#include "SDef.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "CallParam.h"
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//////////////////////////////////////////////////////////////////////
|
|
Toshihiro Shimizu |
890ddd |
// Construction/Destruction
|
|
Toshihiro Shimizu |
890ddd |
//////////////////////////////////////////////////////////////////////
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
CCallParam::CCallParam()
|
|
Shinya Kitaoka |
120a6e |
: m_thickness(0.0)
|
|
Shinya Kitaoka |
120a6e |
, m_rH(0.0)
|
|
Shinya Kitaoka |
120a6e |
, m_rV(0.0)
|
|
Shinya Kitaoka |
120a6e |
, m_rLR(0.0)
|
|
Shinya Kitaoka |
120a6e |
, m_rRL(0.0)
|
|
Shinya Kitaoka |
120a6e |
, m_accuracy(0.0)
|
|
Shinya Kitaoka |
120a6e |
, m_randomness(0.0)
|
|
Shinya Kitaoka |
120a6e |
, m_ink()
|
|
Shinya Kitaoka |
120a6e |
, m_paint() {}
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
CCallParam::CCallParam(const int argc, const char *argv[], const int shrink)
|
|
Shinya Kitaoka |
120a6e |
: m_thickness(0.0)
|
|
Shinya Kitaoka |
120a6e |
, m_rH(0.0)
|
|
Shinya Kitaoka |
120a6e |
, m_rV(0.0)
|
|
Shinya Kitaoka |
120a6e |
, m_rLR(0.0)
|
|
Shinya Kitaoka |
120a6e |
, m_rRL(0.0)
|
|
Shinya Kitaoka |
120a6e |
, m_accuracy(0.0)
|
|
Shinya Kitaoka |
120a6e |
, m_randomness(0.0)
|
|
Shinya Kitaoka |
120a6e |
, m_ink()
|
|
Shinya Kitaoka |
120a6e |
, m_paint() {
|
|
Shinya Kitaoka |
120a6e |
if (argc == 8) {
|
|
Shinya Kitaoka |
120a6e |
int i = 7;
|
|
Shinya Kitaoka |
120a6e |
m_thickness = atof(argv[i--]) / (double)shrink;
|
|
Shinya Kitaoka |
120a6e |
m_rH = atof(argv[i--]) / 100.0;
|
|
Shinya Kitaoka |
120a6e |
m_rH = D_CUT_0_1(m_rH);
|
|
Shinya Kitaoka |
120a6e |
m_rLR = atof(argv[i--]) / 100.0;
|
|
Shinya Kitaoka |
120a6e |
m_rLR = D_CUT_0_1(m_rLR);
|
|
Shinya Kitaoka |
120a6e |
m_rV = atof(argv[i--]) / 100.0;
|
|
Shinya Kitaoka |
120a6e |
m_rV = D_CUT_0_1(m_rV);
|
|
Shinya Kitaoka |
120a6e |
m_rRL = atof(argv[i--]) / 100.0;
|
|
Shinya Kitaoka |
120a6e |
m_rRL = D_CUT_0_1(m_rRL);
|
|
Shinya Kitaoka |
120a6e |
m_accuracy = atof(argv[i--]);
|
|
Shinya Kitaoka |
120a6e |
m_randomness = atof(argv[i--]);
|
|
Shinya Kitaoka |
120a6e |
m_ink.set(argv[i--], 4095);
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
CCallParam::~CCallParam() {}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
bool CCallParam::isOK() {
|
|
Shinya Kitaoka |
120a6e |
if (m_thickness < 1.0) return false;
|
|
Shinya Kitaoka |
120a6e |
if (m_rH < 0.01 && m_rLR < 0.01 && m_rV < 0.01 && m_rRL < 0.01) return false;
|
|
Shinya Kitaoka |
120a6e |
return true;
|
|
Toshihiro Shimizu |
890ddd |
}
|