Pārlūkot izejas kodu

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

tags/v0.99.beta14
Sam Hocevar sam pirms 18 gadiem
vecāks
revīzija
3c3e37ca65
2 mainītis faili ar 20 papildinājumiem un 0 dzēšanām
  1. +1
    -0
      cucul/cucul.h
  2. +19
    -0
      cucul/transform.c

+ 1
- 0
cucul/cucul.h Parādīt failu

@@ -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 Parādīt failu

@@ -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


Notiek ielāde…
Atcelt
Saglabāt