ImageFormatpublic class ImageFormat extends Object
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 |
Methods Summary |
---|
public static int | bytesPerSampleForColorspace(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.MutableFrameFormat | create(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.MutableFrameFormat | create(int width, int height, int colorspace, int target)
return create(width,
height,
colorspace,
bytesPerSampleForColorspace(colorspace),
target);
| public static android.filterfw.core.MutableFrameFormat | create(int colorspace, int target)
return create(FrameFormat.SIZE_UNSPECIFIED,
FrameFormat.SIZE_UNSPECIFIED,
colorspace,
bytesPerSampleForColorspace(colorspace),
target);
| public static android.filterfw.core.MutableFrameFormat | create(int colorspace)
return create(FrameFormat.SIZE_UNSPECIFIED,
FrameFormat.SIZE_UNSPECIFIED,
colorspace,
bytesPerSampleForColorspace(colorspace),
FrameFormat.TARGET_UNSPECIFIED);
|
|