Sha256: bcc9d9942b2b3a49d35632ce73c6e4c9f66e305325cf2c0c772135ebd676774f

Contents?: true

Size: 809 Bytes

Versions: 6

Compression:

Stored size: 809 Bytes

Contents

package org.sunflow.core.bucket;

import org.sunflow.core.BucketOrder;

public class InvertedBucketOrder implements BucketOrder {

    private BucketOrder order;

    public InvertedBucketOrder(BucketOrder order) {
        this.order = order;
    }

    @Override
    public int[] getBucketSequence(int nbw, int nbh) {
        int[] coords = order.getBucketSequence(nbw, nbh);
        for (int i = 0; i < coords.length / 2; i += 2) {
            int src = i;
            int dst = coords.length - 2 - i;
            int tmp = coords[src + 0];
            coords[src + 0] = coords[dst + 0];
            coords[dst + 0] = tmp;
            tmp = coords[src + 1];
            coords[src + 1] = coords[dst + 1];
            coords[dst + 1] = tmp;
        }
        return coords;
    }
}

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
joonsrenderer-1.3.1-java src/main/java/org/sunflow/core/bucket/InvertedBucketOrder.java
joonsrenderer-1.2.0-java src/main/java/org/sunflow/core/bucket/InvertedBucketOrder.java
joonsrenderer-1.1.3-java src/main/java/org/sunflow/core/bucket/InvertedBucketOrder.java
joonsrenderer-1.1.2-java src/main/java/org/sunflow/core/bucket/InvertedBucketOrder.java
joonsrenderer-1.1.1-java src/main/java/org/sunflow/core/bucket/InvertedBucketOrder.java
joonsrenderer-1.1-java src/main/java/org/sunflow/core/bucket/InvertedBucketOrder.java