Home | Develop | Download | Contact
example_ra_color2.cpp
1
28#include <Pds/Ra>
29
30
31int main(void)
32{
33 std::vector<Pds::Matrix> IMG=Pds::Matrix::ImportBmpFile("../manual/imagenes/imagen.bmp");
34
35 std::vector<Pds::Matrix> Out=Pds::Matrix::RandNSampleBlock(IMG.size(),IMG[0].Size());
36
37 if(IMG.size()>=3)
38 {
39 std::cout<<"IMG.size(): "<<IMG.size()<<"\n";
40 std::cout<<"IMG[0].Size(): "<<IMG[0].Size()<<"\n";
41 std::cout<<"IMG[1].Size(): "<<IMG[1].Size()<<"\n";
42 std::cout<<"IMG[2].Size(): "<<IMG[2].Size()<<"\n";
43
44 Pds::Ra::RGB2HSL(IMG[0],IMG[1],IMG[2],Out[0],Out[1],Out[2]);
45
46 ((255.0/360.0)*Out[0]).ExportBmpFile(Pds::Colormap::Gray,"imagen-H.bmp");
47 ((255.0/100.0)*Out[1]).ExportBmpFile(Pds::Colormap::Gray,"imagen-S.bmp");
48 ((255.0/100.0)*Out[2]).ExportBmpFile(Pds::Colormap::Gray,"imagen-L.bmp");
49 }
50}
static std::vector< Pds::Matrix > ImportBmpFile(const std::string &bmpfilename)
Lee matrices de un archivo binario en formato BMP.
static std::vector< Pds::Matrix > RandNSampleBlock(unsigned int N, const Pds::Size &Sz)
Crea un bloque (std::vector<Pds::Matrix>) con matrices no nulas y similares inicializadas con Pds::Ra...
const unsigned char Gray[256][3]
Definition: Colormap.hpp:66
void RGB2HSL(unsigned char r, unsigned char g, unsigned char b, double &h, double &s, double &l)
Transforma de coordenadas RGB a HSL

Enlaces de interés

HomePage Bazaar Download Bug report Ayuda Developer Feed