/*
 * gc_geometry.h
 *
 *  Created on: 17/ott/2017
 *      Author: chessaa
 */

#ifndef GC_GEOMETRY_H_
#define GC_GEOMETRY_H_



namespace gc_cfg
{

#define GC_GEOMETRY_VGA

#define GC_GEOMETRY_NAME "BR"

#define GC_DISPLAY_ASPECT_RATIO(x_) ((x_)/4)*3
enum rdr_display_geometry_k_
{
  //XY_PHYSICAL_DISPLAY_DIMENSION = 512,
  XY_LOGICAL_DISPLAY_DIMENSION  = 484,
  //XY_LOGICAL_DISPLAY_OFFSET = 0, //((((XY_PHYSICAL_DISPLAY_DIMENSION-XY_LOGICAL_DISPLAY_DIMENSION)/2)+3) & 0x0FFFC) /*round to multiple of 4*/ ,

  //X_LOGICAL_DISPLAY_OFFSET=XY_LOGICAL_DISPLAY_OFFSET, X_PHYSICAL_DISPLAY_DIMENSION = XY_PHYSICAL_DISPLAY_DIMENSION,
  //Y_LOGICAL_DISPLAY_OFFSET=XY_LOGICAL_DISPLAY_OFFSET, Y_PHYSICAL_DISPLAY_DIMENSION = XY_PHYSICAL_DISPLAY_DIMENSION,
#ifdef GC_GEOMETRY_VGA
  X_PHYSICAL_DISPLAY_DIMENSION = 640,
  Y_PHYSICAL_DISPLAY_DIMENSION = 512, //real dimension is 484, extend for some debug info to be displayed only at higher resolutions GC_DISPLAY_ASPECT_RATIO(X_PHYSICAL_DISPLAY_DIMENSION),

  Y_PHYSICAL_DISPLAY_OUTPUT = 484, //real dimension is 484, extend for some debug info to be displayed only at higher resolutions GC_DISPLAY_ASPECT_RATIO(X_PHYSICAL_DISPLAY_DIMENSION),

  X_LOGICAL_DISPLAY_OFFSET=(X_PHYSICAL_DISPLAY_DIMENSION-XY_LOGICAL_DISPLAY_DIMENSION)/2,
  Y_LOGICAL_DISPLAY_OFFSET=0, //(Y_PHYSICAL_DISPLAY_DIMENSION-XY_LOGICAL_DISPLAY_DIMENSION)/2,
#else
  X_PHYSICAL_DISPLAY_DIMENSION = 512,
  Y_PHYSICAL_DISPLAY_DIMENSION = 512, //GC_DISPLAY_ASPECT_RATIO(X_PHYSICAL_DISPLAY_DIMENSION),
  Y_PHYSICAL_DISPLAY_OUTPUT = Y_PHYSICAL_DISPLAY_DIMENSION, //real dimension is 484, extend for osme debug info to be displayed only at higher resolutions GC_DISPLAY_ASPECT_RATIO(X_PHYSICAL_DISPLAY_DIMENSION),

  X_LOGICAL_DISPLAY_OFFSET=0, //(X_PHYSICAL_DISPLAY_DIMENSION-XY_LOGICAL_DISPLAY_DIMENSION)/2,
  Y_LOGICAL_DISPLAY_OFFSET=0, //(Y_PHYSICAL_DISPLAY_DIMENSION-XY_LOGICAL_DISPLAY_DIMENSION)/2,
#endif

  X_ABS_DIMENSION = XY_LOGICAL_DISPLAY_DIMENSION,
  Y_ABS_DIMENSION = XY_LOGICAL_DISPLAY_DIMENSION,

  X_ABS_CENTRE_DISPL=X_ABS_DIMENSION/2,
  Y_ABS_CENTRE_DISPL=Y_ABS_DIMENSION/2,

  X_MOVWIN_OFFSET=0,
  Y_MOVWIN_OFFSET=0,

  X_SCALE_OFFSET_TOP=1,
  X_SCALE_OFFSET_BOTTOM=2,
  Y_SCALE_OFFSET_TOP=1,
  Y_SCALE_OFFSET_BOTTOM=2,

  X_DIMENSION = (X_ABS_DIMENSION-X_MOVWIN_OFFSET*2),
  Y_DIMENSION = (Y_ABS_DIMENSION-Y_MOVWIN_OFFSET*2),

  X_CENTRE_DISPL=(X_DIMENSION/2)-1,
  Y_CENTRE_DISPL=(X_DIMENSION/2)-1,

  Y_ZERO_RANGE = (Y_DIMENSION-1)-Y_SCALE_OFFSET_BOTTOM,
  Y_FULL_RANGE = Y_SCALE_OFFSET_TOP,
  LEN_1D4_RNG  = ((Y_ZERO_RANGE-Y_FULL_RANGE)/4),

  X_ZERO_RNG_PPI=X_CENTRE_DISPL,
  Y_ZERO_RNG_PPI=Y_ZERO_RANGE,
  Y_FULL_RNG_PPI=Y_FULL_RANGE,

  LEN_1D4_RNG_PPI=((Y_ZERO_RNG_PPI-Y_FULL_RNG_PPI)/4),
  LEN_1D2_RNG_PPI=((Y_ZERO_RNG_PPI-Y_FULL_RNG_PPI)/2),
  LEN_3D4_RNG_PPI=(((Y_ZERO_RNG_PPI-Y_FULL_RNG_PPI)*3)/4),

  X_MIN_PIX_DISPL=0,
  X_MAX_PIX_DISPL=(X_DIMENSION-1),
  Y_MIN_PIX_DISPL=0,
  Y_MAX_PIX_DISPL=(Y_DIMENSION-1)
};


}//namespace

#endif /* GC_GEOMETRY_H_ */
