-
Notifications
You must be signed in to change notification settings - Fork 0
Pixel
A class that encapsulates all the data associated to a pixel.
What a pixel stores is the intensity value for each color channel and the alpha.
This class only stores 4 doubles, the red, green, blue and alpha channel intensities. These values are accesible only through getter and setter methods.
Of note inside this class are:
- the
limit(double)method which basically trims down each value bigger than 255 to 255, and every negative value to 0 - the
clip()method, which callslimit()on each channel intensity value
In order to simulate operator overloading, the following methods have been implemented:
-
multiply(Pixel)which multiplies the red channel ofthispixel with the red channel of the given pixel, and so on, for all channels -
multiply(int),multiply(double),multiply(float)which multiplies all channels with the given value -
divide(Pixel)which divides the red channel ofthispixel with the red channel of the given pixel, and so on, for all channels -
divide(int),divide(double),divide(float)which divides all channels with the given value -
add(Pixel)which adds the red channel ofthispixel with the red channel of the given pixel, and so on, for all channels -
add(int),add(double),add(float)which adds the given value to all channels -
subtract(Pixel)which subtracts from the red channel ofthispixel with the red channel of the given pixel, and so on, for all channels -
subtract(int),subtract(double),subtract(float)which divides all channels with the given value -
log()which applies theMath.log()function on each channel -
pow(double)which applies theMath.pow()on all channels, the channel value being the base, and the given value is the exponent -
and(Pixel)which performs a bitwise AND between the 2 pixels -
or(Pixel)which performs a bitwise OR between the 2 pixels -
xor(Pixel)which performs a bitwise XOR between the 2 pixels
-
Classes documentation
- 'App'
- 'objects.GenericJob'
- 'objects.filters.GenericFilter`
- 'objects.filters.IFilter`
- 'objects.filters.Filters`
- 'objects.image.BitmapImage'
- 'objects.image.Image'
- 'objects.image.Pixel'
- 'objects.runnables.Producer'
- 'objects.runnables.Consumer'
- 'objects.singletons.ArgParser'
- 'objects.singletons.BmpIO'
- 'objects.singletons.FilterBuilder'
- 'objects.singletons.Prompter'
- 'objects.singletons.Timer'
-
Overview of the homework requirements