summary refs log tree commit diff stats
path: root/src/com/fourisland/fourpuzzle/util/TransparentPixelFilter.java
blob: ed1c49ce3af5a2412a58e820e54ffbb6af69359a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.fourisland.fourpuzzle.util;

import java.awt.image.RGBImageFilter;

/**
 *
 * @author hatkirby
 */
public class TransparentPixelFilter extends RGBImageFilter {

    private int trans;
    public TransparentPixelFilter(int i)
    {
        trans = i;
        
        canFilterIndexColorModel = true;
    }

    @Override
    public int filterRGB(int x, int y, int rgb)
    {
        if (rgb == trans)
        {
            return 0;
        } else {
            return rgb;
        }
    }

}