offscr16bpp.c 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728
  1. //*****************************************************************************
  2. //
  3. // offscr16bpp.c - 16 BPP off-screen display buffer driver.
  4. //
  5. // Copyright (c) 2008-2010 Texas Instruments Incorporated. All rights reserved.
  6. // Software License Agreement
  7. //
  8. // Texas Instruments (TI) is supplying this software for use solely and
  9. // exclusively on TI's microcontroller products. The software is owned by
  10. // TI and/or its suppliers, and is protected under applicable copyright
  11. // laws. You may not combine this software with "viral" open-source
  12. // software in order to form a larger program.
  13. //
  14. // THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
  15. // NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
  16. // NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  17. // A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
  18. // CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
  19. // DAMAGES, FOR ANY REASON WHATSOEVER.
  20. //
  21. //
  22. //*****************************************************************************
  23. #include "debug.h"
  24. #include "grlib.h"
  25. unsigned short offset;
  26. //*****************************************************************************
  27. //
  28. //! \addtogroup primitives_api
  29. //! @{
  30. //
  31. //*****************************************************************************
  32. //*****************************************************************************
  33. //
  34. //! Merges red, green and blue components in to 16bpp(5-6-5) format
  35. //!
  36. //! \param red - red component value
  37. //! \param green - green component value
  38. //! \param blue - blue component value
  39. //!
  40. //! This function merges red, green and blue components in to 16bpp(5-6-5) format.
  41. //!
  42. //! \return Returns the RGB in 5-6-5 format.
  43. //
  44. //*****************************************************************************
  45. unsigned int RGB16(unsigned char red, unsigned char green, unsigned char blue)
  46. {
  47. return (unsigned int)(((red >> 3) << 11) | ((green >> 2) << 5) | (blue >> 3));
  48. }
  49. //*****************************************************************************
  50. //
  51. //! Translates a 24-bit RGB color to a display driver-specific color.
  52. //!
  53. //! \param pvDisplayData is a pointer to the driver-specific data for this
  54. //! display driver.
  55. //! \param ulValue is the 24-bit RGB color. The least-significant byte is the
  56. //! blue channel, the next byte is the green channel, and the third byte is the
  57. //! red channel.
  58. //!
  59. //! This function translates a 24-bit RGB color into a value that can be
  60. //! written into the display's frame buffer in order to reproduce that color,
  61. //! or the closest possible approximation of that color.
  62. //!
  63. //! \return Returns the display-driver specific color.
  64. //
  65. //*****************************************************************************
  66. static unsigned int
  67. GrOffScreen16BPPColorTranslate(void *pvDisplayData, unsigned int ulValue)
  68. {
  69. return RGB16((ulValue >> ClrRedShift) & 0xff, (ulValue >> ClrGreenShift) & 0xff,
  70. (ulValue >> ClrBlueShift) & 0xff);
  71. }
  72. //*****************************************************************************
  73. //
  74. //! Fills a rectangle.
  75. //!
  76. //! \param pvDisplayData is a pointer to the driver-specific data for this
  77. //! display driver.
  78. //! \param pRect is a pointer to the structure describing the rectangle.
  79. //! \param ulValue is the color of the rectangle.
  80. //!
  81. //! This function fills a rectangle on the display. The coordinates of the
  82. //! rectangle are assumed to be within the extents of the display, and the
  83. //! rectangle specification is fully inclusive (in other words, both sXMin and
  84. //! sXMax are drawn, along with sYMin and sYMax).
  85. //!
  86. //! \return None.
  87. //
  88. //*****************************************************************************
  89. static void
  90. GrOffScreen16BPPRectFill(void *pvDisplayData, const tRectangle *pRect,
  91. unsigned int ulValue)
  92. {
  93. unsigned char *pucData, *pucColumn;
  94. int lBytesPerRow, lX, lY;
  95. //
  96. // Check the arguments.
  97. //
  98. ASSERT(pvDisplayData);
  99. ASSERT(pRect);
  100. //
  101. // Create a character pointer for the display-specific data (which points
  102. // to the image buffer).
  103. //
  104. pucData = (unsigned char *)pvDisplayData;
  105. //
  106. // Compute the number of bytes per row in the image buffer.
  107. //
  108. lBytesPerRow = (*(unsigned short *)(pucData)) * 2;
  109. //
  110. // Get the offset to the byte of the image buffer that contains the
  111. // starting pixel.
  112. //
  113. pucData += ((lBytesPerRow * pRect->sYMin) + (pRect->sXMin * 2) + 4 + (16*2));
  114. //
  115. // Copy the pixel value into 2 pixels of the unsigned int. This will
  116. // be used later to write multiple pixels into memory (as opposed to one at
  117. // a time).
  118. //
  119. ulValue = (ulValue << 16) | ulValue;
  120. //
  121. // Get the starting X coordinate of the rectangle.
  122. //
  123. lX = pRect->sXMin;
  124. //
  125. // See if the buffer pointer is not word aligned and there are at least
  126. // one pixel columns left to draw.
  127. //
  128. if(((unsigned int)pucData & 2) && ((pRect->sXMax - lX) > 0))
  129. {
  130. //
  131. // Draw one pixels in this column of the rectangle.
  132. //
  133. for(lY = pRect->sYMin, pucColumn = pucData; lY <= pRect->sYMax;
  134. lY++, pucColumn += lBytesPerRow)
  135. {
  136. *(unsigned short *)pucColumn = ulValue & 0xffff;
  137. }
  138. pucData += 2;
  139. lX +=1;
  140. }
  141. //
  142. // Loop while there are at least 2 pixel columns left to draw.
  143. //
  144. while((lX+1) <= pRect->sXMax)
  145. {
  146. //
  147. // Draw eight pixels in this column of the rectangle.
  148. //
  149. for(lY = pRect->sYMin, pucColumn = pucData; lY <= pRect->sYMax;
  150. lY++, pucColumn += lBytesPerRow)
  151. {
  152. *(unsigned int *)pucColumn = ulValue;
  153. }
  154. pucData += 4;
  155. lX += 2;
  156. }
  157. //
  158. // See if there are at least one pixel columns left to draw.
  159. //
  160. if(lX <= pRect->sXMax)
  161. {
  162. //
  163. // Draw four pixel columns, leaving the buffer pointer half-word
  164. // aligned.
  165. //
  166. for(lY = pRect->sYMin, pucColumn = pucData; lY <= pRect->sYMax;
  167. lY++, pucColumn += lBytesPerRow)
  168. {
  169. *(unsigned short *)pucColumn = ulValue & 0xffff;;
  170. }
  171. pucData += 2;
  172. lX += 1;
  173. }
  174. }
  175. //*****************************************************************************
  176. //
  177. //! Draws a horizontal line.
  178. //!
  179. //! \param pvDisplayData is a pointer to the driver-specific data for this
  180. //! display driver.
  181. //! \param lX1 is the X coordinate of the start of the line.
  182. //! \param lX2 is the X coordinate of the end of the line.
  183. //! \param lY is the Y coordinate of the line.
  184. //! \param ulValue is the color of the line.
  185. //!
  186. //! This function draws a horizontal line on the display. The coordinates of
  187. //! the line are assumed to be within the extents of the display.
  188. //!
  189. //! \return None.
  190. //
  191. //*****************************************************************************
  192. static void
  193. GrOffScreen16BPPLineDrawH(void *pvDisplayData, int lX1, int lX2, int lY,
  194. unsigned int ulValue)
  195. {
  196. unsigned char *pucData;
  197. int lBytesPerRow;
  198. //
  199. // Check the arguments.
  200. //
  201. ASSERT(pvDisplayData);
  202. //
  203. // Create a character pointer for the display-specific data (which points
  204. // to the image buffer).
  205. //
  206. pucData = (unsigned char *)pvDisplayData;
  207. //
  208. // Get the offset to the byte of the image buffer that contains the
  209. // starting pixel.
  210. //
  211. lBytesPerRow = (*(unsigned short *)(pucData)) * 2;
  212. //
  213. // Get the offset to the byte of the image buffer that contains the
  214. // starting pixel.
  215. //
  216. pucData += ((lBytesPerRow * lY) + (lX1 * 2) + 4 + (16*2));
  217. //pucData += (*(unsigned short *)(pucData + 1) * lY * 2) + (lX1 * 2) + 4 + (16 * 2);
  218. //
  219. // Copy the pixel value into 2 pixels of the unsigned int. This will
  220. // be used later to write multiple pixels into memory (as opposed to one at
  221. // a time).
  222. //
  223. ulValue = (ulValue << 16) | ulValue;
  224. //
  225. // See if the buffer pointer is not word aligned and there are at least one
  226. // pixels left to draw.
  227. //
  228. if(((unsigned int)pucData & 2) && ((lX2 - lX1) > 0))
  229. {
  230. //
  231. // Draw two pixels to word align the buffer pointer.
  232. //
  233. *(unsigned short *)pucData = ulValue & 0xffff;
  234. pucData += 2;
  235. lX1 += 1;
  236. }
  237. //
  238. // Loop while there are at least 2 pixels left to draw.
  239. //
  240. while((lX1 + 1) <= lX2)
  241. {
  242. //
  243. // Draw 2 pixels.
  244. //
  245. *(unsigned int *)pucData = ulValue;
  246. pucData += 4;
  247. lX1 += 2;
  248. }
  249. //
  250. // See if there are at least 1 pixels left to draw.
  251. //
  252. if(lX1 <= lX2)
  253. {
  254. //
  255. // Draw 1 pixels, leaving the buffer pointer half-word aligned.
  256. //
  257. *(unsigned short *)pucData = ulValue & 0xffff;
  258. pucData += 2;
  259. lX1 += 1;
  260. }
  261. }
  262. //*****************************************************************************
  263. //
  264. //! Draws a vertical line.
  265. //!
  266. //! \param pvDisplayData is a pointer to the driver-specific data for this
  267. //! display driver.
  268. //! \param lX is the X coordinate of the line.
  269. //! \param lY1 is the Y coordinate of the start of the line.
  270. //! \param lY2 is the Y coordinate of the end of the line.
  271. //! \param ulValue is the color of the line.
  272. //!
  273. //! This function draws a vertical line on the display. The coordinates of the
  274. //! line are assumed to be within the extents of the display.
  275. //!
  276. //! \return None.
  277. //
  278. //*****************************************************************************
  279. static void
  280. GrOffScreen16BPPLineDrawV(void *pvDisplayData, int lX, int lY1, int lY2,
  281. unsigned int ulValue)
  282. {
  283. unsigned char *pucData;
  284. int lBytesPerRow;
  285. //
  286. // Check the arguments.
  287. //
  288. ASSERT(pvDisplayData);
  289. //
  290. // Create a character pointer for the display-specific data (which points
  291. // to the image buffer).
  292. //
  293. pucData = (unsigned char *)pvDisplayData;
  294. //
  295. // Compute the number of bytes per row in the image buffer.
  296. //
  297. lBytesPerRow = (*(unsigned short *)(pucData)) * 2;
  298. //
  299. // Get the offset to the byte of the image buffer that contains the
  300. // starting pixel.
  301. //
  302. pucData += ((lBytesPerRow * lY1) + (lX * 2) + 4 + (16*2));
  303. //
  304. // Loop over the rows of the line.
  305. //
  306. for(; lY1 <= lY2; lY1++)
  307. {
  308. *(unsigned short *)pucData = ulValue;
  309. pucData += lBytesPerRow;
  310. }
  311. }
  312. //*****************************************************************************
  313. //
  314. //! Draws a pixel on the screen.
  315. //!
  316. //! \param pvDisplayData is a pointer to the driver-specific data for this
  317. //! display driver.
  318. //! \param lX is the X coordinate of the pixel.
  319. //! \param lY is the Y coordinate of the pixel.
  320. //! \param ulValue is the color of the pixel.
  321. //!
  322. //! This function sets the given pixel to a particular color. The coordinates
  323. //! of the pixel are assumed to be within the extents of the display.
  324. //!
  325. //! \return None.
  326. //
  327. //*****************************************************************************
  328. static void
  329. GrOffScreen16BPPPixelDraw(void *pvDisplayData, int lX, int lY,
  330. unsigned int ulValue)
  331. {
  332. unsigned char *pucData;
  333. int lBytesPerRow;
  334. //
  335. // Check the arguments.
  336. //
  337. ASSERT(pvDisplayData);
  338. //
  339. // Create a character pointer for the display-specific data (which points
  340. // to the image buffer).
  341. //
  342. pucData = (unsigned char *)pvDisplayData;
  343. //
  344. // Get the offset to the byte of the image buffer that contains the pixel
  345. // in question.
  346. //
  347. lBytesPerRow = (*(unsigned short *)(pucData)) * 2;
  348. //
  349. // Get the offset to the byte of the image buffer that contains the
  350. // starting pixel.
  351. //
  352. pucData += (lBytesPerRow * lY) + (lX * 2) + 4 + (16*2);
  353. //pucData += (*(unsigned short *)(pucData + 1) * lY * 2) + (lX * 2) + 4 + (16*2);
  354. //
  355. // Write this pixel into the image buffer.
  356. //
  357. *(unsigned short *)pucData = ulValue & 0xFFFF;
  358. }
  359. //*****************************************************************************
  360. //
  361. //! Draws a horizontal sequence of pixels on the screen.
  362. //!
  363. //! \param pvDisplayData is a pointer to the driver-specific data for this
  364. //! display driver.
  365. //! \param lX is the X coordinate of the first pixel.
  366. //! \param lY is the Y coordinate of the first pixel.
  367. //! \param lX0 is sub-pixel offset within the pixel data, which is valid for 1
  368. //! or 4 bit per pixel formats.
  369. //! \param lCount is the number of pixels to draw.
  370. //! \param lBPP is the number of bits per pixel; must be 1, 4, or 8.
  371. //! \param pucData is a pointer to the pixel data. For 1 and 4 bit per pixel
  372. //! formats, the most significant bit(s) represent the left-most pixel.
  373. //! \param pucPalette is a pointer to the palette used to draw the pixels.
  374. //!
  375. //! This function draws a horizontal sequence of pixels on the screen, using
  376. //! the supplied palette. For 1 bit per pixel format, the palette contains
  377. //! pre-translated colors; for 4 and 8 bit per pixel formats, the palette
  378. //! contains 24-bit RGB values that must be translated before being written to
  379. //! the display.
  380. //!
  381. //! \return None.
  382. //
  383. //*****************************************************************************
  384. static void
  385. GrOffScreen16BPPPixelDrawMultiple(void *pvDisplayData, int lX, int lY,
  386. int lX0, int lCount, int lBPP,
  387. const unsigned char *pucData,
  388. const unsigned char *pucPalette)
  389. {
  390. unsigned char *pucPtr;
  391. unsigned int ulByte;
  392. int lBytesPerRow;
  393. //
  394. // Check the arguments.
  395. //
  396. ASSERT(pvDisplayData);
  397. ASSERT(pucData);
  398. ASSERT(pucPalette);
  399. //
  400. // Create a character pointer for the display-specific data (which points
  401. // to the image buffer).
  402. //
  403. pucPtr = (unsigned char *)pvDisplayData;
  404. //
  405. // Compute the number of bytes per row in the image buffer.
  406. //
  407. lBytesPerRow = (*(unsigned short *)(pucPtr)) * 2;
  408. //
  409. // Get the offset to the byte of the image buffer that contains the
  410. // starting pixel.
  411. //
  412. pucPtr += (lBytesPerRow * lY) + (lX * 2) + 4 + (16*2);
  413. //
  414. // Determine how much to shift to get to the nibble that contains this
  415. // pixel.
  416. //
  417. lX = (1 - (lX & 1)) * 4;
  418. //
  419. // Determine how to interpret the pixel data based on the number of bits
  420. // per pixel.
  421. //
  422. switch(lBPP)
  423. {
  424. //
  425. // The pixel data is in 1 bit per pixel format.
  426. //
  427. case 1:
  428. {
  429. //
  430. // Loop while there are more pixels to draw.
  431. //
  432. while(lCount)
  433. {
  434. //
  435. // Get the next byte of image data.
  436. //
  437. ulByte = *pucData++;
  438. //
  439. // Loop through the pixels in this byte of image data.
  440. //
  441. for(; (lX0 < 8) && lCount; lX0++, lCount--)
  442. {
  443. //
  444. // Draw this pixel in the appropriate color.
  445. //
  446. ulByte = ((*pucPtr & ~(0xf << lX)) |
  447. (((unsigned int *)pucPalette)[(ulByte >>
  448. (7 - lX0)) &
  449. 1] << lX));
  450. //
  451. // Write this pixel to the screen.
  452. //
  453. *pucPtr++ = (ulByte & 0x00FF);
  454. *pucPtr++ = (ulByte & 0xFF00) >> 8;
  455. }
  456. //
  457. // Start at the beginning of the next byte of image data.
  458. //
  459. lX0 = 0;
  460. }
  461. //
  462. // The image data has been drawn.
  463. //
  464. break;
  465. }
  466. //
  467. // The pixel data is in 4 bit per pixel format.
  468. //
  469. case 4:
  470. {
  471. //
  472. // Loop while there are more pixels to draw. "Duff's device" is
  473. // used to jump into the middle of the loop if the first nibble of
  474. // the pixel data should not be used. Duff's device makes use of
  475. // the fact that a case statement is legal anywhere within a
  476. // sub-block of a switch statement. See
  477. // http://en.wikipedia.org/wiki/Duff's_device for detailed
  478. // information about Duff's device.
  479. //
  480. switch(lX0 & 1)
  481. {
  482. case 0:
  483. while(lCount)
  484. {
  485. //
  486. // Get the upper nibble of the next byte of pixel data
  487. // and extract the corresponding entry from the
  488. // palette.
  489. //
  490. #ifdef SUPPORT_UNALIGNED
  491. ulByte = (*pucData >> 4) * 3;
  492. ulByte = (*(unsigned int *)(pucPalette + ulByte) &
  493. 0x00ffffff);
  494. #else
  495. offset = (*pucData >> 4) * 3;
  496. ulByte = (*(unsigned char *)(pucPalette + offset));
  497. ulByte |= (*((unsigned char *)(pucPalette + offset) + 1)) << 8;
  498. ulByte |= *((unsigned char *)(pucPalette + offset) + 2) << 16;
  499. #endif
  500. //
  501. // Translate this palette entry.
  502. //
  503. ulByte = GrOffScreen16BPPColorTranslate(pvDisplayData,
  504. ulByte);
  505. //
  506. // Write this pixel to the screen.
  507. //
  508. *pucPtr++ = (ulByte & 0x00FF);
  509. *pucPtr++ = (ulByte & 0xFF00) >> 8;
  510. //
  511. // Decrement the count of pixels to draw.
  512. //
  513. lCount--;
  514. //
  515. // See if there is another pixel to draw.
  516. //
  517. if(lCount)
  518. {
  519. case 1:
  520. //
  521. // Get the lower nibble of the next byte of pixel
  522. // data and extract the corresponding entry from
  523. // the palette.
  524. //
  525. #ifdef SUPPORT_UNALIGNED
  526. ulByte = (*pucData++ & 15) * 3;
  527. ulByte = (*(unsigned int *)(pucPalette + ulByte) &
  528. 0x00ffffff);
  529. #else
  530. offset = (*pucData++ & 15) * 3;
  531. ulByte = (*(unsigned char *)(pucPalette + offset));
  532. ulByte |= (*((unsigned char *)(pucPalette + offset) + 1)) << 8;
  533. ulByte |= *((unsigned char *)(pucPalette + offset) + 2) << 16;
  534. #endif
  535. //
  536. // Translate this palette entry.
  537. //
  538. ulByte = GrOffScreen16BPPColorTranslate(pvDisplayData,
  539. ulByte);
  540. //
  541. // Write this pixel to the screen.
  542. //
  543. *pucPtr++ = (ulByte & 0x00FF);
  544. *pucPtr++ = (ulByte & 0xFF00) >> 8;
  545. //
  546. // Decrement the count of pixels to draw.
  547. //
  548. lCount--;
  549. }
  550. }
  551. }
  552. //
  553. // The image data has been drawn.
  554. //
  555. break;
  556. }
  557. //
  558. // The pixel data is in 8 bit per pixel format.
  559. //
  560. case 8:
  561. {
  562. //
  563. // Loop while there are more pixels to draw.
  564. //
  565. while(lCount--)
  566. {
  567. //
  568. // Get the next byte of pixel data and extract the
  569. // corresponding entry from the palette.
  570. //
  571. #ifdef SUPPORT_UNALIGNED
  572. ulByte = *pucData++ * 3;
  573. ulByte = *(unsigned int *)(pucPalette + ulByte) & 0x00ffffff;
  574. #else
  575. offset = *pucData++ * 3;
  576. ulByte = (*(unsigned char *)(pucPalette + offset));
  577. ulByte |= (*((unsigned char *)(pucPalette + offset) + 1)) << 8;
  578. ulByte |= *((unsigned char *)(pucPalette + offset) + 2) << 16;
  579. #endif
  580. //
  581. // Translate this palette entry.
  582. //
  583. ulByte = GrOffScreen16BPPColorTranslate(pvDisplayData, ulByte);
  584. //
  585. // Write this pixel to the screen.
  586. //
  587. *pucPtr++ = (ulByte & 0x00FF);
  588. *pucPtr++ = (ulByte & 0xFF00) >> 8;
  589. }
  590. //
  591. // The image data has been drawn.
  592. //
  593. break;
  594. }
  595. case 16:
  596. {
  597. pucData++;
  598. while(lCount--)
  599. {
  600. *(pucPtr+1) = *pucData++; // 2 bytes
  601. *(pucPtr) = *pucData++;
  602. pucPtr += 2;
  603. }
  604. break;
  605. }
  606. }
  607. }
  608. //*****************************************************************************
  609. //
  610. //! Initializes a 16 BPP off-screen buffer.
  611. //!
  612. //! \param pDisplay is a pointer to the display structure to be configured for
  613. //! the 16 BPP off-screen buffer.
  614. //! \param pucImage is a pointer to the image buffer to be used for the
  615. //! off-screen buffer.
  616. //! \param lWidth is the width of the image buffer in pixels.
  617. //! \param lHeight is the height of the image buffer in pixels.
  618. //!
  619. //! This function initializes a display structure, preparing it to draw into
  620. //! the supplied image buffer. The image buffer is assumed to be large enough
  621. //! to hold an image of the specified geometry.
  622. //!
  623. //! \return None.
  624. //
  625. //*****************************************************************************
  626. void
  627. GrOffScreen16BPPInit(tDisplay *pDisplay, unsigned char *pucImage, int lWidth,
  628. int lHeight)
  629. {
  630. //
  631. // Initialize the display structure.
  632. //
  633. pDisplay->lSize = sizeof(tDisplay);
  634. pDisplay->pvDisplayData = pucImage;
  635. pDisplay->usWidth = lWidth;
  636. pDisplay->usHeight = lHeight;
  637. pDisplay->pfnPixelDraw = GrOffScreen16BPPPixelDraw;
  638. pDisplay->pfnPixelDrawMultiple = GrOffScreen16BPPPixelDrawMultiple;
  639. pDisplay->pfnLineDrawH = GrOffScreen16BPPLineDrawH;
  640. pDisplay->pfnLineDrawV = GrOffScreen16BPPLineDrawV;
  641. pDisplay->pfnRectFill = GrOffScreen16BPPRectFill;
  642. pDisplay->pfnColorTranslate = GrOffScreen16BPPColorTranslate;
  643. //pDisplay->pfnFlush = GrOffScreen16BPPFlush;
  644. *(unsigned short *)(pucImage + 0) = lWidth;
  645. *(unsigned short *)(pucImage + 2) = lHeight;
  646. }
  647. //*****************************************************************************
  648. //
  649. // Close the Doxygen group.
  650. //! @}
  651. //
  652. //*****************************************************************************