当前位置: 首页>>代码示例>>C++>>正文


C++ GetMaxY函数代码示例

本文整理汇总了C++中GetMaxY函数的典型用法代码示例。如果您正苦于以下问题:C++ GetMaxY函数的具体用法?C++ GetMaxY怎么用?C++ GetMaxY使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了GetMaxY函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: TouchGetY

/*********************************************************************
* Function: SHORT TouchGetY()
*
* PreCondition: none
*
* Input: none
*
* Output: y coordinate
*
* Side Effects: none
*
* Overview: returns y coordinate if touch screen is pressed
*           and -1 if not
*
* Note: none
*
********************************************************************/
SHORT TouchGetY(){
long result;

#ifdef SWAP_X_AND_Y
    result = ADCGetX();
#else
    result = ADCGetY();
#endif

    if(result>=0){

#ifdef SWAP_X_AND_Y
        result = (GetMaxY()*(result- _calXMin))/(_calXMax - _calXMin);
#else
        result = (GetMaxY()*(result - _calYMin))/(_calYMax - _calYMin);
#endif

#ifdef FLIP_Y
        result = GetMaxY()- result;
#endif

    }
    
    return result;
}
开发者ID:WilliamAvila,项目名称:PIC32MX460F512L_Examples,代码行数:42,代码来源:TouchScreen.c

示例2: Bar

/*********************************************************************
* Function: WORD Bar(SHORT left, SHORT top, SHORT right, SHORT bottom)
*
* PreCondition: none
*
* Input: left,top - top left corner coordinates,
*        right,bottom - bottom right corner coordinates
*
* Output: For NON-Blocking configuration:
*         - Returns 0 when device is busy and the shape is not yet completely drawn.
*         - Returns 1 when the shape is completely drawn.
*         For Blocking configuration:
*         - Always return 1.
*
* Side Effects: none
*
* Overview: draws rectangle filled with current color
*
* Note: none
*
********************************************************************/
WORD Bar(SHORT left, SHORT top, SHORT right, SHORT bottom){
DWORD address;
register SHORT  x,y;

    #ifndef USE_NONBLOCKING_CONFIG
        while(IsDeviceBusy() != 0); /* Ready */
    #else
        if(IsDeviceBusy() != 0) return 0;
    #endif

	if(_clipRgn){
        if(left<_clipLeft)
           left = _clipLeft;
        if(right>_clipRight)
           right= _clipRight;
        if(top<_clipTop)
           top = _clipTop;
        if(bottom>_clipBottom)
           bottom = _clipBottom;
    }

#if (DISP_ORIENTATION == 0)

    address = (DWORD)LINE_MEM_PITCH*top + left;

    CS_LAT_BIT = 0;
    for(y=top; y<bottom+1; y++){
        SetAddress(address);
        for(x=left; x<right+1; x++){
            WriteData(_color);
        }
        address += LINE_MEM_PITCH;
    }
    CS_LAT_BIT = 1;

#else

	top = GetMaxY() - top;
    bottom = GetMaxY() - bottom;
    address = (DWORD)LINE_MEM_PITCH*left + top;

    CS_LAT_BIT = 0;
    for(y=bottom; y<top+1; y++){
        SetAddress(address);
        for(x=left; x<right+1; x++){
            WriteData(_color);
        }
        address -= 1;
    }
    CS_LAT_BIT = 1;

#endif

    return 1;       
}
开发者ID:Gudbrand,项目名称:micro-controllers,代码行数:76,代码来源:drvTFT001.c

示例3: TPolyLine3D

TPolyLine3D* BasicHorizontalRectangularDetectorElement::GeneratePolyLine3D()
{
	TPolyLine3D* pPolyLine = new TPolyLine3D(5);
//	printf("---------MinX: %f, Maxx:%f, Miny: %f, MaxY:%f, Z: %f\n", GetMinX(), GetMaxX(), GetMinY(), GetMaxY(), GetZOffset());
	pPolyLine->SetPoint(0, GetMinX(), GetMinY(), GetZOffset());
	pPolyLine->SetPoint(1, GetMaxX(), GetMinY(), GetZOffset());
	pPolyLine->SetPoint(2, GetMaxX(), GetMaxY(), GetZOffset());
	pPolyLine->SetPoint(3, GetMinX(), GetMaxY(), GetZOffset());
	pPolyLine->SetPoint(4, GetMinX(), GetMinY(), GetZOffset());
	return pPolyLine;
}
开发者ID:davereikher,项目名称:pps-daq,代码行数:11,代码来源:BasicHorizontalRectangularDetectorElement.cpp

示例4: ClearDevice

/*********************************************************************
* Function: void ClearDevice(void)
*
* PreCondition: none
*
* Input: none
*
* Output: none
*
* Side Effects: none
*
* Overview: clears screen with current color 
*
* Note: none
*
********************************************************************/
void ClearDevice(void){
DWORD     counter;

    CS_LAT_BIT = 0;
    SetPointer(0,0,GetMaxX(),GetMaxY());
    WriteCommand(CMD_WRITE);
    for(counter=0; counter<(DWORD)(GetMaxX()+1)*(GetMaxY()+1); counter++){
        WriteData(_color.v[1]);
        WriteData(_color.v[0]);
    }
    CS_LAT_BIT = 1;
}
开发者ID:Gudbrand,项目名称:micro-controllers,代码行数:28,代码来源:SSD1339.c

示例5: GetMinY

void Camera::SetY(double y) {
	if ( !HasBounds() ) {
		this->y = y;
	} else {
		if ( y < GetMinY() )
			this->y = GetMinY();
		else if ( y > GetMaxY() )
			this->y = GetMaxY();
		else
			this->y = y;
	}
}
开发者ID:kanc,项目名称:UTAD,代码行数:12,代码来源:camera.cpp

示例6: Bar

/*********************************************************************
* Function: void Bar(SHORT left, SHORT top, SHORT right, SHORT bottom)
*
* PreCondition: none
*
* Input: left,top - top left corner coordinates,
*        right,bottom - bottom right corner coordinates
*
* Output: none
*
* Side Effects: none
*
* Overview: draws rectangle filled with current color
*
* Note: none
*
********************************************************************/
void Bar(SHORT left, SHORT top, SHORT right, SHORT bottom){
DWORD_VAL address;
register SHORT  x,y;

	if(_clipRgn){
        if(left<_clipLeft)
           left = _clipLeft;
        if(right>_clipRight)
           right= _clipRight;
        if(top<_clipTop)
           top = _clipTop;
        if(bottom>_clipBottom)
           bottom = _clipBottom;
    }

#ifdef	USE_PORTRAIT

    address.Val = (DWORD)LINE_MEM_PITCH*top + left;

    CS_LAT_BIT = 0;
    for(y=top; y<bottom+1; y++){
        SetAddress(address.v[2],address.v[1],address.v[0]);
        for(x=left; x<right+1; x++){
            WriteData(_color.v[1],_color.v[0]);
        }
        address.Val += LINE_MEM_PITCH;
    }
    CS_LAT_BIT = 1;

#else

	top = GetMaxY() - top;
    bottom = GetMaxY() - bottom;
    address.Val = (DWORD)LINE_MEM_PITCH*left + top;

    CS_LAT_BIT = 0;
    for(y=bottom; y<top+1; y++){
        SetAddress(address.v[2],address.v[1],address.v[0]);
        for(x=left; x<right+1; x++){
            WriteData(_color.v[1],_color.v[0]);
        }
        address.Val -= 1;
    }
    CS_LAT_BIT = 1;

#endif

}
开发者ID:mikewang01,项目名称:Zezus,代码行数:65,代码来源:SPFD5408.c

示例7: PutPixel

/*********************************************************************
* Function: void PutPixel(SHORT x, SHORT y)
*
* PreCondition: none
*
* Input: x,y - pixel coordinates
*
* Output: none
*
* Side Effects: none
*
* Overview: puts pixel
*
* Note: none
*
********************************************************************/
void PutPixel(SHORT x, SHORT y){
DWORD_VAL address;
    if(_clipRgn){
        if(x<_clipLeft)
            return;
        if(x>_clipRight)
            return;
        if(y<_clipTop)
            return;
        if(y>_clipBottom)
            return;
    }

#ifdef	USE_PORTRAIT

    address.Val = (long)LINE_MEM_PITCH*y + x;

#else

    y = GetMaxY() - y;
    address.Val = (long)LINE_MEM_PITCH*x + y;

#endif

    CS_LAT_BIT = 0;
    SetAddress(address.v[2],address.v[1],address.v[0]);
    WriteData(_color.v[1],_color.v[0]);   
    CS_LAT_BIT = 1;
}
开发者ID:mikewang01,项目名称:Zezus,代码行数:45,代码来源:SPFD5408.c

示例8: ClearDevice

/*********************************************************************
* Function: void ClearDevice(void)
*
* PreCondition: none
*
* Input: none
*
* Output: none
*
* Side Effects: none
*
* Overview: clears screen with current color 
*
* Note: none
*
********************************************************************/
void ClearDevice(void)
{   int x, y;
    DisplayEnable();
    SetRegion(0, GetMaxX(), 0, GetMaxY());
    DisplaySetCommand();
    DeviceWrite(MemoryWrite);
    DisplaySetData();
    for (x = 0; x < GetMaxY() + 1; x++)
    {
      for (y = 0; y < GetMaxX() + 1; y++)
      {
        DeviceWrite(_color);
      }
    }
    DisplayDisable();
}
开发者ID:bekeband,项目名称:Mikroe_Graphics_Test.X,代码行数:32,代码来源:ILI9341.c

示例9: PutPixel

/*********************************************************************
* Function: void PutPixel(SHORT x, SHORT y)
*
* PreCondition: none
*
* Input: x,y - pixel coordinates
*
* Output: none
*
* Side Effects: none
*
* Overview: puts pixel
*
* Note: none
*
********************************************************************/
void PutPixel(SHORT x, SHORT y){
DWORD address;

    if(_clipRgn){
        if(x<_clipLeft)
            return;
        if(x>_clipRight)
            return;
        if(y<_clipTop)
            return;
        if(y>_clipBottom)
            return;
    }

#if (DISP_ORIENTATION == 0)
   // x=GetMaxX() - x;
    address = (long)LINE_MEM_PITCH*y + x;

#else

    y = GetMaxY() - y;
    address = (long)LINE_MEM_PITCH*x + y;

#endif

    CS_LAT_BIT = 0;
    SetAddress(address);
    WriteData(_color);   
    CS_LAT_BIT = 1;
}
开发者ID:gexueyuan,项目名称:11-ru,代码行数:46,代码来源:ST7789S.C

示例10: GetPixel

/*********************************************************************
* Function: WORD GetPixel(SHORT x, SHORT y)
*
* PreCondition: none
*
* Input: x,y - pixel coordinates 
*
* Output: pixel color
*
* Side Effects: none
*
* Overview: return pixel color at x,y position
*
* Note: none
*
********************************************************************/
WORD GetPixel(SHORT x, SHORT y){
WORD_VAL  result;

    CS_LAT_BIT = 0;

    SetPointer(x,y,GetMaxX(),GetMaxY());
    
    WriteCommand(CMD_READ);

    // Start read cycle for LSB
    result.v[0] = PMDIN1;

    // Wait for reading is done
    Nop(); Nop();

    // Get LSB and start read cycle for MSB
    result.v[0] = PMDIN1;

    // Wait for reading is done
    Nop(); Nop();

    // Disable LCD (it will not accept extra /RD pulse)
    CS_LAT_BIT = 1;

    // Read MSB
    result.v[1] = PMDIN1;

    // Wait for dummy reading is done
    Nop(); Nop();

    return result.Val;
}
开发者ID:Gudbrand,项目名称:micro-controllers,代码行数:48,代码来源:SSD1339.c

示例11: GetMaxX

bool FGAFRect::IntersectsRect(const FGAFRect& rect) const
{
    return !(     GetMaxX() < rect.GetMinX() ||
             rect.GetMaxX() <      GetMinX() ||
                  GetMaxY() < rect.GetMinY() ||
             rect.GetMaxY() <      GetMinY());
}
开发者ID:timur-losev,项目名称:GAFUnrealEngine4,代码行数:7,代码来源:GAFGeometry.cpp

示例12: PutPixel

/*********************************************************************
* Function: void PutPixel(SHORT x, SHORT y)
*
* PreCondition: none
*
* Input: x,y - pixel coordinates
*
* Output: none
*
* Side Effects: none
*
* Overview: puts pixel
*
* Note: none
*
********************************************************************/
void PutPixel(SHORT x, SHORT y)
{
    DWORD   address;
    if(_clipRgn)
    {
        if(x < _clipLeft)
            return;
        if(x > _clipRight)
            return;
        if(y < _clipTop)
            return;
        if(y > _clipBottom)
            return;
    }

    #if (DISP_ORIENTATION == 0)
    address = (long)LINE_MEM_PITCH * y + x;

    #else
    y = GetMaxY() - y;
    address = (long)LINE_MEM_PITCH * x + y;
    #endif
    DisplayEnable();
    SetAddress(address);
    WritePixel(_color);
    DisplayDisable();
}
开发者ID:Benedito-Augusto,项目名称:TCP20110602,代码行数:43,代码来源:drvTFT001.c

示例13: GetMaxY

void FunctionSimple::SetMinY(float f)
{
  // Offset is avg of min and max.
  m_offsetY = (f + GetMaxY()) / 2.0f;
  // Multiplier is max - offset, or offset - min
  m_multiplierY = fabs(f - m_offsetY);
}
开发者ID:jason-amju,项目名称:amju-scp,代码行数:7,代码来源:FunctionSimple.cpp

示例14: UpdateRange

void CRoiDlg::UpdateRange()
{
    m_SpinX.SetRange(0,GetMaxX());
    m_SpinY.SetRange(0,GetMaxY());
    m_SpinWidth.SetRange(1,GetMaxWidth());
    m_SpinHeight.SetRange(1,GetMaxHeight());
}
开发者ID:vinnie38170,项目名称:klImageCore,代码行数:7,代码来源:Roidlg.cpp

示例15: LCD_SetArea

/*********************************************************************
* Function:  LCD_SetArea(start_x,start_y,end_x,end_y)
*
* PreCondition: SetActivePage(page)
*
* Input: start_x, end_x	- start column and end column
*		 start_y,end_y 	- start row and end row position (i.e. page address)
*
* Output: none
*
* Side Effects: none
*
* Overview: defines start/end columns and start/end rows for memory access
*			from host to SSD1963
* Note: none
********************************************************************/
void LCD_SetArea(u16 start_x, u16 start_y, u16 end_x, u16 end_y)
{
	long offset;

	offset = (u16)_activePage*(GetMaxY()+1);

	start_y = offset + start_y;
	end_y   = offset + end_y;



	LCD_WriteCommand(CMD_SET_COLUMN);
	Clr_Cs;
	LCD_WriteData(start_x>>8);
	LCD_WriteData(start_x);
	LCD_WriteData(end_x>>8);
	LCD_WriteData(end_x);
	Set_Cs;
	LCD_WriteCommand(CMD_SET_PAGE);
	Clr_Cs;
	LCD_WriteData(start_y>>8);
	LCD_WriteData(start_y);
	LCD_WriteData(end_y>>8);
	LCD_WriteData(end_y);
	Set_Cs;
}
开发者ID:candrian,项目名称:SSD1963_STM32F4,代码行数:42,代码来源:SSD1963.c


注:本文中的GetMaxY函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。