Changeset 67b05ff in mainline for uspace/srv/hid/fb


Ignore:
Timestamp:
2011-08-10T18:34:23Z (14 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c6f08726
Parents:
62e29ae
Message:

cherrypick from fb server rewrite: store images as Truevision TGA (instead of PPM) and use a library to decode them into image maps

Location:
uspace/srv/hid/fb
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/fb/Makefile

    r62e29ae r67b05ff  
    8686endif
    8787
    88 EXTRA_CFLAGS += -D$(UARCH)
     88LIBS = $(LIBIMGMAP_PREFIX)/libimgmap.a
     89EXTRA_CFLAGS += -I$(LIBIMGMAP_PREFIX) -D$(UARCH)
    8990
    9091include $(USPACE_PREFIX)/Makefile.common
  • uspace/srv/hid/fb/fb.c

    r62e29ae r67b05ff  
    10951095                        shm = dest;
    10961096                       
    1097                         if (shm[0] != 'P')
     1097                        if ((shm[0] != 'P') || (shm[0] != 'I'))
    10981098                                return false;
    10991099                       
  • uspace/srv/hid/fb/ppm.c

    r62e29ae r67b05ff  
    2929#include <sys/types.h>
    3030#include <errno.h>
     31#include <imgmap.h>
    3132
    3233#include "ppm.h"
     
    9495        unsigned int coef;
    9596       
     97        /*
     98         * This is temporary hack to draw
     99         * image maps within the original code base.
     100         * This will be completely rewritten in the
     101         * new framebuffer server.
     102         */
     103        if (data[0] == 'I') {
     104                imgmap_t *img = (imgmap_t *) data;
     105               
     106                if (img->visual != VISUAL_BGR_8_8_8)
     107                        return EINVAL;
     108               
     109                data = img->data;
     110               
     111                for (sysarg_t y = 0; y < img->height; y++) {
     112                        for (sysarg_t x = 0; x < img->width; x++) {
     113                                if ((x > maxwidth) || (y > maxheight)) {
     114                                        data += 3;
     115                                        continue;
     116                                }
     117                               
     118                                color = (data[2] << 16) + (data[1] << 8) + data[0];
     119                               
     120                                (*putpixel)(vport, sx + x, sy + y, color);
     121                                data += 3;
     122                        }
     123                }
     124               
     125                return 0;
     126        }
     127       
    96128        /* Read magic */
    97129        if ((data[0] != 'P') || (data[1] != '6'))
Note: See TracChangeset for help on using the changeset viewer.