Home | History | Annotate | Download | only in highgui
      1 /*
      2  *  grfmt_imageio.h
      3  *
      4  *
      5  *  Created by Morgan Conbere on 5/17/07.
      6  *
      7  */
      8 
      9 #ifndef _GRFMT_IMAGEIO_H_
     10 #define _GRFMT_IMAGEIO_H_
     11 
     12 #ifdef HAVE_IMAGEIO
     13 
     14 #include "grfmt_base.h"
     15 #include <ApplicationServices/ApplicationServices.h>
     16 
     17 class GrFmtImageIOReader : public GrFmtReader
     18 {
     19 public:
     20 
     21     GrFmtImageIOReader( const char* filename );
     22     ~GrFmtImageIOReader();
     23 
     24     bool  ReadData( uchar* data, int step, int color );
     25     bool  ReadHeader();
     26     void  Close();
     27 
     28 protected:
     29 
     30     CGImageRef imageRef;
     31 };
     32 
     33 class GrFmtImageIOWriter : public GrFmtWriter
     34 {
     35 public:
     36 
     37     GrFmtImageIOWriter( const char* filename );
     38     ~GrFmtImageIOWriter();
     39 
     40     bool  WriteImage( const uchar* data, int step,
     41                       int width, int height, int depth, int channels );
     42 };
     43 
     44 // ImageIO filter factory
     45 class GrFmtImageIO :public GrFmtFilterFactory
     46 {
     47 public:
     48 
     49     GrFmtImageIO();
     50     ~GrFmtImageIO();
     51 
     52     bool CheckFile( const char* filename );
     53 
     54     GrFmtReader* NewReader( const char* filename );
     55     GrFmtWriter* NewWriter( const char* filename );
     56 };
     57 
     58 #endif/*HAVE_IMAGEIO*/
     59 
     60 #endif/*_GRFMT_IMAGEIO_H_*/
     61