Adding APIs for size and set pixel.
1.1 --- a/MiniDisplay.cpp Mon Jul 07 21:32:47 2014 +0200
1.2 +++ b/MiniDisplay.cpp Mon Jul 07 22:27:56 2014 +0200
1.3 @@ -93,3 +93,32 @@
1.4 ((GP1212A01A*)aDevice)->SetBrightness(aBrightness);
1.5 }
1.6
1.7 +//-------------------------------------------------------------
1.8 +int MiniDisplayWidthInPixels(MiniDisplayDevice aDevice)
1.9 + {
1.10 + if (!aDevice)
1.11 + {
1.12 + return 0;
1.13 + }
1.14 +
1.15 + return ((GP1212A01A*)aDevice)->WidthInPixels();
1.16 + }
1.17 +
1.18 +//-------------------------------------------------------------
1.19 +int MiniDisplayHeightInPixels(MiniDisplayDevice aDevice)
1.20 + {
1.21 + if (!aDevice)
1.22 + {
1.23 + return 0;
1.24 + }
1.25 +
1.26 + return ((GP1212A01A*)aDevice)->HeightInPixels();
1.27 + }
1.28 +
1.29 +//-------------------------------------------------------------
1.30 +void MiniDisplaySetPixel(MiniDisplayDevice aDevice, int aX, int aY, int aValue)
1.31 + {
1.32 + //aValue&=0x00FFFFFF; //Filter out alpha component
1.33 + return ((GP1212A01A*)aDevice)->SetPixel(aX,aY,aValue);
1.34 + }
1.35 +
2.1 --- a/MiniDisplay.h Mon Jul 07 21:32:47 2014 +0200
2.2 +++ b/MiniDisplay.h Mon Jul 07 22:27:56 2014 +0200
2.3 @@ -68,6 +68,31 @@
2.4 */
2.5 extern "C" MDAPI void MiniDisplaySetBrightness(MiniDisplayDevice aDevice, int aBrightness);
2.6
2.7 +/**
2.8 +Provide pixels width of our display.
2.9 +@param [IN] The device to apply this command to.
2.10 +@return Width in pixels.
2.11 +*/
2.12 +extern "C" MDAPI int MiniDisplayWidthInPixels(MiniDisplayDevice aDevice);
2.13 +
2.14 +/**
2.15 +Provide pixels height of our display.
2.16 +@param [IN] The device to apply this command to.
2.17 +@return Height in pixels.
2.18 +*/
2.19 +extern "C" MDAPI int MiniDisplayHeightInPixels(MiniDisplayDevice aDevice);
2.20 +
2.21 +/**
2.22 +Set our given pixel.
2.23 +@param [IN] The device to apply this command to.
2.24 +@param [IN] Pixel X coordinate.
2.25 +@param [IN] Pixel Y coordinate.
2.26 +@param [IN] Pixel value.
2.27 +*/
2.28 +extern "C" MDAPI void MiniDisplaySetPixel(MiniDisplayDevice aDevice, int aX, int aY, int aValue);
2.29 +
2.30 +//TODO: Have an API to specify pixel depth
2.31 +
2.32
2.33 #endif
2.34