Pixel

public class Pixel

Representation of a single pixel signature caused by a single emitter.

Author:Marcel Stefko

Fields

x

public final int x

X-position of pixel in image.

y

public final int y

Y-position of pixel in image.

Constructors

Pixel

public Pixel(int x, int y, double signature)

Initialize new pixel with position and signature.

Parameters:
  • x – x-position [px]
  • y – y-position [px]
  • signature – relative brightness of this pixel due to emitter [-]

Methods

distance_to

public double distance_to(Pixel p)

Calculates euclidean distance to another pixel

Parameters:
  • p – another Pixel
Returns:

euclidean distance between these pixels [px]

distance_to_sq

public int distance_to_sq(Pixel p)

Calculates squared distance to another pixel

Parameters:
  • p – another Pixel
Returns:

squared distance between these pixels [px2]

getSignature

public double getSignature()

Returns this pixel’s signature

Returns:relative brightness of this pixel due to an emitter [-]

setSignature

public void setSignature(double signature)

Set’s the pixel’s signature.