Shinya Kitaoka 810553
#pragma once
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
// YOMBInputParam.h: interface for the CYOMBInputParam class.
Toshihiro Shimizu 890ddd
//
Toshihiro Shimizu 890ddd
//////////////////////////////////////////////////////////////////////
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
#if !defined(                                                                  \
Shinya Kitaoka 120a6e
    AFX_YOMBINPUTPARAM_H__41D42153_F2EE_11D5_B92D_0040F674BE6A__INCLUDED_)
Toshihiro Shimizu 890ddd
#define AFX_YOMBINPUTPARAM_H__41D42153_F2EE_11D5_B92D_0040F674BE6A__INCLUDED_
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "SDef.h"
Toshihiro Shimizu 890ddd
#include "InputParam.h"
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
#define MAXNBCIL 4096  // 512
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
typedef struct color_index_list {
Shinya Kitaoka 120a6e
  int nb;
Shinya Kitaoka 120a6e
  unsigned short ci[MAXNBCIL];
Toshihiro Shimizu 890ddd
} COLOR_INDEX_LIST;
Toshihiro Shimizu 890ddd
Shinya Kitaoka d1f6c4
class CYOMBInputParam final : public CInputParam {
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  bool m_isRandomSampling;
Shinya Kitaoka 120a6e
  bool m_isShowSelection;
Shinya Kitaoka 120a6e
  bool m_isStopAtContour;
Shinya Kitaoka 120a6e
  double m_dSample;
Shinya Kitaoka 120a6e
  int m_nbSample;
Shinya Kitaoka 120a6e
  double m_dA, m_dAB;
Shinya Kitaoka 120a6e
  // RGB parameters. List of RGB colors.
Shinya Kitaoka 120a6e
  int m_color[5][4];
Shinya Kitaoka 120a6e
  int m_nbColor;
Shinya Kitaoka 120a6e
  // CMAP Parameters. The list of ink & paint indices.
Shinya Kitaoka 120a6e
  COLOR_INDEX_LIST m_ink, m_paint;
Shinya Kitaoka 120a6e
  bool m_isCM;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  CYOMBInputParam()
Shinya Kitaoka 120a6e
      : m_isRandomSampling(false)
Shinya Kitaoka 120a6e
      , m_isShowSelection(false)
Shinya Kitaoka 120a6e
      , m_isStopAtContour(false)
Shinya Kitaoka 120a6e
      , m_dSample(0.0)
Shinya Kitaoka 120a6e
      , m_nbSample(0)
Shinya Kitaoka 120a6e
      , m_dA(0.0)
Shinya Kitaoka 120a6e
      , m_dAB(0.0)
Shinya Kitaoka 120a6e
      , m_nbColor(0)
Shinya Kitaoka 120a6e
      , m_isCM(false) {
Shinya Kitaoka 120a6e
    for (int i      = 0; i < 5; i++)
Shinya Kitaoka 120a6e
      m_color[i][0] = m_color[i][1] = m_color[i][2] = m_color[i][3] = 0;
Shinya Kitaoka 120a6e
    m_ink.nb = m_paint.nb = 0;
Shinya Kitaoka 120a6e
  };
Shinya Kitaoka 120a6e
  CYOMBInputParam(const CYOMBInputParam &p)
Shinya Kitaoka 120a6e
      : CInputParam(p)
Shinya Kitaoka 120a6e
      , m_isRandomSampling(p.m_isRandomSampling)
Shinya Kitaoka 120a6e
      , m_isShowSelection(p.m_isShowSelection)
Shinya Kitaoka 120a6e
      , m_isStopAtContour(p.m_isStopAtContour)
Shinya Kitaoka 120a6e
      , m_dSample(p.m_dSample)
Shinya Kitaoka 120a6e
      , m_nbSample(p.m_nbSample)
Shinya Kitaoka 120a6e
      , m_dA(p.m_dA)
Shinya Kitaoka 120a6e
      , m_dAB(p.m_dAB)
Shinya Kitaoka 120a6e
      , m_nbColor(p.m_nbColor)
Shinya Kitaoka 120a6e
      , m_isCM(p.m_isCM) {
Shinya Kitaoka 120a6e
    if (m_isCM) {
Shinya Kitaoka 120a6e
      m_ink.nb = p.m_ink.nb;
Shinya Kitaoka 120a6e
      int i    = 0;
Shinya Kitaoka 120a6e
      for (i = 0; i < m_ink.nb; i++) m_ink.ci[i] = p.m_ink.ci[i];
Shinya Kitaoka 120a6e
      m_paint.nb                                 = p.m_paint.nb;
Shinya Kitaoka 120a6e
      for (i = 0; i < m_paint.nb; i++) m_paint.ci[i] = p.m_paint.ci[i];
Shinya Kitaoka 120a6e
    } else
Shinya Kitaoka 120a6e
      for (int i = 0; i < 5; i++)
Shinya Kitaoka 120a6e
        for (int j = 0; j < 4; j++) m_color[i][j] = p.m_color[i][j];
Shinya Kitaoka 120a6e
  };
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  CYOMBInputParam(const int argc, const char *argv[], const int shrink);
Shinya Kitaoka 120a6e
  CYOMBInputParam(const int argc, const char *argv[], const int shrink,
Shinya Kitaoka 120a6e
                  const bool isCM16);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  virtual ~CYOMBInputParam(){};
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  void makeColorIndexList(const char *s, COLOR_INDEX_LIST &cil,
Shinya Kitaoka 120a6e
                          const int maxIndex);
Shinya Kitaoka 120a6e
  bool isRange(const char *s) const;
Shinya Kitaoka 120a6e
  int getRangeBegin(const char *s) const;
Shinya Kitaoka 120a6e
  int getRangeEnd(const char *s) const;
Shinya Kitaoka 120a6e
  void strToColorIndex(const char *s, COLOR_INDEX_LIST &cil,
Shinya Kitaoka 120a6e
                       const int maxIndex);
Shinya Kitaoka 120a6e
  void print(COLOR_INDEX_LIST &cil);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  //	void makeBlendString(const char *ss);
Shinya Kitaoka 120a6e
  bool isOK();
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
#endif  // !defined(AFX_YOMBINPUTPARAM_H__41D42153_F2EE_11D5_B92D_0040F674BE6A__INCLUDED_)