class ImageDownscaleStage extends PronghornStage {

    @Override
    public void run() {

        while (outputsHaveRoom() && PipeReader.tryReadFragment(input)) {
            int msgIdx = PipeReader.getMsgIdx(input);
            if (msgIdx == ImageSchema.MSG_FRAMECHUNK_2) {
                processChunk();
            } else if (msgIdx == ImageSchema.MSG_FRAMESTART_1) {
                processFrameStart();
            }
            PipeReader.releaseReadLock(input);
        }
    }

    public  ImageDownscaleStage(GraphManager graphManager, Pipe<ImageSchema> input, Pipe<ImageSchema>[] outputs, int outputWidth, int outputHeight);

}