/*
 * @file   AXHMatrixGain.cpp
 * @brief  Source file of Matrix Gain Class
 * @par    Programming Language
 *         C++
 */

#include "AXHMatrixGain.hpp"
#include "AXHRegAddr.hpp"


#define MASK_MATRIX_MODE  0x00020000ul
#define SFT_MATRIX_MODE   17

AXHMatrixGain::AXHMatrixGain() {
	// 現状ハードとは異なるため不要
	/*
  p_c0 = (unsigned int *)AXH_RSZ_C0;
  p_crGain[0] = (unsigned int *)AXH_RG_RZ_CSCF22;
  p_crGain[1] = (unsigned int *)AXH_RG_RZ_CSCFB22;
  p_crGain[2] = (unsigned int *)AXH_RG_RZ_CSCFC22;
  p_crGain[3] = (unsigned int *)AXH_RG_RZ_CSCFD22;
  p_cbGain[0] = (unsigned int *)AXH_RG_RZ_CSCF11;
  p_cbGain[1] = (unsigned int *)AXH_RG_RZ_CSCFB11;
  p_cbGain[2] = (unsigned int *)AXH_RG_RZ_CSCFC11;
  p_cbGain[3] = (unsigned int *)AXH_RG_RZ_CSCFD11;
  p_crMatrixGain[0] = (unsigned int *)AXH_RG_RZ_CSCF21;
  p_crMatrixGain[1] = (unsigned int *)AXH_RG_RZ_CSCFB21;
  p_crMatrixGain[2] = (unsigned int *)AXH_RG_RZ_CSCFC21;
  p_crMatrixGain[3] = (unsigned int *)AXH_RG_RZ_CSCFD21;
  p_cbMatrixGain[0] = (unsigned int *)AXH_RG_RZ_CSCF12;
  p_cbMatrixGain[1] = (unsigned int *)AXH_RG_RZ_CSCFB12;
  p_cbMatrixGain[2] = (unsigned int *)AXH_RG_RZ_CSCFC12;
  p_cbMatrixGain[3] = (unsigned int *)AXH_RG_RZ_CSCFD12;
  p_YGain[0] = (unsigned int *)AXH_RG_RZ_CSCF00;
  p_YGain[1] = (unsigned int *)AXH_RG_RZ_CSCFB00;
  p_YGain[2] = (unsigned int *)AXH_RG_RZ_CSCFC00;
  p_YGain[3] = (unsigned int *)AXH_RG_RZ_CSCFD00;
  p_CSOS[0] = (unsigned int *)AXH_RG_RZ_CSOS0;
  p_CSOS[1] = (unsigned int *)AXH_RG_RZ_CSOS1;
  p_CSOS[2] = (unsigned int *)AXH_RG_RZ_CSOS2;
  p_CSBC = (unsigned int *)AXH_RG_RZ_CSBC;
  *p_CSOS[1] = AXHMatrixGain_CSOS1;
  *p_CSOS[2] = AXHMatrixGain_CSOS2;
  *p_CSBC = AXHMatrixGain_CSBC;

  mode = (*p_c0 & MASK_MATRIX_MODE) >> SFT_MATRIX_MODE;
  for(unsigned int i = 0; i < AXHMatrixGainMax; i++) {
    crGain[i] = *p_crGain[i];
    cbGain[i] = *p_cbGain[i];
    crcbGain[i] = *p_crMatrixGain[i];
    cbcrGain[i] = *p_cbMatrixGain[i];
  }
  YGain = *p_YGain[0];
  YOffset = *p_CSOS[0];
	*/
}

AXHMatrixGain::~AXHMatrixGain() {
}

unsigned int AXHMatrixGain::getCrGain(unsigned int index) {
	// 現状ハードとは異なるため不要
	/*
  if(index < AXHMatrixGainMax) {
    return crGain[index];
  }
  return AXHMatrixGain_Error_Param;
	*/
	return 0;
}

void AXHMatrixGain::setMode(unsigned int mode) {
	// 現状ハードとは異なるため不要
	/*
  this->mode = mode;
  *p_c0 = ((mode << SFT_MATRIX_MODE) & MASK_MATRIX_MODE);
	*/
}

unsigned int AXHMatrixGain::getMode() {
	// 現状ハードとは異なるため不要
	/*
  return mode;
	*/
	return 0;
}

void AXHMatrixGain::setCrGain(unsigned int index, unsigned int crGain) {
	// 現状ハードとは異なるため不要
	/*
  if(index < AXHMatrixGainMax) {
    this->crGain[index] = crGain;
    *p_crGain[index] = this->crGain[index];
  }
	*/
}

unsigned int AXHMatrixGain::getCbGain(unsigned int index) {
	// 現状ハードとは異なるため不要
	/*
  if(index < AXHMatrixGainMax) {
    return cbGain[index];
  }
  return AXHMatrixGain_Error_Param;
	*/
	return 0;
}

void AXHMatrixGain::setCbGain(unsigned int index, unsigned int cbGain) {
	// 現状ハードとは異なるため不要
	/*
  if(index < AXHMatrixGainMax) {
    this->cbGain[index] = cbGain;
    *p_cbGain[index] = this->cbGain[index];
  }
	*/
}

unsigned int AXHMatrixGain::getCrCbGain(unsigned int index) {
	// 現状ハードとは異なるため不要
	/*
  if(index < AXHMatrixGainMax) {
    return crcbGain[index];
  }
  return AXHMatrixGain_Error_Param;
	*/
	return 0;
}

void AXHMatrixGain::setCrCbGain(unsigned int index, unsigned int crcbGain) {
	// 現状ハードとは異なるため不要
	/*
  if(index < AXHMatrixGainMax) {
    this->crcbGain[index] = crcbGain;
    *p_crMatrixGain[index] = this->crcbGain[index];
  }
	*/
}

unsigned int AXHMatrixGain::getCbCrGain(unsigned int index) {
	// 現状ハードとは異なるため不要
	/*
  if(index < AXHMatrixGainMax) {
    return cbcrGain[index];
  }
  return AXHMatrixGain_Error_Param;
	*/
	return 0;
}

void AXHMatrixGain::setCbCrGain(unsigned int index, unsigned int cbcrGain) {
	// 現状ハードとは異なるため不要
	/*
  if(index < AXHMatrixGainMax) {
    this->cbcrGain[index] = cbcrGain;
    *p_cbMatrixGain[index] = this->cbcrGain[index];
  }
	*/
}

unsigned int AXHMatrixGain::getYGain() {
	// 現状ハードとは異なるため不要
	/*
  return YGain;
	*/
	return 0;
}

void AXHMatrixGain::setYGain(unsigned int yGain) {
	// 現状ハードとは異なるため不要
	/*
  YGain = (yGain & AXH_MASK_CSCF);
  for(unsigned int i = 0; i < AXHMatrixGainMax; i++) {
    *p_YGain[i] = YGain;
  }
	*/
}

unsigned short AXHMatrixGain::getYOffset() {
	// 現状ハードとは異なるため不要
	/*
  return YOffset;
	*/
	return 0;
}

void AXHMatrixGain::setYOffset(unsigned short yOffset) {
	// 現状ハードとは異なるため不要
	/*
  YOffset = (yOffset & AXH_MASK_CSOS);
  *p_CSOS[0] = YOffset;
	*/
}


AXHRGBMatrixCoef::AXHRGBMatrixCoef() {
	// 現状ハードとは異なるため不要
	/*
  p_Coef[0][0] = (unsigned int *)AXH_LMCF00;
  p_Coef[0][1] = (unsigned int *)AXH_LMCF01;
  p_Coef[0][2] = (unsigned int *)AXH_LMCF02;
  p_Coef[0][3] = (unsigned int *)AXH_LMCF03;
  p_Coef[1][0] = (unsigned int *)AXH_LMCF10;
  p_Coef[1][1] = (unsigned int *)AXH_LMCF11;
  p_Coef[1][2] = (unsigned int *)AXH_LMCF12;
  p_Coef[1][3] = (unsigned int *)AXH_LMCF13;
  p_Coef[2][0] = (unsigned int *)AXH_LMCF20;
  p_Coef[2][1] = (unsigned int *)AXH_LMCF21;
  p_Coef[2][2] = (unsigned int *)AXH_LMCF22;
  p_Coef[2][3] = (unsigned int *)AXH_LMCF23;
  p_Coef[3][0] = (unsigned int *)AXH_LMCF30;
  p_Coef[3][1] = (unsigned int *)AXH_LMCF31;
  p_Coef[3][2] = (unsigned int *)AXH_LMCF32;
  p_Coef[3][3] = (unsigned int *)AXH_LMCF33;
  p_Offset[0] = (unsigned int *)AXH_LMOF0;
  p_Offset[1] = (unsigned int *)AXH_LMOF1;
  p_Offset[2] = (unsigned int *)AXH_LMOF2;
  p_Offset[3] = (unsigned int *)AXH_LMOF3;
  p_Ctrl = (unsigned int *)AXH_LMBC;

  for(unsigned int i = 0; i < AXH_RGBMatrixOut_Max; i++) {
    for(unsigned int j = 0; j < AXH_RGBMatrixIn_Max; j++) {
      Coef  [i][j] = *p_Coef  [i][j];
      Offset[i]    = *p_Offset[i];
    }
  }
  Ctrl = *p_Ctrl;
	*/
}

AXHRGBMatrixCoef::~AXHRGBMatrixCoef() {
}

unsigned short AXHRGBMatrixCoef::getCoef(unsigned int inIndex, unsigned int outIndex) {
	// 現状ハードとは異なるため不要
	/*
  if((inIndex < AXH_RGBMatrixIn_Max) && (outIndex < AXH_RGBMatrixOut_Max)) {
    return Coef[outIndex][inIndex];
  }
  return AXH_RGBMatrix_Error_Param;
	*/
	return 0;
}

void AXHRGBMatrixCoef::setCoef(unsigned int inIndex, unsigned int outIndex, unsigned short coef) {
	// 現状ハードとは異なるため不要
	/*
  if((inIndex < AXH_RGBMatrixIn_Max) && (outIndex < AXH_RGBMatrixOut_Max)) {
    Coef[outIndex][inIndex] = coef;
    *p_Coef[outIndex][inIndex] = Coef[outIndex][inIndex];
  }
	*/
}

unsigned short AXHRGBMatrixCoef::getOffset(unsigned int outIndex) {
	// 現状ハードとは異なるため不要
	/*
  if(outIndex < AXH_RGBMatrixOut_Max) {
    return Offset[outIndex];
  }
  return AXH_RGBMatrix_Error_Param;
	*/
	return 0;
}

void AXHRGBMatrixCoef::setOffset(unsigned int outIndex, unsigned short offset) {
	// 現状ハードとは異なるため不要
	/*
  if(outIndex < AXH_RGBMatrixOut_Max) {
    Offset[outIndex] = offset;
    *p_Offset[outIndex] = Offset[outIndex];
  }
	*/
}

unsigned int AXHRGBMatrixCoef::getRegCtrl() {
	// 現状ハードとは異なるため不要
	/*
  return Ctrl;
	*/
	return 0;
}

void AXHRGBMatrixCoef::setRegCtrl(unsigned int ctrl) {
	// 現状ハードとは異なるため不要
	/*
  Ctrl = ctrl;
  *p_Ctrl = Ctrl;
	*/
}
