vgu.h 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. /* $Revision: 6810 $ on $Date:: 2008-10-29 20:01:37 +0530 #$ */
  2. /*------------------------------------------------------------------------
  3. *
  4. * VGU 1.1 Reference Implementation
  5. * -------------------------------------
  6. *
  7. * Copyright (c) 2008 The Khronos Group Inc.
  8. *
  9. * Permission is hereby granted, free of charge, to any person obtaining a
  10. * copy of this software and /or associated documentation files
  11. * (the "Materials "), to deal in the Materials without restriction,
  12. * including without limitation the rights to use, copy, modify, merge,
  13. * publish, distribute, sublicense, and/or sell copies of the Materials,
  14. * and to permit persons to whom the Materials are furnished to do so,
  15. * subject to the following conditions:
  16. *
  17. * The above copyright notice and this permission notice shall be included
  18. * in all copies or substantial portions of the Materials.
  19. *
  20. * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  21. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  22. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  23. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  24. * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  25. * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR
  26. * THE USE OR OTHER DEALINGS IN THE MATERIALS.
  27. *
  28. *//**
  29. * \file
  30. * \brief VGU 1.1 API.
  31. *//*-------------------------------------------------------------------*/
  32. #ifndef _VGU_H
  33. #define _VGU_H
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37. #include <VG/openvg.h>
  38. #define VGU_VERSION_1_0 1
  39. #define VGU_VERSION_1_1 2
  40. #ifndef VGU_API_CALL
  41. # error VGU_API_CALL must be defined
  42. #endif
  43. #ifndef VGU_API_ENTRY
  44. # error VGU_API_ENTRY must be defined
  45. #endif
  46. #ifndef VGU_API_EXIT
  47. # error VGU_API_EXIT must be defined
  48. #endif
  49. typedef enum {
  50. VGU_NO_ERROR = 0,
  51. VGU_BAD_HANDLE_ERROR = 0xF000,
  52. VGU_ILLEGAL_ARGUMENT_ERROR = 0xF001,
  53. VGU_OUT_OF_MEMORY_ERROR = 0xF002,
  54. VGU_PATH_CAPABILITY_ERROR = 0xF003,
  55. VGU_BAD_WARP_ERROR = 0xF004,
  56. VGU_ERROR_CODE_FORCE_SIZE = VG_MAX_ENUM
  57. } VGUErrorCode;
  58. typedef enum {
  59. VGU_ARC_OPEN = 0xF100,
  60. VGU_ARC_CHORD = 0xF101,
  61. VGU_ARC_PIE = 0xF102,
  62. VGU_ARC_TYPE_FORCE_SIZE = VG_MAX_ENUM
  63. } VGUArcType;
  64. VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguLine(VGPath path,
  65. VGfloat x0, VGfloat y0,
  66. VGfloat x1, VGfloat y1) VGU_API_EXIT;
  67. VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguPolygon(VGPath path,
  68. const VGfloat * points, VGint count,
  69. VGboolean closed) VGU_API_EXIT;
  70. VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguRect(VGPath path,
  71. VGfloat x, VGfloat y,
  72. VGfloat width, VGfloat height) VGU_API_EXIT;
  73. VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguRoundRect(VGPath path,
  74. VGfloat x, VGfloat y,
  75. VGfloat width, VGfloat height,
  76. VGfloat arcWidth, VGfloat arcHeight) VGU_API_EXIT;
  77. VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguEllipse(VGPath path,
  78. VGfloat cx, VGfloat cy,
  79. VGfloat width, VGfloat height) VGU_API_EXIT;
  80. VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguArc(VGPath path,
  81. VGfloat x, VGfloat y,
  82. VGfloat width, VGfloat height,
  83. VGfloat startAngle, VGfloat angleExtent,
  84. VGUArcType arcType) VGU_API_EXIT;
  85. VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguComputeWarpQuadToSquare(VGfloat sx0, VGfloat sy0,
  86. VGfloat sx1, VGfloat sy1,
  87. VGfloat sx2, VGfloat sy2,
  88. VGfloat sx3, VGfloat sy3,
  89. VGfloat * matrix) VGU_API_EXIT;
  90. VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguComputeWarpSquareToQuad(VGfloat dx0, VGfloat dy0,
  91. VGfloat dx1, VGfloat dy1,
  92. VGfloat dx2, VGfloat dy2,
  93. VGfloat dx3, VGfloat dy3,
  94. VGfloat * matrix) VGU_API_EXIT;
  95. VGU_API_CALL VGUErrorCode VGU_API_ENTRY vguComputeWarpQuadToQuad(VGfloat dx0, VGfloat dy0,
  96. VGfloat dx1, VGfloat dy1,
  97. VGfloat dx2, VGfloat dy2,
  98. VGfloat dx3, VGfloat dy3,
  99. VGfloat sx0, VGfloat sy0,
  100. VGfloat sx1, VGfloat sy1,
  101. VGfloat sx2, VGfloat sy2,
  102. VGfloat sx3, VGfloat sy3,
  103. VGfloat * matrix) VGU_API_EXIT;
  104. #ifdef __cplusplus
  105. } /* extern "C" */
  106. #endif
  107. #endif /* #ifndef _VGU_H */