Ignore:
Timestamp:
Apr 18, 2006, 5:11:25 PM (14 years ago)
Author:
Sam Hocevar
Message:
  • Renamed caca_t into caca_display_t.
  • Renamed canvas handle variables from "c" to "cv". Eh ouais mon gros.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/cucul/transform.c

    r810 r811  
    3333 *  becomes cyan, etc.) without changing the characters in it.
    3434 *
    35  *  \param c The canvas to invert.
    36  */
    37 void cucul_invert(cucul_canvas_t *c)
    38 {
    39     uint32_t *attr = c->attr;
     35 *  \param cv The canvas to invert.
     36 */
     37void cucul_invert(cucul_canvas_t *cv)
     38{
     39    uint32_t *attr = cv->attr;
    4040    unsigned int i;
    4141
    42     for(i = c->height * c->width; i--; )
     42    for(i = cv->height * cv->width; i--; )
    4343    {
    4444        *attr = *attr ^ 0x000f000f;
     
    5252 *  look like the mirrored version wherever possible.
    5353 *
    54  *  \param c The canvas to flip.
    55  */
    56 void cucul_flip(cucul_canvas_t *c)
     54 *  \param cv The canvas to flip.
     55 */
     56void cucul_flip(cucul_canvas_t *cv)
    5757{
    5858    unsigned int y;
    5959
    60     for(y = 0; y < c->height; y++)
    61     {
    62         uint32_t *cleft = c->chars + y * c->width;
    63         uint32_t *cright = cleft + c->width - 1;
    64         uint32_t *aleft = c->attr + y * c->width;
    65         uint32_t *aright = aleft + c->width - 1;
     60    for(y = 0; y < cv->height; y++)
     61    {
     62        uint32_t *cleft = cv->chars + y * cv->width;
     63        uint32_t *cright = cleft + cv->width - 1;
     64        uint32_t *aleft = cv->attr + y * cv->width;
     65        uint32_t *aright = aleft + cv->width - 1;
    6666
    6767        while(cleft < cright)
     
    8989 *  look like the mirrored version wherever possible.
    9090 *
    91  *  \param c The canvas to flop.
    92  */
    93 void cucul_flop(cucul_canvas_t *c)
     91 *  \param cv The canvas to flop.
     92 */
     93void cucul_flop(cucul_canvas_t *cv)
    9494{
    9595    unsigned int x;
    9696
    97     for(x = 0; x < c->width; x++)
    98     {
    99         uint32_t *ctop = c->chars + x;
    100         uint32_t *cbottom = ctop + c->width * (c->height - 1);
    101         uint32_t *atop = c->attr + x;
    102         uint32_t *abottom = atop + c->width * (c->height - 1);
     97    for(x = 0; x < cv->width; x++)
     98    {
     99        uint32_t *ctop = cv->chars + x;
     100        uint32_t *cbottom = ctop + cv->width * (cv->height - 1);
     101        uint32_t *atop = cv->attr + x;
     102        uint32_t *abottom = atop + cv->width * (cv->height - 1);
    103103
    104104        while(ctop < cbottom)
     
    113113            ch = *cbottom; *cbottom = flopchar(*ctop); *ctop = flopchar(ch);
    114114
    115             ctop += c->width; cbottom -= c->width;
    116             atop += c->width; abottom -= c->width;
     115            ctop += cv->width; cbottom -= cv->width;
     116            atop += cv->width; abottom -= cv->width;
    117117        }
    118118
     
    128128 *  possible.
    129129 *
    130  *  \param c The canvas to rotate.
    131  */
    132 void cucul_rotate(cucul_canvas_t *c)
    133 {
    134     uint32_t *cbegin = c->chars;
    135     uint32_t *cend = cbegin + c->width * c->height - 1;
    136     uint32_t *abegin = c->attr;
    137     uint32_t *aend = abegin + c->width * c->height - 1;
     130 *  \param cv The canvas to rotate.
     131 */
     132void cucul_rotate(cucul_canvas_t *cv)
     133{
     134    uint32_t *cbegin = cv->chars;
     135    uint32_t *cend = cbegin + cv->width * cv->height - 1;
     136    uint32_t *abegin = cv->attr;
     137    uint32_t *aend = abegin + cv->width * cv->height - 1;
    138138
    139139    while(cbegin < cend)
Note: See TracChangeset for help on using the changeset viewer.