VisClient/net/sf/ffmpeg_java/SWScaleLibrary.java

Go to the documentation of this file.
00001 package net.sf.ffmpeg_java;
00002 
00003 import com.sun.jna.Library;
00004 import com.sun.jna.Native;
00005 import com.sun.jna.Pointer;
00006 import com.sun.jna.Structure;
00007 
00008 public interface SWScaleLibrary extends Library {
00009 
00010     public static final SWScaleLibrary INSTANCE = (SWScaleLibrary) Native.loadLibrary(
00011                 System.getProperty("swscale.lib",
00012                         System.getProperty("os.name").startsWith("Windows") ? "swscale-0" : "swscale"), 
00013                 SWScaleLibrary.class);
00014     
00015 /*    public static final int LIBSWSCALE_VERSION_INT = ((0<<16)+(7<<8)+1);      // version this comes from
00016     public static final String LIBSWSCALE_VERSION  = "0.7.1";
00017     public static final int LIBSWSCALE_BUILD = LIBSWSCALE_VERSION_INT;
00018 
00019     public static final String LIBAVCODEC_IDENT = "SwS" + LIBSWSCALE_VERSION;
00020 */    
00021     public int swscale_version();
00022 
00023     /* values for the flags, the stuff on the command line is different */
00024     /*
00025     #define SWS_FAST_BILINEAR     1
00026     #define SWS_BILINEAR          2
00027     #define SWS_BICUBIC           4
00028     #define SWS_X                 8
00029     #define SWS_POINT          0x10
00030     #define SWS_AREA           0x20
00031     #define SWS_BICUBLIN       0x40
00032     #define SWS_GAUSS          0x80
00033     #define SWS_SINC          0x100
00034     #define SWS_LANCZOS       0x200
00035     #define SWS_SPLINE        0x400
00036 
00037     #define SWS_SRC_V_CHR_DROP_MASK     0x30000
00038     #define SWS_SRC_V_CHR_DROP_SHIFT    16
00039 
00040     #define SWS_PARAM_DEFAULT           123456
00041 
00042     #define SWS_PRINT_INFO              0x1000
00043 
00044     //the following 3 flags are not completely implemented
00045     //internal chrominace subsampling info
00046     #define SWS_FULL_CHR_H_INT    0x2000
00047     //input subsampling info
00048     #define SWS_FULL_CHR_H_INP    0x4000
00049     #define SWS_DIRECT_BGR        0x8000
00050     #define SWS_ACCURATE_RND      0x40000
00051     #define SWS_BITEXACT          0x80000
00052 
00053     #define SWS_CPU_CAPS_MMX      0x80000000
00054     #define SWS_CPU_CAPS_MMX2     0x20000000
00055     #define SWS_CPU_CAPS_3DNOW    0x40000000
00056     #define SWS_CPU_CAPS_ALTIVEC  0x10000000
00057     #define SWS_CPU_CAPS_BFIN     0x01000000
00058 
00059     #define SWS_MAX_REDUCE_CUTOFF 0.002
00060 
00061     #define SWS_CS_ITU709         1
00062     #define SWS_CS_FCC            4
00063     #define SWS_CS_ITU601         5
00064     #define SWS_CS_ITU624         5
00065     #define SWS_CS_SMPTE170M      5
00066     #define SWS_CS_SMPTE240M      7
00067     #define SWS_CS_DEFAULT        5
00068 */
00069     public static final int SWS_FAST_BILINEAR    = 1;
00070     public static final int SWS_BILINEAR =         2;
00071     public static final int SWS_BICUBIC   =        4;
00072     public static final int SWS_X          =       8;
00073     public static final int SWS_POINT       =   0x10;
00074     public static final int SWS_AREA         =  0x20;
00075     public static final int SWS_BICUBLIN   =    0x40;
00076     public static final int SWS_GAUSS       =   0x80;
00077     public static final int SWS_SINC      =    0x100;
00078     public static final int SWS_LANCZOS    =   0x200;
00079     public static final int SWS_SPLINE      =  0x400;
00080 
00081     public static final int SWS_SRC_V_CHR_DROP_MASK   =  0x30000;
00082     public static final int SWS_SRC_V_CHR_DROP_SHIFT =   16;
00083 
00084     public static final int SWS_PARAM_DEFAULT    =       123456;
00085 
00086     public static final int SWS_PRINT_INFO      =        0x1000;
00087 
00088     //the following 3 flags are not completely implemented
00089     //internal chrominace subsampling info
00090     public static final int SWS_FULL_CHR_H_INT  =  0x2000;
00091     //input subsampling info
00092     public static final int SWS_FULL_CHR_H_INP  =  0x4000;
00093     public static final int SWS_DIRECT_BGR     =   0x8000;
00094     public static final int SWS_ACCURATE_RND   =   0x40000;
00095     public static final int SWS_BITEXACT       =   0x80000;
00096 
00097     public static final int SWS_CPU_CAPS_MMX    =  0x80000000;
00098     public static final int SWS_CPU_CAPS_MMX2   =  0x20000000;
00099     public static final int SWS_CPU_CAPS_3DNOW  =  0x40000000;
00100     public static final int SWS_CPU_CAPS_ALTIVEC = 0x10000000;
00101     public static final int SWS_CPU_CAPS_BFIN =    0x01000000;
00102 
00103     public static final double SWS_MAX_REDUCE_CUTOFF = 0.002;
00104 
00105     public static final int SWS_CS_ITU709       =  1;
00106     public static final int SWS_CS_FCC          =  4;
00107     public static final int SWS_CS_ITU601       =  5;
00108     public static final int SWS_CS_ITU624      =   5;
00109     public static final int SWS_CS_SMPTE170M   =   5;
00110     public static final int SWS_CS_SMPTE240M   =   7;
00111     public static final int SWS_CS_DEFAULT     =   5;
00112 
00113 
00114     // when used for filters they must have an odd number of elements
00115     // coeffs cannot be shared between vectors
00116     /*
00117     typedef struct {
00118         double *coeff;
00119         int length;
00120     } SwsVector; */
00121     public static class SwsVector extends Structure {
00122         Pointer coeff;   // Pointer to a double
00123         int length;
00124     }
00125 
00126     // vectors can be shared
00127     /*
00128     typedef struct {
00129         SwsVector *lumH;
00130         SwsVector *lumV;
00131         SwsVector *chrH;
00132         SwsVector *chrV;
00133     } SwsFilter;
00134     */
00135     public static class SwsFilter extends Structure {
00136         Pointer lumH;
00137         Pointer lumV;
00138         Pointer chrH;
00139         Pointer chrV;
00140     }
00141 
00142     //struct SwsContext;
00143 
00144     public void sws_freeContext(Pointer swsContext);
00145 
00146     //struct SwsContext *sws_getContext(int srcW, int srcH, int srcFormat, int dstW, int dstH, int dstFormat, int flags,
00147       //                                SwsFilter *srcFilter, SwsFilter *dstFilter, double *param);
00148     public Pointer sws_getContext(int srcW, int srcH, int srcFormat, int dstW, int dstH, int dstFormat, int flags,
00149                                     SwsFilter srcFilter, SwsFilter dstFilter, Pointer param);
00150     
00151 //    int sws_scale(struct SwsContext *context, uint8_t* src[], int srcStride[], int srcSliceY,
00152   //                int srcSliceH, uint8_t* dst[], int dstStride[]);
00153     public int sws_scale(Pointer context, Pointer src[], int srcStride[], int srcSliceY,
00154             int srcSliceH, Pointer dst[], int dstStride[]);
00155 
00156 //    int sws_scale_ordered(struct SwsContext *context, uint8_t* src[], int srcStride[], int srcSliceY,
00157   //
00158   public int sws_scale_ordered(Pointer context, Pointer src[], int srcStride[], int srcSliceY,
00159             int srcSliceH, Pointer dst[], int dstStride[]) ; //attribute_deprecated;
00160 
00161 //    int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4], int srcRange, const int table[4], int dstRange, int brightness, int contrast, int saturation);
00162   public int sws_setColorspaceDetails(Pointer c, int inv_table[], int srcRange, int table[], int dstRange, int brightness, int contrast, int saturation);
00163 
00164 //    int sws_getColorspaceDetails(struct SwsContext *c, int **inv_table, int *srcRange, int **table, int *dstRange, int *brightness, int *contrast, int *saturation);
00165   // FIXME:  translate to better JNA
00166   public int sws_getColorspaceDetails(Pointer c, Pointer inv_table, Pointer srcRange, Pointer table, Pointer dstRange, Pointer brightness, Pointer contrast, Pointer saturation);
00167 
00168     /*
00169     SwsVector *sws_getGaussianVec(double variance, double quality);
00170     SwsVector *sws_getConstVec(double c, int length);
00171     SwsVector *sws_getIdentityVec(void);
00172         */
00173   public Pointer sws_getGaussianVec(double variance, double quality);
00174   public Pointer sws_getConstVec(double c, int length);
00175   public Pointer sws_getIdentityVec();
00176     
00177     /*
00178     void sws_scaleVec(SwsVector *a, double scalar);
00179     void sws_normalizeVec(SwsVector *a, double height);
00180     void sws_convVec(SwsVector *a, SwsVector *b);
00181     void sws_addVec(SwsVector *a, SwsVector *b);
00182     void sws_subVec(SwsVector *a, SwsVector *b);
00183     void sws_shiftVec(SwsVector *a, int shift);
00184     SwsVector *sws_cloneVec(SwsVector *a);
00185 
00186     void sws_printVec(SwsVector *a);
00187     void sws_freeVec(SwsVector *a);
00188         */
00189   public void sws_scaleVec(SwsVector a, double scalar);
00190   public void sws_normalizeVec(SwsVector a, double height);
00191   public void sws_convVec(SwsVector a, SwsVector b);
00192   public void sws_addVec(SwsVector a, SwsVector b);
00193   public void sws_subVec(SwsVector a, SwsVector b);
00194   public void sws_shiftVec(SwsVector a, int shift);
00195   public Pointer sws_cloneVec(SwsVector a);
00196 
00197     public void sws_printVec(SwsVector a);
00198     public void sws_freeVec(SwsVector a);
00199     
00200     /*
00201     SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur,
00202                                     float lumaSarpen, float chromaSharpen,
00203                                     float chromaHShift, float chromaVShift,
00204                                     int verbose);
00205     void sws_freeFilter(SwsFilter *filter);
00206 
00207     struct SwsContext *sws_getCachedContext(struct SwsContext *context,
00208                                             int srcW, int srcH, int srcFormat,
00209                                             int dstW, int dstH, int dstFormat, int flags,
00210                                             SwsFilter *srcFilter, SwsFilter *dstFilter, double *param);
00211     
00212     */
00213     public Pointer sws_getDefaultFilter(float lumaGBlur, float chromaGBlur,
00214             float lumaSarpen, float chromaSharpen,
00215             float chromaHShift, float chromaVShift,
00216             int verbose);
00217     public void sws_freeFilter(SwsFilter filter);
00218 
00219     public Pointer sws_getCachedContext(Pointer context,
00220                     int srcW, int srcH, int srcFormat,
00221                     int dstW, int dstH, int dstFormat, int flags,
00222                     SwsFilter srcFilter, SwsFilter dstFilter, Pointer param);
00223     
00224 }

Generated on Tue Apr 7 17:57:19 2009 for visclient by  doxygen 1.5.1