2010-02-03 2 views

ответ

1

Не уверен JAI, но вот BufferedImage подхода, который вы могли бы использовать в качестве входа для JAI. Так что, может быть, это работает для USECASE

public static BufferedImage[] divide(BufferedImage source) { 
    // for odd widths or heights, the last row or column will be ignored 
    // fixing this behaviour is left as an exercise to the eager 
    int height = source.getHeight()/2; 
    int width = source.getWidth()/2; 

    return new BufferedImage[] { 
    source.getSubimage(0, 0, height, width), // top left 
    source.getSubimage(width, 0, height, width), // top right 
    source.getSubimage(0, height, height, width), // bottom left 
    source.getSubimage(width, height, width, height) // bottom right 
    }; 
} 
1

Там интересный бит сверхнатурализма в компании Sun Java2D* демо с помощью четырех unequal parts.

* См. Нижний правый квадрат вкладки Images.

+0

+1 для заставить меня задаться вопросом о том, что означает сверхнатурализма ;-) – stacker

1

В примере ширина должна быть первой, чем высота. То есть:

source.getSubimage(0, 0,width, height), // top left 
source.getSubimage(width, 0, width, height), // top right 
source.getSubimage(0, height, width, height), // bottom left 
Смежные вопросы