FileDocCategorySizeDatePackage
ImageFormat.javaAPI DocAndroid 5.1 API3290Thu Mar 12 22:22:30 GMT 2015android.filterfw.format

ImageFormat

public class ImageFormat extends Object
hide

Fields Summary
public static final String
COLORSPACE_KEY
public static final int
COLORSPACE_GRAY
public static final int
COLORSPACE_RGB
public static final int
COLORSPACE_RGBA
public static final int
COLORSPACE_YUV
Constructors Summary
Methods Summary
public static intbytesPerSampleForColorspace(int colorspace)

        switch (colorspace) {
            case COLORSPACE_GRAY:
                return 1;
            case COLORSPACE_RGB:
                return 3;
            case COLORSPACE_RGBA:
                return 4;
            case COLORSPACE_YUV:
                return 3;
            default:
                throw new RuntimeException("Unknown colorspace id " + colorspace + "!");
        }
    
public static android.filterfw.core.MutableFrameFormatcreate(int width, int height, int colorspace, int bytesPerSample, int target)


        
                                             
                                             
                                             
                                              
        MutableFrameFormat result = new MutableFrameFormat(FrameFormat.TYPE_BYTE, target);
        result.setDimensions(width, height);
        result.setBytesPerSample(bytesPerSample);
        result.setMetaValue(COLORSPACE_KEY, colorspace);
        if (target == FrameFormat.TARGET_SIMPLE) {
            result.setObjectClass(Bitmap.class);
        }
        return result;
    
public static android.filterfw.core.MutableFrameFormatcreate(int width, int height, int colorspace, int target)

        return create(width,
                      height,
                      colorspace,
                      bytesPerSampleForColorspace(colorspace),
                      target);
    
public static android.filterfw.core.MutableFrameFormatcreate(int colorspace, int target)

        return create(FrameFormat.SIZE_UNSPECIFIED,
                      FrameFormat.SIZE_UNSPECIFIED,
                      colorspace,
                      bytesPerSampleForColorspace(colorspace),
                      target);
    
public static android.filterfw.core.MutableFrameFormatcreate(int colorspace)

        return create(FrameFormat.SIZE_UNSPECIFIED,
                      FrameFormat.SIZE_UNSPECIFIED,
                      colorspace,
                      bytesPerSampleForColorspace(colorspace),
                      FrameFormat.TARGET_UNSPECIFIED);