- Timestamp:
- 2006-06-03T22:49:28Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2400469
- Parents:
- 1f36e90
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fb/ppm.c
r1f36e90 ra7d2d78 57 57 } 58 58 59 int 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 59 74 /** Draw PPM pixmap 60 75 * … … 67 82 * @param putpixel Putpixel function used to print bitmap 68 83 */ 69 int draw_ppm(unsigned char *data, size_t datasz, unsigned int sx,84 int ppm_draw(unsigned char *data, size_t datasz, unsigned int sx, 70 85 unsigned int sy, 71 86 unsigned int maxwidth, unsigned int maxheight, … … 105 120 continue; 106 121 } 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; 108 123 109 124 (*putpixel)(vp, sx+(i % width), sy+(i / width), color);
Note:
See TracChangeset
for help on using the changeset viewer.