public void modifyTexture(Texture2D dest, Image src, int destX, int destY,
            int srcX, int srcY, int areaW, int areaH) {
        final int textureUnitIndex = 0;
        try {
            setTexture(textureUnitIndex, dest);
        } catch (TextureUnitException exception) {
            throw new RuntimeException("Renderer lacks texture units?");
        }

        if(caps.contains(Caps.OpenGLES20) && src.getFormat()!=dest.getImage().getFormat()) {
            logger.log(Level.WARNING, "Incompatible texture subimage");
        }
        int target = convertTextureType(dest.getType(), src.getMultiSamples(), -1);
        texUtil.uploadSubTexture(target, src, 0, destX, destY,
                srcX, srcY, areaW, areaH, linearizeSrgbImages);
    }
Copy a part of an image to a texture 2d.
@param dest The destination image, where the source will be copied
@param src The source image that contains the data to copy
@param destX First pixel of the destination image from where the src image will be drawn (x component)
@param destY First pixel of the destination image from where the src image will be drawn (y component)
@param srcX  First pixel to copy (x component)
@param srcY  First pixel to copy (y component)
@param areaW Width of the area to copy
@param areaH Height of the area to copy
jme3-core/src/main/java/com/jme3/renderer/opengl/GLRenderer.java