Boost logo

Boost :

From: Adam Badura (abadura_at_[hidden])
Date: 2005-09-20 02:43:03


    For now I think taht template representation would be best. What i mean
is for example

    struct rgb_8888 {
        unsigned char r : 8;
        unsigned char g : 8;
        unsigned char b : 8;
        unsigned char : 8;
    };

    struct yuv_422 {
        unsigned char y : 4;
        unsigned char u : 2;
        unsigned char v : 2;
    };

    template<typename Components> class color {
    private:
        Components mComponents;
    };

    A few typical "structs" will be defined and if user has a special need
(perhabs becouse his program has a special memory representation) than he
defines his own struct. Structs would also provide a standarized functions
to manipulate on components without knwoing their real representation
(perheps get_component(i) set_component(i) - ore something like this). I am
also considerating to give something like color_traits, but it is a project
now and i don't know if this would be realy needed.
    color class would give functions for manipulating on color, but no
additional data members. I am now working on this but i think it can be good
aspecialy because of templates which allows inlining simple functions and
produce fas code, what is neede in such class to be realy used in graphic
manipulation. Also using templates, as I hope, produces high extensibility
(user may add his own format).

    Adam Badura


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk