Sha256: bd3875768372a835a3dd7e923ecf322a33b99e27765f08925bb346b3a635afe5

Contents?: true

Size: 689 Bytes

Versions: 6

Compression:

Stored size: 689 Bytes

Contents

package org.sunflow.image.formats;

import org.sunflow.image.Bitmap;
import org.sunflow.image.Color;

public class BitmapG8 extends Bitmap {

    private int w, h;
    private byte[] data;

    public BitmapG8(int w, int h, byte[] data) {
        this.w = w;
        this.h = h;
        this.data = data;
    }

    @Override
    public int getWidth() {
        return w;
    }

    @Override
    public int getHeight() {
        return h;
    }

    @Override
    public Color readColor(int x, int y) {
        return new Color((data[x + y * w] & 0xFF) * INV255);
    }

    @Override
    public float readAlpha(int x, int y) {
        return 1;
    }
}

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
joonsrenderer-1.3.1-java src/main/java/org/sunflow/image/formats/BitmapG8.java
joonsrenderer-1.2.0-java src/main/java/org/sunflow/image/formats/BitmapG8.java
joonsrenderer-1.1.3-java src/main/java/org/sunflow/image/formats/BitmapG8.java
joonsrenderer-1.1.2-java src/main/java/org/sunflow/image/formats/BitmapG8.java
joonsrenderer-1.1.1-java src/main/java/org/sunflow/image/formats/BitmapG8.java
joonsrenderer-1.1-java src/main/java/org/sunflow/image/formats/BitmapG8.java