Changeset 257
- Timestamp:
- Dec 18, 2003, 1:11:52 AM (19 years ago)
- Location:
- libcaca/trunk/src
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/src/bitmap.c
r253 r257 121 121 } 122 122 123 /** 124 * \brief Create an internal bitmap object. 125 * 126 * \param bitmap The bitmap depth in bits per pixel. 127 * \param w The bitmap width in pixels. 128 * \param h The bitmap height in pixels. 129 * \param pitch The bitmap pitch in bytes. 130 * \param rmask The bitmask for red values. 131 * \param gmask The bitmask for green values. 132 * \param bmask The bitmask for blue values. 133 * \param amask The bitmask for alpha values. 134 * \return A bitmap object or NULL upon error. 135 */ 123 136 struct caca_bitmap *caca_create_bitmap(unsigned int bpp, unsigned int w, 124 137 unsigned int h, unsigned int pitch, … … 175 188 } 176 189 190 /** 191 * \brief Set the palette of an 8bpp bitmap object. 192 * 193 * \param bpp The bitmap object. 194 * \param red An array of 256 red values. 195 * \param green An array of 256 green values. 196 * \param blue An array of 256 blue values. 197 * \param alpha An array of 256 alpha values. 198 * \return void 199 */ 177 200 void caca_set_bitmap_palette(struct caca_bitmap *bitmap, 178 201 unsigned int red[], unsigned int green[], … … 205 228 } 206 229 230 /** 231 * \brief Free the memory associated with a bitmap. 232 * 233 * \param bitmap The bitmap object to be freed. 234 * \return void 235 */ 207 236 void caca_free_bitmap(struct caca_bitmap *bitmap) 208 237 { … … 299 328 } 300 329 330 /** 331 * \brief Draw a bitmap on the screen. 332 * 333 * \param x1 X coordinate of the upper-left corner of the drawing area. 334 * \param y1 Y coordinate of the upper-left corner of the drawing area. 335 * \param x2 X coordinate of the lower-right corner of the drawing area. 336 * \param y2 Y coordinate of the lower-right corner of the drawing area. 337 * \param bitmap The bitmap object to be drawn. 338 * \param pixels A pointer to the bitmap's pixels. 339 * \return void 340 */ 301 341 void caca_draw_bitmap(int x1, int y1, int x2, int y2, 302 342 const struct caca_bitmap *bitmap, void *pixels) -
libcaca/trunk/src/box.c
r246 r257 35 35 #include "caca_internals.h" 36 36 37 /** 38 * \brief Draw a box on the screen using the given character. 39 * 40 * \param x1 X coordinate of the upper-left corner of the box. 41 * \param y1 Y coordinate of the upper-left corner of the box. 42 * \param x2 X coordinate of the lower-right corner of the box. 43 * \param y2 Y coordinate of the lower-right corner of the box. 44 * \param c Character to draw the box outline with. 45 * \return void 46 */ 37 47 void caca_draw_box(int x1, int y1, int x2, int y2, char c) 38 48 { … … 43 53 } 44 54 55 /** 56 * \brief Draw a thin box on the screen. 57 * 58 * \param x1 X coordinate of the upper-left corner of the box. 59 * \param y1 Y coordinate of the upper-left corner of the box. 60 * \param x2 X coordinate of the lower-right corner of the box. 61 * \param y2 Y coordinate of the lower-right corner of the box. 62 * \return void 63 */ 45 64 void caca_draw_thin_box(int x1, int y1, int x2, int y2) 46 65 { … … 96 115 } 97 116 117 /** 118 * \brief Fill a box on the screen using the given character. 119 * 120 * \param x1 X coordinate of the upper-left corner of the box. 121 * \param y1 Y coordinate of the upper-left corner of the box. 122 * \param x2 X coordinate of the lower-right corner of the box. 123 * \param y2 Y coordinate of the lower-right corner of the box. 124 * \param c Character to fill the box with. 125 * \return void 126 */ 98 127 void caca_fill_box(int x1, int y1, int x2, int y2, char c) 99 128 { -
libcaca/trunk/src/caca.c
r251 r257 58 58 #endif 59 59 60 /** 61 * \brief Initialise libcaca. 62 * 63 * \return 0 upon success, a non-zero value if an error occurs. 64 */ 60 65 int caca_init(void) 61 66 { … … 126 131 } 127 132 133 /** 134 * \brief Get the screen width. 135 * 136 * \return The screen width, in character cells. 137 */ 128 138 unsigned int caca_get_width(void) 129 139 { … … 131 141 } 132 142 143 /** 144 * \brief Get the screen height. 145 * 146 * \return The screen height, in character cells. 147 */ 133 148 unsigned int caca_get_height(void) 134 149 { … … 136 151 } 137 152 153 /** 154 * \brief Translate a colour value into its name. 155 * 156 * \param color The colour value. 157 * \return A static string containing the colour's name. 158 */ 138 159 const char *caca_get_color_name(enum caca_color color) 139 160 { … … 164 185 } 165 186 187 /** 188 * \brief Get the current value of a feature. 189 * 190 * \param feature The requested feature. 191 * \return The current value of the feature. 192 */ 166 193 enum caca_feature caca_get_feature(enum caca_feature feature) 167 194 { … … 180 207 } 181 208 209 /** 210 * \brief Set a feature. 211 * 212 * \param feature The wanted feature. 213 * \return void 214 */ 182 215 void caca_set_feature(enum caca_feature feature) 183 216 { … … 213 246 } 214 247 248 /** 249 * \brief Translate a feature value into its name. 250 * 251 * \param feature The feature value. 252 * \return A static string containing the feature's name. 253 */ 215 254 const char *caca_get_feature_name(enum caca_feature feature) 216 255 { … … 233 272 } 234 273 274 /** 275 * \brief Uninitialise libcaca. 276 * 277 * \return void 278 */ 235 279 void caca_end(void) 236 280 { -
libcaca/trunk/src/caca.h
r256 r257 227 227 */ 228 228 void caca_draw_line(int, int, int, int, char); 229 void caca_draw_polyline(const int [], const int[], int, char);229 void caca_draw_polyline(const int x[], const int y[], int, char); 230 230 void caca_draw_thin_line(int, int, int, int); 231 void caca_draw_thin_polyline(const int [], const int[], int);231 void caca_draw_thin_polyline(const int x[], const int y[], int); 232 232 233 233 void caca_draw_circle(int, int, int, char); … … 271 271 unsigned int, unsigned int, 272 272 unsigned int, unsigned int); 273 void caca_set_bitmap_palette(struct caca_bitmap *, unsigned int[], 274 unsigned int[], unsigned int[], unsigned int[]); 273 void caca_set_bitmap_palette(struct caca_bitmap *, 274 unsigned int r[], unsigned int g[], 275 unsigned int b[], unsigned int a[]); 275 276 void caca_draw_bitmap(int, int, int, int, const struct caca_bitmap *, void *); 276 277 void caca_free_bitmap(struct caca_bitmap *); -
libcaca/trunk/src/conic.c
r246 r257 44 44 static void ellipsepoints(int, int, int, int, char); 45 45 46 /** 47 * \brief Draw a circle on the screen using the given character. 48 * 49 * \param x Center X coordinate. 50 * \param y Center Y coordinate. 51 * \param r Circle radius. 52 * \param c Character to draw the circle outline with. 53 * \return void 54 */ 46 55 void caca_draw_circle(int x, int y, int r, char c) 47 56 { … … 58 67 } 59 68 69 /** 70 * \brief Fill an ellipse on the screen using the given character. 71 * 72 * \param xo Center X coordinate. 73 * \param yo Center Y coordinate. 74 * \param a Ellipse X radius. 75 * \param b Ellipse Y radius. 76 * \param c Character to fill the ellipse with. 77 * \return void 78 */ 60 79 void caca_fill_ellipse(int xo, int yo, int a, int b, char c) 61 80 { … … 103 122 } 104 123 124 /** 125 * \brief Draw an ellipse on the screen using the given character. 126 * 127 * \param xo Center X coordinate. 128 * \param yo Center Y coordinate. 129 * \param a Ellipse X radius. 130 * \param b Ellipse Y radius. 131 * \param c Character to draw the ellipse outline with. 132 * \return void 133 */ 105 134 void caca_draw_ellipse(int xo, int yo, int a, int b, char c) 106 135 { … … 145 174 } 146 175 176 /** 177 * \brief Draw a thin ellipse on the screen. 178 * 179 * \param xo Center X coordinate. 180 * \param yo Center Y coordinate. 181 * \param a Ellipse X radius. 182 * \param b Ellipse Y radius. 183 * \return void 184 */ 147 185 void caca_draw_thin_ellipse(int xo, int yo, int a, int b) 148 186 { -
libcaca/trunk/src/graphics.c
r251 r257 93 93 static enum caca_color _caca_bgcolor = CACA_COLOR_BLACK; 94 94 95 /** 96 * \brief Set the default colour pair. 97 * 98 * \param fgcolor The desired foreground colour. 99 * \param bgcolor The desired background colour. 100 * \return void 101 */ 95 102 void caca_set_color(enum caca_color fgcolor, enum caca_color bgcolor) 96 103 { … … 112 119 } 113 120 121 /** 122 * \brief Get the current foreground colour. 123 * 124 * \return The current foreground colour. 125 */ 114 126 enum caca_color caca_get_fg_color(void) 115 127 { … … 117 129 } 118 130 131 /** 132 * \brief Get the current background colour. 133 * 134 * \return The current background colour. 135 */ 119 136 enum caca_color caca_get_bg_color(void) 120 137 { … … 122 139 } 123 140 141 /** 142 * \brief Print a character at given coordinates. 143 * 144 * \param x The X coordinate of the character. 145 * \param y The Y coordinate of the character. 146 * \param c The character to print. 147 * \return void 148 */ 124 149 void caca_putchar(int x, int y, char c) 125 150 { … … 148 173 } 149 174 175 /** 176 * \brief Print a string at given coordinates. 177 * 178 * \param x The X coordinate of the string. 179 * \param y The Y coordinate of the string. 180 * \param s The string to print. 181 * \return void 182 */ 150 183 void caca_putstr(int x, int y, const char *s) 151 184 { … … 193 226 } 194 227 228 /** 229 * \brief Format a string at given coordinates. 230 * 231 * \param x The X coordinate of the string. 232 * \param y The Y coordinate of the string. 233 * \param format The format string to print. 234 * \param ... Arguments to the format string. 235 * \return void 236 */ 195 237 void caca_printf(int x, int y, const char *format, ...) 196 238 { … … 220 262 } 221 263 264 /** 265 * \brief Clear the screen. 266 * 267 * \return void 268 */ 222 269 void caca_clear(void) 223 270 { … … 419 466 } 420 467 468 /** 469 * \brief Set the refresh delay. 470 * 471 * \param usec The refresh delay in microseconds. 472 * \return void 473 */ 421 474 void caca_set_delay(unsigned int usec) 422 475 { … … 424 477 } 425 478 479 /** 480 * \brief Get the average rendering time. 481 * 482 * \return The render time in microseconds. 483 */ 426 484 unsigned int caca_get_rendertime(void) 427 485 { … … 449 507 } 450 508 509 /** 510 * \brief Flush pending changes and redraw the screen. 511 * 512 * \return void 513 */ 451 514 void caca_refresh(void) 452 515 { -
libcaca/trunk/src/io.c
r251 r257 54 54 static int keys = 0; 55 55 56 /** 57 * \brief Get the next mouse or keyboard input event. 58 * 59 * \return The next event in the queue, or 0 if no event is pending. 60 */ 56 61 unsigned int caca_get_event(void) 57 62 { -
libcaca/trunk/src/line.c
r246 r257 77 77 } 78 78 79 /** 80 * \brief Draw a polyline on the screen using the given character and 81 * coordinate arrays. The first and last points are not connected, 82 * so in order to draw a polygon you need to specify the starting 83 * point at the end of the list as well. 84 * 85 * \param x Array of X coordinates. Must have \p n + 1 elements. 86 * \param y Array of Y coordinates. Must have \p n + 1 elements. 87 * \param n Number of lines to draw. 88 * \param c Character to draw the lines with. 89 * \return void 90 */ 79 91 void caca_draw_polyline(const int x[], const int y[], int n, char c) 80 92 { … … 114 126 } 115 127 128 /** 129 * \brief Draw a thin polyline on the screen using the given coordinate 130 * arrays and with ASCII art. The first and last points are not 131 * connected, so in order to draw a polygon you need to specify the 132 * starting point at the end of the list as well. 133 * 134 * \param x Array of X coordinates. Must have \p n + 1 elements. 135 * \param y Array of Y coordinates. Must have \p n + 1 elements. 136 * \param n Number of lines to draw. 137 * \return void 138 */ 116 139 void caca_draw_thin_polyline(const int x[], const int y[], int n) 117 140 { … … 196 219 * \param x X coordinate of the point. 197 220 * \param y Y coordinate of the point. 198 * \return bThe clipping bits for the given point.221 * \return The clipping bits for the given point. 199 222 */ 200 223 static uint8_t clip_bits(int x, int y) -
libcaca/trunk/src/math.c
r205 r257 35 35 #include "caca_internals.h" 36 36 37 /** 38 * \brief Generate a random integer within a range. 39 * 40 * \param min The lower bound of the integer range. 41 * \param max The upper bound of the integer range. 42 * \return A random integer comprised between \p min and \p max, inclusive. 43 */ 37 44 int caca_rand(int min, int max) 38 45 { … … 40 47 } 41 48 49 /** 50 * \brief Approximate a square root, using Newton's method to avoid 51 * costly floating point calculations. 52 * 53 * \param a A positive integer. 54 * \return The approximate square root of \p a. 55 */ 42 56 unsigned int caca_sqrt(unsigned int a) 43 57 { -
libcaca/trunk/src/sprite.c
r246 r257 51 51 }; 52 52 53 /** 54 * \brief Allocate a sprite loaded from a file. 55 * 56 * \param file The filename. 57 * \return The sprite, or NULL if an error occured. 58 */ 53 59 struct caca_sprite *caca_load_sprite(const char *file) 54 60 { … … 166 172 } 167 173 174 /** 175 * \brief Return the number of frames in a sprite. 176 * 177 * \param sprite The sprite. 178 * \return The number of frames. 179 */ 168 180 int caca_get_sprite_frames(const struct caca_sprite *sprite) 169 181 { … … 174 186 } 175 187 188 /** 189 * \brief Return the width of a sprite. 190 * 191 * \param sprite The sprite. 192 * \param f The frame index. 193 * \return The width of the given frame of the sprite. 194 */ 176 195 int caca_get_sprite_width(const struct caca_sprite *sprite, int f) 177 196 { … … 185 204 } 186 205 206 /** 207 * \brief Return the height of a sprite. 208 * 209 * \param sprite The sprite. 210 * \param f The frame index. 211 * \return The height of the given frame of the sprite. 212 */ 187 213 int caca_get_sprite_height(const struct caca_sprite *sprite, int f) 188 214 { … … 196 222 } 197 223 224 /** 225 * \brief Return the X coordinate of a sprite's handle. 226 * 227 * \param sprite The sprite. 228 * \param f The frame index. 229 * \return The X coordinate of the given frame's handle. 230 */ 198 231 int caca_get_sprite_dx(const struct caca_sprite *sprite, int f) 199 232 { … … 207 240 } 208 241 242 /** 243 * \brief Return the Y coordinate of a sprite's handle. 244 * 245 * \param sprite The sprite. 246 * \param f The frame index. 247 * \return The Y coordinate of the given frame's handle. 248 */ 209 249 int caca_get_sprite_dy(const struct caca_sprite *sprite, int f) 210 250 { … … 218 258 } 219 259 260 /** 261 * \brief Draw a sprite's specific frame at the given coordinates. If the 262 * frame does not exist, nothing is displayed. 263 * 264 * \param x The X coordinate. 265 * \param y The Y coordinate. 266 * \param sprite The sprite. 267 * \param f The frame index. 268 * \return void 269 */ 220 270 void caca_draw_sprite(int x, int y, const struct caca_sprite *sprite, int f) 221 271 { … … 252 302 } 253 303 304 /** 305 * \brief Free the memory associated with a sprite. 306 * 307 * \param sprite The sprite to be freed. 308 * \return void 309 */ 254 310 void caca_free_sprite(struct caca_sprite *sprite) 255 311 { -
libcaca/trunk/src/triangle.c
r246 r257 35 35 #include "caca_internals.h" 36 36 37 /** 38 * \brief Draw a triangle on the screen using the given character. 39 * 40 * \param x1 X coordinate of the first point. 41 * \param y1 Y coordinate of the first point. 42 * \param x2 X coordinate of the second point. 43 * \param y2 Y coordinate of the second point. 44 * \param x3 X coordinate of the third point. 45 * \param y3 Y coordinate of the third point. 46 * \param c Character to draw the triangle outline with. 47 * \return void 48 */ 37 49 void caca_draw_triangle(int x1, int y1, int x2, int y2, int x3, int y3, char c) 38 50 { … … 42 54 } 43 55 56 /** 57 * \brief Draw a thin triangle on the screen. 58 * 59 * \param x1 X coordinate of the first point. 60 * \param y1 Y coordinate of the first point. 61 * \param x2 X coordinate of the second point. 62 * \param y2 Y coordinate of the second point. 63 * \param x3 X coordinate of the third point. 64 * \param y3 Y coordinate of the third point. 65 * \return void 66 */ 44 67 void caca_draw_thin_triangle(int x1, int y1, int x2, int y2, int x3, int y3) 45 68 { … … 49 72 } 50 73 74 /** 75 * \brief Fill a triangle on the screen using the given character. 76 * 77 * \param x1 X coordinate of the first point. 78 * \param y1 Y coordinate of the first point. 79 * \param x2 X coordinate of the second point. 80 * \param y2 Y coordinate of the second point. 81 * \param x3 X coordinate of the third point. 82 * \param y3 Y coordinate of the third point. 83 * \param c Character to fill the triangle with. 84 * \return void 85 */ 51 86 void caca_fill_triangle(int x1, int y1, int x2, int y2, int x3, int y3, char c) 52 87 {
Note: See TracChangeset
for help on using the changeset viewer.