本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
}
示例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
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}
示例11: GetMaxX
bool FGAFRect::IntersectsRect(const FGAFRect& rect) const
{
return !( GetMaxX() < rect.GetMinX() ||
rect.GetMaxX() < GetMinX() ||
GetMaxY() < rect.GetMinY() ||
rect.GetMaxY() < GetMinY());
}
示例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();
}
示例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);
}
示例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());
}
示例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;
}