本文整理汇总了C++中GetMaxY函数的典型用法代码示例。如果您正苦于以下问题:C++ GetMaxY函数的具体用法?C++ GetMaxY怎么用?C++ GetMaxY使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetMaxY函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: 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)
{
WORD counter;
DisplayEnable();
// Whole screen
DisplaySetCommand();
DeviceWrite(LASET); //Line Address Set(lines from 16 to 144 are used)
DisplaySetData();
DeviceWrite(0x10); //Start Line=16
DeviceWrite(0x8f); //End Line =144-1
DisplaySetCommand();
DeviceWrite(CASET); //Column Address Set
DisplaySetData();
DeviceWrite(0x00); //Start Column=0
DeviceWrite(0x54); //End Column =84 ((84+1)*3 == 255)
DisplaySetCommand();
DeviceWrite(RAMWR);
DisplaySetData();
for(counter = 0; counter < (WORD) (GetMaxX() + 1) * (GetMaxY() + 1); counter++)
{
DeviceWrite(_color);
}
DisplayDisable();
}
开发者ID:Benedito-Augusto,项目名称:TCP20110602,代码行数:43,代码来源:ST7529.c
示例17: CreateDemo
void CreateDemo(void)
{
GOLFree();
SetColor(GFX_SCHEMEDEFAULT.CommonBkColor);
ClearDevice();
BtnCreate(ID_BUTTON,
GetMaxX() * 1 / 4,
GetMaxY() * 1 / 3,
GetMaxX() * 3 / 4,
GetMaxY() * 2 / 3,
0, BTN_DRAW, NULL, "Button", NULL);
showDecoration = FALSE;
showDecorationPrev = TRUE; // force redraw
}
开发者ID:marcows,项目名称:MLAtor,代码行数:16,代码来源:Demo.c
示例18: TouchGetCalPoints
/*********************************************************************
* Function: void TouchGetCalPoints(WORD* ax, WORD* ay)
*
* PreCondition: InitGraph() must be called before
*
* Input: ax - pointer to array receiving 3 X touch positions
* ay - pointer to array receiving 3 Y touch positions
*
* Output: none
*
* Side Effects: none
*
* Overview: gets values for 3 touches
*
* Note: none
*
********************************************************************/
void TouchGetCalPoints(WORD* ax, WORD* ay){
static const XCHAR calStr[] = {'C','A','L','I','B','R','A','T','I','O','N',0};
XCHAR calTouchLeft[] = {'3',' ','t','o','u','c','h','e','s',' ','l','e','f','t',0};
SHORT counter;
SHORT x,y;
SetFont((void*)&GOLFontDefault);
SetColor(BRIGHTRED);
OutTextXY((GetMaxX()-GetTextWidth((XCHAR*)calStr,(void*)&GOLFontDefault))>>1,
(GetMaxY()-GetTextHeight((void*)&GOLFontDefault))>>1,
(XCHAR*)calStr);
for(counter=0; counter<3; counter++){
SetColor(BRIGHTRED);
calTouchLeft[0] = '3' - counter;
OutTextXY((GetMaxX()-GetTextWidth(calTouchLeft,(void*)&GOLFontDefault))>>1,
(GetMaxY()+GetTextHeight((void*)&GOLFontDefault))>>1,
calTouchLeft);
// Wait for press
do{
x=ADCGetX(); y=ADCGetY();
}while((y==-1)||(x==-1));
Beep();
*(ax+counter) = x; *(ay+counter) = y;
// Wait for release
do{
x=ADCGetX(); y=ADCGetY();
}while((y!=-1)&&(x!=-1));
SetColor(WHITE);
OutTextXY((GetMaxX()-GetTextWidth(calTouchLeft,(void*)&GOLFontDefault))>>1,
(GetMaxY()+GetTextHeight((void*)&GOLFontDefault))>>1,
calTouchLeft);
DelayMs(500);
}
}
开发者ID:WilliamAvila,项目名称:PIC32MX460F512L_Examples,代码行数:64,代码来源:TouchScreen.c
示例19: PutImage1BPP
/*********************************************************************
* Function: void PutImage1BPP(SHORT left, SHORT top, FLASH_BYTE* bitmap, BYTE stretch)
*
* PreCondition: none
*
* Input: left,top - left top image corner, bitmap - image pointer,
* stretch - image stretch factor
*
* Output: none
*
* Side Effects: none
*
* Overview: outputs monochrome image starting from left,top coordinates
*
* Note: image must be located in flash
*
********************************************************************/
void PutImage1BPP(SHORT left, SHORT top, FLASH_BYTE* bitmap, BYTE stretch){
register FLASH_BYTE* flashAddress;
register FLASH_BYTE* tempFlashAddress;
BYTE temp;
WORD sizeX, sizeY;
WORD x,y;
BYTE stretchX,stretchY;
WORD pallete[2];
BYTE mask;
// Move pointer to size information
flashAddress = bitmap + 2;
// Read image size
sizeY = *((FLASH_WORD*)flashAddress);
flashAddress += 2;
sizeX = *((FLASH_WORD*)flashAddress);
flashAddress += 2;
pallete[0] = *((FLASH_WORD*)flashAddress);
flashAddress += 2;
pallete[1] = *((FLASH_WORD*)flashAddress);
flashAddress += 2;
CS_LAT_BIT = 0;
for(y=0; y<sizeY; y++){
tempFlashAddress = flashAddress;
for(stretchY = 0; stretchY<stretch; stretchY++){
flashAddress = tempFlashAddress;
SetPointer(left, top+y, GetMaxX(), GetMaxY());
WriteCommand(CMD_WRITE);
mask = 0;
for(x=0; x<sizeX; x++){
// Read 8 pixels from flash
if(mask == 0){
temp = *flashAddress;
flashAddress++;
mask = 0x80;
}
// Set color
if(mask&temp){
SetColor(pallete[1]);
}else{
SetColor(pallete[0]);
}
// Write pixel to screen
for(stretchX=0; stretchX<stretch; stretchX++){
WriteData(_color.v[1]);
WriteData(_color.v[0]);
}
// Shift to the next pixel
mask >>= 1;
}
}
}
CS_LAT_BIT = 1;
}
开发者ID:Gudbrand,项目名称:micro-controllers,代码行数:76,代码来源:SSD1339.c
示例20: CreateLightingScreen
/*****************************************************************************
* void CreateLightingScreen(void)
*
* NOTE: The lighting demo is not available when using the PIC24FJ256GB210.
* The demo requires loading an image from the external memory, the Epson
* S1D13517 () has some routing conflicts which make loading the image
* difficult and not robust. For these reasons, the lighting demo has
* been take out for a better out of box experience.
*****************************************************************************/
void CreateLightingScreen(void)
{
GOL_SCHEME *currentScheme;
currentScheme = GFX_SchemeGetCurrentScheme();
SetColor(currentScheme->Color0);
while(!FillBevel((GetMaxX() >> 2) + 20,90 ,GetMaxX() - 10, GetMaxY()-10,5));
while(!AlphaBlendWindow(GetDrawBufferAddress(), (GetMaxX() >> 2) + 15, 85,
GFX_PAGE1, (GetMaxX() >> 2) + 15, 85,
GetDrawBufferAddress(), (GetMaxX() >> 2) + 15, 85,
(GetMaxX())-((GetMaxX() >> 2) + 15),
GetMaxY() - 90,
GFX_SchemeGetDefaultScheme()->AlphaValue));
SetState(GOLFindObject(PANEL_SCREEN_ID_LIGHTING_BUT), BTN_DISABLED);
if(GetState(GOLFindObject(PANEL_SCREEN_ID_COMFORT_BUT),BTN_DISABLED))
{
ClrState(GOLFindObject(PANEL_SCREEN_ID_COMFORT_BUT), BTN_DISABLED);
SetState(GOLFindObject(PANEL_SCREEN_ID_COMFORT_BUT),BTN_DRAW);
}
if(GetState(GOLFindObject(PANEL_SCREEN_ID_SECURITY_BUT),BTN_DISABLED))
{
ClrState(GOLFindObject(PANEL_SCREEN_ID_SECURITY_BUT), BTN_DISABLED);
SetState(GOLFindObject(PANEL_SCREEN_ID_SECURITY_BUT),BTN_DRAW);
}
if(GetState(GOLFindObject(PANEL_SCREEN_ID_ENERGY_USAGE_BUT),BTN_DISABLED))
{
ClrState(GOLFindObject(PANEL_SCREEN_ID_ENERGY_USAGE_BUT), BTN_DISABLED);
SetState(GOLFindObject(PANEL_SCREEN_ID_ENERGY_USAGE_BUT),BTN_DRAW);
}
/***
* See above note in the function comment for more information
**/
#ifndef __PIC24FJ256GB210__
GFX_BlockUntilFinished(PutImage((GetMaxX() >> 2)+40, 90+10, (void *) &House, IMAGE_NORMAL));
#endif
}
开发者ID:Athuli7,项目名称:Microchip,代码行数:55,代码来源:lighting_screen.c
注:本文中的GetMaxY函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论