Changeset a7d2d78 in mainline for fb/ppm.c


Ignore:
Timestamp:
2006-06-03T22:49:28Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2400469
Parents:
1f36e90
Message:

Completed graphical console.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fb/ppm.c

    r1f36e90 ra7d2d78  
    5757}
    5858
     59int ppm_get_data(unsigned char *data, size_t dtsz, int *width, int *height)
     60{
     61        /* Read magic */
     62        if (data[0] != 'P' || data[1] != '6')
     63                return EINVAL;
     64
     65        data+=2;
     66        skip_whitespace(&data);
     67        read_num(&data, width);
     68        skip_whitespace(&data);
     69        read_num(&data,height);
     70
     71        return 0;
     72}
     73
    5974/** Draw PPM pixmap
    6075 *
     
    6782 * @param putpixel Putpixel function used to print bitmap
    6883 */
    69 int draw_ppm(unsigned char *data, size_t datasz, unsigned int sx,
     84int ppm_draw(unsigned char *data, size_t datasz, unsigned int sx,
    7085             unsigned int sy,
    7186             unsigned int maxwidth, unsigned int maxheight,
     
    105120                        continue;
    106121                }
    107                 color = ((data[0]*coef) << 16) + ((data[1]*coef) << 8) + data[0]*coef;
     122                color = ((data[0]*coef) << 16) + ((data[1]*coef) << 8) + data[2]*coef;
    108123               
    109124                (*putpixel)(vp, sx+(i % width), sy+(i / width), color);
Note: See TracChangeset for help on using the changeset viewer.