ソースを参照

* Implemented cucul_invert() to invert a canvas' colours.

tags/v0.99.beta14
Sam Hocevar sam 18年前
コミット
3c3e37ca65
2個のファイルの変更20行の追加0行の削除
  1. +1
    -0
      cucul/cucul.h
  2. +19
    -0
      cucul/transform.c

+ 1
- 0
cucul/cucul.h ファイルの表示

@@ -151,6 +151,7 @@ void cucul_blit(cucul_t *, int, int, cucul_t const *, cucul_t const *);
* These functions perform horizontal and vertical canvas flipping.
*
* @{ */
void cucul_invert(cucul_t *);
void cucul_flip(cucul_t *);
void cucul_flop(cucul_t *);
void cucul_rotate(cucul_t *);


+ 19
- 0
cucul/transform.c ファイルの表示

@@ -29,6 +29,25 @@ static uint32_t flipchar(uint32_t ch);
static uint32_t flopchar(uint32_t ch);
static uint32_t rotatechar(uint32_t ch);

/** \brief Invert a canvas' colours.
*
* This function inverts a canvas' colours (black becomes white, red
* becomes cyan, etc.) without changing the characters in it.
*
* \param qq The canvas to invert.
*/
void cucul_invert(cucul_t *qq)
{
uint8_t *attr = qq->attr;
unsigned int i;

for(i = qq->height * qq->width; i--; )
{
*attr = ~*attr;
attr++;
}
}

/** \brief Flip a canvas horizontally.
*
* This function flips a canvas horizontally, choosing characters that


読み込み中…
キャンセル
保存