qjpeg/testJPEGFile.cpp
changeset 76 9cbf4c7e7986
child 78 a55bf2fa3f74
equal deleted inserted replaced
75:327eef3fe747 76:9cbf4c7e7986
       
     1 #include "JPEGFile.h"
       
     2 #include "Image.h"
       
     3 #include "FloatPlane.h"
       
     4 
       
     5 int main()
       
     6 {
       
     7     JPEGFile a("a.jpg");
       
     8 
       
     9     Image *i;
       
    10 
       
    11     i = a.getUnpackedImage();
       
    12 
       
    13     /* Write the planes */
       
    14     i->plane[0].writePGM("hola1.pgm");
       
    15     i->plane[1].writePGM("hola2.pgm");
       
    16     i->plane[2].writePGM("hola3.pgm");
       
    17 
       
    18     i->writePPM("hola.ppm");
       
    19     /* Remove the image and its planes */
       
    20     i->free();
       
    21 
       
    22     i = a.getiDCTImage();
       
    23 
       
    24     /* Write the planes */
       
    25     i->plane[0].writePGM("ihola1.pgm");
       
    26     i->plane[1].writePGM("ihola2.pgm");
       
    27     i->plane[2].writePGM("ihola3.pgm");
       
    28 
       
    29     i->free();
       
    30     delete i;
       
    31 }