本文整理汇总了Java中org.jcodec.common.model.Picture.getPlaneData方法的典型用法代码示例。如果您正苦于以下问题:Java Picture.getPlaneData方法的具体用法?Java Picture.getPlaneData怎么用?Java Picture.getPlaneData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jcodec.common.model.Picture
的用法示例。
在下文中一共展示了Picture.getPlaneData方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toColorArray
import org.jcodec.common.model.Picture; //导入方法依赖的package包/类
public static int[] toColorArray(Picture src){
if (src.getColor() != ColorSpace.RGB) {
Transform transform = ColorUtil.getTransform(src.getColor(), ColorSpace.RGB);
Picture rgb = Picture.create(src.getWidth(), src.getHeight(), ColorSpace.RGB, src.getCrop());
transform.transform(src, rgb);
src = rgb;
}
int[] _return = new int[src.getCroppedWidth() * src.getCroppedHeight()];
int[] data = src.getPlaneData(0);
for(int i = 0; i < _return.length; ++i){
_return[i] = ReadableRGBContainer.toIntColor(data[3*i + 2], data[3*i + 1], data[3*i]);
}
return _return;
}
示例2: convert
import org.jcodec.common.model.Picture; //导入方法依赖的package包/类
private Picture[] convert(Picture dct) {
int nInterlaced = 0;
for (int i : dct.getPlaneData(3)) {
nInterlaced += i;
}
Picture[] result;
if (nInterlaced == 0) {
upShift(dct);
result = new Picture[] { colorCvt(dct) };
} /*
* else if (nInterlaced < dct.getDctTypes().length / 10) { result =
* new Picture[] { extend(progressive(dct)) }; }
*/else {
Picture[] field = interlaced(dct);
result = new Picture[] { colorCvt(field[0]), colorCvt(field[1]) };
}
System.out.println(nInterlaced);
return result;
}
示例3: put
import org.jcodec.common.model.Picture; //导入方法依赖的package包/类
public void put(Picture tgt, Picture decoded, int mbX, int mbY) {
int[] luma = tgt.getPlaneData(0);
int stride = tgt.getPlaneWidth(0);
int[] cb = tgt.getPlaneData(1);
int[] cr = tgt.getPlaneData(2);
int strideChroma = tgt.getPlaneWidth(1);
int dOff = 0;
for (int i = 0; i < 16; i++) {
System.arraycopy(decoded.getPlaneData(0), dOff, luma, (mbY * 16 + i) * stride + mbX * 16, 16);
dOff += 16;
}
for (int i = 0; i < 8; i++) {
System.arraycopy(decoded.getPlaneData(1), i * 8, cb, (mbY * 8 + i) * strideChroma + mbX * 8, 8);
}
for (int i = 0; i < 8; i++) {
System.arraycopy(decoded.getPlaneData(2), i * 8, cr, (mbY * 8 + i) * strideChroma + mbX * 8, 8);
}
}
示例4: transform
import org.jcodec.common.model.Picture; //导入方法依赖的package包/类
public void transform(Picture src, Picture dst) {
int[] y = src.getPlaneData(0);
int[] u = src.getPlaneData(1);
int[] v = src.getPlaneData(2);
int[] data = dst.getPlaneData(0);
int offLuma = 0, offChroma = 0;
for (int i = 0; i < dst.getHeight(); i++) {
for (int j = 0; j < dst.getWidth(); j += 2) {
YUVJtoRGB(y[offLuma], u[offChroma], v[offChroma], data, offLuma * 3);
YUVJtoRGB(y[offLuma + 1], u[offChroma], v[offChroma], data, (offLuma + 1) * 3);
offLuma += 2;
++offChroma;
}
}
}
示例5: transform
import org.jcodec.common.model.Picture; //导入方法依赖的package包/类
public void transform(Picture src, Picture dst) {
int[] y = src.getPlaneData(0);
int[] u = src.getPlaneData(1);
int[] v = src.getPlaneData(2);
int[] data = dst.getPlaneData(0);
int offLuma = 0, offChroma = 0;
for (int i = 0; i < dst.getHeight(); i++) {
for (int j = 0; j < dst.getWidth(); j += 2) {
YUV444toRGB888((y[offLuma] << upShift) >> downShift, (u[offChroma] << upShift) >> downShift,
(v[offChroma] << upShift) >> downShift, data, offLuma * 3);
YUV444toRGB888((y[offLuma + 1] << upShift) >> downShift, (u[offChroma] << upShift) >> downShift,
(v[offChroma] << upShift) >> downShift, data, (offLuma + 1) * 3);
offLuma += 2;
++offChroma;
}
}
}
示例6: transform
import org.jcodec.common.model.Picture; //导入方法依赖的package包/类
@Override
public void transform(Picture src, Picture dst) {
int[] sy = src.getPlaneData(0);
int[] dy = dst.getPlaneData(0);
for (int i = 0; i < src.getPlaneWidth(0) * src.getPlaneHeight(0); i++)
dy[i] = (sy[i] * Y_COEFF >> 13) + 16;
int[] su = src.getPlaneData(1);
int[] du = dst.getPlaneData(1);
for (int i = 0; i < src.getPlaneWidth(1) * src.getPlaneHeight(1); i++)
du[i] = ((su[i] - 128) * Y_COEFF >> 13) + 128;
int[] sv = src.getPlaneData(2);
int[] dv = dst.getPlaneData(2);
for (int i = 0; i < src.getPlaneWidth(2) * src.getPlaneHeight(2); i++)
dv[i] = ((sv[i] - 128) * Y_COEFF >> 13) + 128;
}
示例7: fromBufferedImage
import org.jcodec.common.model.Picture; //导入方法依赖的package包/类
public static void fromBufferedImage(Bitmap src, Picture dst) {
int[] dstData = dst.getPlaneData(0);
int off = 0;
for (int i = 0; i < src.getHeight(); i++) {
for (int j = 0; j < src.getWidth(); j++) {
int rgb1 = src.getPixel(j, i);
dstData[off++] = (rgb1 >> 16) & 0xff;
dstData[off++] = (rgb1 >> 8) & 0xff;
dstData[off++] = rgb1 & 0xff;
}
}
}
示例8: collectPredictors
import org.jcodec.common.model.Picture; //导入方法依赖的package包/类
private void collectPredictors(Picture outMB, int mbX) {
topLeft[0][0] = topLine[0][(mbX << 4) + 15];
topLeft[0][1] = outMB.getPlaneData(0)[63];
topLeft[0][2] = outMB.getPlaneData(0)[127];
topLeft[0][3] = outMB.getPlaneData(0)[191];
System.arraycopy(outMB.getPlaneData(0), 240, topLine[0], mbX << 4, 16);
copyCol(outMB.getPlaneData(0), 16, 15, 16, leftRow[0]);
collectChromaPredictors(outMB, mbX);
}
示例9: mergeResidual
import org.jcodec.common.model.Picture; //导入方法依赖的package包/类
private void mergeResidual(Picture mb, Picture mb1) {
for (int j = 0; j < 3; j++) {
int[] to = mb.getPlaneData(j), from = mb1.getPlaneData(j);
for (int i = 0; i < to.length; i++) {
to[i] = clip(to[i] + from[i], 0, 255);
}
}
}
示例10: transform
import org.jcodec.common.model.Picture; //导入方法依赖的package包/类
public void transform(Picture src, Picture dst) {
int[] y = src.getPlaneData(0);
int[] u = src.getPlaneData(1);
int[] v = src.getPlaneData(2);
int[] data = dst.getPlaneData(0);
for (int i = 0, srcOff = 0, dstOff = 0; i < dst.getHeight(); i++) {
for (int j = 0; j < dst.getWidth(); j++, srcOff++, dstOff += 3) {
YUV444toRGB888((y[srcOff] << upShift) >> downShift, (u[srcOff] << upShift) >> downShift,
(v[srcOff] << upShift) >> downShift, data, dstOff);
}
}
}
示例11: toBufferedImageCropped
import org.jcodec.common.model.Picture; //导入方法依赖的package包/类
private static void toBufferedImageCropped(Picture src, BufferedImage dst) {
byte[] data = ((DataBufferByte) dst.getRaster().getDataBuffer()).getData();
int[] srcData = src.getPlaneData(0);
int dstStride = dst.getWidth() * 3;
int srcStride = src.getWidth() * 3;
for (int line = 0, srcOff = 0, dstOff = 0; line < dst.getHeight(); line++) {
for (int id = dstOff, is = srcOff; id < dstOff + dstStride; id += 3, is += 3) {
data[id] = (byte) srcData[is];
data[id + 1] = (byte) srcData[is + 1];
data[id + 2] = (byte) srcData[is + 2];
}
srcOff += srcStride;
dstOff += dstStride;
}
}
示例12: toBufferedImage
import org.jcodec.common.model.Picture; //导入方法依赖的package包/类
public static void toBufferedImage(Picture src, BufferedImage dst) {
byte[] data = ((DataBufferByte) dst.getRaster().getDataBuffer()).getData();
int[] srcData = src.getPlaneData(0);
for (int i = 0; i < data.length; i++) {
data[i] = (byte) srcData[i];
}
}
示例13: fromBufferedImage
import org.jcodec.common.model.Picture; //导入方法依赖的package包/类
public static void fromBufferedImage(BufferedImage src, Picture dst) {
int[] dstData = dst.getPlaneData(0);
int off = 0;
for (int i = 0; i < src.getHeight(); i++) {
for (int j = 0; j < src.getWidth(); j++) {
int rgb1 = src.getRGB(j, i);
dstData[off++] = (rgb1 >> 16) & 0xff;
dstData[off++] = (rgb1 >> 8) & 0xff;
dstData[off++] = rgb1 & 0xff;
}
}
}
示例14: transform
import org.jcodec.common.model.Picture; //导入方法依赖的package包/类
public void transform(Picture src, Picture dst) {
int[] sy = src.getPlaneData(0);
int[] dy = dst.getPlaneData(0);
for (int i = 0; i < src.getPlaneWidth(0) * src.getPlaneHeight(0); i++)
dy[i] = (sy[i] - 16) * COEFF >> shift;
copyAvg(src.getPlaneData(1), dst.getPlaneData(1), src.getPlaneWidth(1), src.getPlaneHeight(1));
copyAvg(src.getPlaneData(2), dst.getPlaneData(2), src.getPlaneWidth(2), src.getPlaneHeight(2));
}
示例15: transform
import org.jcodec.common.model.Picture; //导入方法依赖的package包/类
public void transform(Picture src, Picture dst) {
int[] y = src.getPlaneData(0);
int[] u = src.getPlaneData(1);
int[] v = src.getPlaneData(2);
int[] data = dst.getPlaneData(0);
for (int i = 0, srcOff = 0, dstOff = 0; i < dst.getHeight(); i++) {
for (int j = 0; j < dst.getWidth(); j++, srcOff++, dstOff += 3) {
YUVJtoRGB(y[srcOff], u[srcOff], v[srcOff], data, dstOff);
}
}
}