[Jderobot-admin] jderobot-r897 - trunk/src/libs/colorspaces

redstar en jderobot.org redstar en jderobot.org
Lun Abr 1 23:38:55 CEST 2013


Author: redstar
Date: 2013-04-01 23:37:55 +0200 (Mon, 01 Apr 2013)
New Revision: 897

Modified:
   trunk/src/libs/colorspaces/imagecv.h
Log:
Soporte para im?\195?\161genes en formato NV21 (formato Android nativo) en colorspaces


Modified: trunk/src/libs/colorspaces/imagecv.h
===================================================================
--- trunk/src/libs/colorspaces/imagecv.h	2013-04-01 21:20:34 UTC (rev 896)
+++ trunk/src/libs/colorspaces/imagecv.h	2013-04-01 21:37:55 UTC (rev 897)
@@ -347,6 +347,46 @@
     static Image& imageCvt(const Image& src, Image& dst) throw(NoConversion);
     static const FormatPtr FORMAT_YCRCB;
   };
+
+  /**
+   * A NV21 image
+   */
+  class ImageNV21: public  Image {
+  public:
+    /**
+     * Constructor
+     * Width have to be an even number.
+     */
+    ImageNV21(const int width, const int height);
+    
+    /**
+     * Constructor from user data
+     * Width have to be an even number.
+     */
+    ImageNV21(const int width, const int height, void *const data);
+
+    /**
+     * Copy constructor.
+     * if \param i doesn't match format a conversion will happen.
+     */
+    ImageNV21(const Image& i);
+
+    
+    /**
+     * Conversion methods.
+     * Returns a copy
+     */
+    void toGRAY8(Image& dst) const throw(FormatMismatch);
+    void toRGB8(Image& dst) const throw(FormatMismatch);
+    void toYCRCB(Image& dst) const throw(FormatMismatch);
+    
+    /**
+     * Factory method
+     */
+    static Image* createInstance(const int width, const int height, void *const data);
+    static Image& imageCvt(const Image& src, Image& dst) throw(NoConversion);
+    static const FormatPtr FORMAT_NV21;
+  };
   
 
 } //namespace



More information about the Jderobot-admin mailing list