XenevaOS
Loading...
Searching...
No Matches
chitralekha.h
Go to the documentation of this file.
1
30#ifndef __CHITRALEKHA_H__
31#define __CHITRALEKHA_H__
32
33#include <stdint.h>
34#include <_xeneva.h>
35
36
37#ifdef __cplusplus
39#endif
40
41
42
56
57
59
60 /*
61 * ChCreateCanvas -- creates a new canvas
62 * @param reqW -- requested width of the canvas
63 * @param reqH -- requested height of the canvas
64 */
65 XE_LIB ChCanvas* ChCreateCanvas(int reqW, int reqH);
66
67 /*
68 * ChAllocateBuffer -- allocates buffers for graphics
69 * @param canvas -- Pointer to canvas
70 */
72
73 /*
74 * ChDeAllocateBuffer -- de-allocates buffers from
75 * canvas
76 * @param canvas -- pointer to canvas structure
77 */
79
80 /*
81 * ChCanvasScreenUpdate -- updates screen buffer with canvas buffer
82 * contents
83 * @param canvas -- Pointer to canvas
84 * @param x -- x position
85 * @param y -- y position
86 * @param w -- width of the canvas
87 * @param h -- height of the canvas
88 */
89 XE_LIB void ChCanvasScreenUpdate(ChCanvas* canvas, int x, int y, int w, int h);
90
91 /*
92 * ChDrawPixel -- draws a pixel to canvas buffer
93 * @param canvas -- pointer to canvas
94 * @param x -- x position
95 * @param y -- y position
96 * @param color -- color of the pixel
97 */
98 XE_LIB void ChDrawPixel(ChCanvas* canvas, int x, int y, uint32_t color);
99
100 /*
101 * ChDrawPixelRAW -- draws a pixel to canvas buffer
102 * @param canvas -- pointer to canvas
103 * @param x -- x position
104 * @param y -- y position
105 * @param color -- color of the pixel
106 */
107 XE_LIB void ChDrawPixelRAW(ChCanvas* canvas, int x, int y, uint32_t color);
108
109 /*
110 * ChDrawPixelAA -- draw anti-aliased pixel
111 * @param canv - Pointer to canvas
112 * @param x -- X location relative to window
113 * @param y -- Y location relative to window
114 * @param color -- Color of the pixel
115 * @param alpha -- Alpha value
116 */
117 XE_LIB void ChDrawPixelAA(ChCanvas* canv, int x, int y, uint32_t color, double alpha);
118
119 /*
120 * ChGetPixel -- retuns a pixel from canvas
121 * @param canvas -- Pointer to canvas structure
122 * @param x -- x position
123 * @param y -- y position
124 */
125 XE_LIB uint32_t ChGetPixel(ChCanvas* canvas, int x, int y);
126
127 /*
128 * ChCanvasFill -- fill the canvas with specific color
129 * @param canvas -- pointer to canvas structure
130 * @param w -- width to fill
131 * @param h -- height to fill
132 * @param color -- color to be filled with
133 */
134 XE_LIB void ChCanvasFill(ChCanvas* canvas, int w, int h, uint32_t color);
135
136 /*
137 * ChGetScreenDiagonal -- get screen diagonal using
138 * pythagorean theorem in centimetre
139 * @param canv -- Pointer to canvas
140 */
142
143 /*
144 * ChGetScreenDPI -- converts screen resolution into
145 * dot-per-inch in centimetre
146 * @param canv -- Pointer to canvas
147 */
148 XE_LIB float ChGetScreenDPI(ChCanvas* canv);
149
150 /*
151 * ChGetScreenAspectRatio -- returns the aspect ration of the
152 * screen
153 * @param canv -- Pointer to canvas
154 */
156
157#ifdef __cplusplus
158}
159#endif
160
161#endif
#define XE_LIB
Definition _xeneva.h:55
#define XE_EXTERN
Definition _xeneva.h:50
unsigned int uint32_t
Definition acefiex.h:163
unsigned short int uint16_t
Definition acefiex.h:162
XE_LIB int ChAllocateBuffer(ChCanvas *canvas)
ChAllocateBuffer – allocates buffers for graphics.
Definition chitralekha.cpp:90
struct _ChCanvas_ ChCanvas
XE_LIB uint32_t ChGetPixel(ChCanvas *canvas, int x, int y)
ChGetPixel – retuns a pixel from canvas.
Definition chitralekha.cpp:272
XE_LIB float ChGetScreenDiagonal(ChCanvas *canv)
ChGetScreenDiagonal – get screen diagonal using pythagorean theorem in centimetre.
Definition chitralekha.cpp:316
XE_LIB float ChGetScreenDPI(ChCanvas *canv)
ChGetScreenDPI – converts screen resolution into dot-per-inch in centimetre.
Definition chitralekha.cpp:326
XE_LIB void ChCanvasScreenUpdate(ChCanvas *canvas, int x, int y, int w, int h)
ChCanvasScreenUpdate – updates screen buffer with canvas buffer contents.
Definition chitralekha.cpp:128
XE_LIB int ChPrintLibName()
Definition chitralekha.cpp:45
XE_LIB void ChDrawPixel(ChCanvas *canvas, int x, int y, uint32_t color)
ChDrawPixel – draws a pixel to canvas buffer.
Definition chitralekha.cpp:181
XE_LIB int ChDeAllocateBuffer(ChCanvas *canvas)
ChDeAllocateBuffer – de-allocates buffers from canvas.
Definition chitralekha.cpp:111
XE_LIB int ChGetScreenAspectRatio(ChCanvas *canv)
ChGetScreenAspectRatio – returns the aspect ration of the screen.
Definition chitralekha.cpp:336
XE_LIB void ChDrawPixelAA(ChCanvas *canv, int x, int y, uint32_t color, double alpha)
ChDrawPixelAA – draw anti-aliased pixel.
Definition chitralekha.cpp:260
XE_LIB void ChCanvasFill(ChCanvas *canvas, int w, int h, uint32_t color)
ChCanvasFill – fill the canvas with specific color.
Definition chitralekha.cpp:304
XE_LIB ChCanvas * ChCreateCanvas(int reqW, int reqH)
ChCreateCanvas – creates a new canvas.
Definition chitralekha.cpp:55
XE_LIB void ChDrawPixelRAW(ChCanvas *canvas, int x, int y, uint32_t color)
ChDrawPixelRAW – draws a pixel to canvas buffer.
Definition chitralekha.cpp:223
ChCanvas * canvas
Definition deomain.cpp:92
Definition chitralekha.h:43
uint32_t * framebuff
Definition chitralekha.h:54
int graphics_fd
Definition chitralekha.h:44
uint32_t screenHeight
Definition chitralekha.h:46
uint32_t pitch
Definition chitralekha.h:49
uint32_t canvasHeight
Definition chitralekha.h:51
uint16_t scanline
Definition chitralekha.h:48
uint32_t screenWidth
Definition chitralekha.h:45
uint32_t canvasWidth
Definition chitralekha.h:50
size_t bufferSz
Definition chitralekha.h:53
uint32_t * buffer
Definition chitralekha.h:52
uint32_t bpp
Definition chitralekha.h:47