Преглед на файлове

* Renamed cucul_left/cucul_right into cucul_rotate_left/cucul_rotate_right.

* Renamed cucul_rotate into cucul_rotate_180.
  * Deprecated cucul_rotate and fix examples accordingly.
  Hope it all makes sense.
tags/v0.99.beta14
Sam Hocevar sam преди 17 години
родител
ревизия
f338951be9
променени са 5 файла, в които са добавени 19 реда и са изтрити 9 реда
  1. +4
    -3
      cucul/cucul.h
  2. +9
    -0
      cucul/legacy.c
  3. +3
    -3
      cucul/transform.c
  4. +2
    -2
      test/text.c
  5. +1
    -1
      test/transform.c

+ 4
- 3
cucul/cucul.h Целия файл

@@ -120,9 +120,9 @@ int cucul_set_canvas_boundaries(cucul_canvas_t *, int, int,
int cucul_invert(cucul_canvas_t *);
int cucul_flip(cucul_canvas_t *);
int cucul_flop(cucul_canvas_t *);
int cucul_rotate(cucul_canvas_t *);
int cucul_left(cucul_canvas_t *);
int cucul_right(cucul_canvas_t *);
int cucul_rotate_180(cucul_canvas_t *);
int cucul_rotate_left(cucul_canvas_t *);
int cucul_rotate_right(cucul_canvas_t *);
/* @} */

/** \defgroup attributes libcucul attribute conversions
@@ -288,6 +288,7 @@ char const * const * cucul_get_export_list(void);
char const *) CUCUL_DEPRECATED;
cucul_canvas_t * cucul_import_canvas(cucul_buffer_t *,
char const *) CUCUL_DEPRECATED;
int cucul_rotate(cucul_canvas_t *) CUCUL_DEPRECATED;
# define CUCUL_COLOR_BLACK CUCUL_BLACK
# define CUCUL_COLOR_BLUE CUCUL_BLUE
# define CUCUL_COLOR_GREEN CUCUL_GREEN


+ 9
- 0
cucul/legacy.c Целия файл

@@ -209,3 +209,12 @@ int cucul_free_buffer(cucul_buffer_t *buf)
return 0;
}

/*
* Functions from transform.c
*/

int cucul_rotate(cucul_canvas_t *cv)
{
return cucul_rotate_180(cv);
}


+ 3
- 3
cucul/transform.c Целия файл

@@ -173,7 +173,7 @@ int cucul_flop(cucul_canvas_t *cv)
* \param cv The canvas to rotate.
* \return This function always returns 0.
*/
int cucul_rotate(cucul_canvas_t *cv)
int cucul_rotate_180(cucul_canvas_t *cv)
{
uint32_t *cbegin = cv->chars;
uint32_t *cend = cbegin + cv->width * cv->height - 1;
@@ -235,7 +235,7 @@ int cucul_rotate(cucul_canvas_t *cv)
* \param cv The canvas to rotate left.
* \return 0 in case of success, -1 if an error occurred.
*/
int cucul_left(cucul_canvas_t *cv)
int cucul_rotate_left(cucul_canvas_t *cv)
{
uint32_t *newchars, *newattrs;
unsigned int x, y;
@@ -321,7 +321,7 @@ int cucul_left(cucul_canvas_t *cv)
* \param cv The canvas to rotate right.
* \return 0 in case of success, -1 if an error occurred.
*/
int cucul_right(cucul_canvas_t *cv)
int cucul_rotate_right(cucul_canvas_t *cv)
{
uint32_t *newchars, *newattrs;
unsigned int x, y;


+ 2
- 2
test/text.c Целия файл

@@ -60,7 +60,7 @@ int main(int argc, char *argv[])
cucul_flop(pig);
cucul_blit(cv, 0, cucul_get_canvas_height(pig), pig, NULL);
cucul_flop(pig);
cucul_rotate(pig);
cucul_rotate_180(pig);
cucul_blit(cv, cucul_get_canvas_width(pig),
cucul_get_canvas_height(pig), pig, NULL);

@@ -68,7 +68,7 @@ int main(int argc, char *argv[])
fwrite(buffer, len, 1, stdout);
free(buffer);

cucul_left(cv);
cucul_rotate_left(cv);
buffer = cucul_export_memory(cv, "utf8", &len);
fwrite(buffer, len, 1, stdout);
free(buffer);


+ 1
- 1
test/transform.c Целия файл

@@ -104,7 +104,7 @@ int main(int argc, char *argv[])

cucul_put_str(cv, 0, 18, "rotate");
cucul_blit(tmp, 0, 0, image, NULL);
cucul_rotate(tmp);
cucul_rotate_180(tmp);
cucul_blit(cv, 10, 18, tmp, NULL);

caca_refresh_display(dp);


Зареждане…
Отказ
Запис