-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPixel.java
More file actions
54 lines (42 loc) · 1.18 KB
/
Copy pathPixel.java
File metadata and controls
54 lines (42 loc) · 1.18 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package com.company;
import java.awt.*;
/**
* Created by sky on 5/21/15.
* Represents a pixel in an image
*/
public class Pixel {
/* Is this pixel empty? */
public boolean isEmpty;
/* Is this pixel stored in the queue? */
public boolean inQueue;
public byte nonEmptyNeigh = 0;
public int block;
public Color avg;
// Color of this pixel
public Color color;
// Index of this pixel in queue
// TODO
public int queueIndex;
// Precalculated array of neighbor pixels
public Pixel[] neighbors;
// Unique weight used for tiebreaking comparisons
public int weight;
public int xPos;
public int yPos;
public Pixel(boolean isEmpty, boolean inQueue,
int weight, int queueIndex,
int x, int y) {
this.isEmpty = isEmpty;
this.inQueue = inQueue;
this.weight = weight;
this.queueIndex = queueIndex;
this.xPos = x;
this.yPos = y;
}
public Pixel(boolean isEmpty, boolean inQueue, int weight, int queueIndex) {
this.isEmpty = isEmpty;
this.inQueue = inQueue;
this.weight = weight;
this.queueIndex = queueIndex;
}
}