public final class RGBALegacyType extends TypeImpl<RGBALegacyType> implements NumericType<RGBALegacyType>
Constructor and Description |
---|
RGBALegacyType() |
RGBALegacyType(DirectAccessContainer<RGBALegacyType,? extends IntAccess> byteStorage) |
RGBALegacyType(int value) |
Modifier and Type | Method and Description |
---|---|
void |
add(RGBALegacyType c) |
static int |
alpha(int value) |
static int |
blue(int value) |
RGBALegacyType |
copy()
|
RGBALegacyType[] |
createArray1D(int size1)
Creates a 1d array of the generic
Type |
RGBALegacyType[][] |
createArray2D(int size1,
int size2)
Creates a 2d array of the generic
Type |
RGBALegacyType[][][] |
createArray3D(int size1,
int size2,
int size3)
Creates a 3d array of the generic
Type |
DirectAccessContainer<RGBALegacyType,? extends IntAccess> |
createSuitableDirectAccessContainer(DirectAccessContainerFactory storageFactory,
int[] dim)
The
Type creates the DirectAccessContainer used for storing image data; based on the given storage strategy and its size. |
RGBALegacyType |
createVariable()
Creates a new
Type which can only store one value. |
void |
div(RGBALegacyType c) |
RGBALegacyType |
duplicateTypeOnSameDirectAccessContainer()
Creates a new
Type which stores in the same physical array. |
int |
get() |
RGBALegacyTypeDisplay |
getDefaultDisplay(Image<RGBALegacyType> image)
|
int |
getEntitiesPerPixel() |
static int |
green(int value) |
void |
mul(double c) |
void |
mul(float c) |
void |
mul(RGBALegacyType c) |
static int |
red(int value) |
static int |
rgba(double r,
double g,
double b,
double a) |
static int |
rgba(float r,
float g,
float b,
float a) |
static int |
rgba(int r,
int g,
int b,
int a) |
void |
set(int f) |
void |
set(RGBALegacyType c)
Sets the value of another
Type . |
void |
setOne() |
void |
setZero() |
void |
sub(RGBALegacyType c) |
String |
toString() |
void |
updateContainer(Cursor<?> c)
|
decIndex, decIndex, getIndex, incIndex, incIndex, updateIndex
public RGBALegacyType(DirectAccessContainer<RGBALegacyType,? extends IntAccess> byteStorage)
public RGBALegacyType(int value)
public RGBALegacyType()
public DirectAccessContainer<RGBALegacyType,? extends IntAccess> createSuitableDirectAccessContainer(DirectAccessContainerFactory storageFactory, int[] dim)
Type
Type
creates the DirectAccessContainer used for storing image data; based on the given storage strategy and its size. It
basically only decides here which BasicType it uses (float, int, byte, bit, ...) and how many entities per pixel it needs
(e.g. 2 floats per pixel for a complex number). This enables the separation of Image
and the basic types.createSuitableDirectAccessContainer
in interface Type<RGBALegacyType>
storageFactory
- - Which storage strategy is useddim
- - the dimensionsType
knowns the BasicType it contains.public void updateContainer(Cursor<?> c)
Type
Cursor
s to update the data current data array
of the Type
, for example when moving from one Cell
to the next.
If it is only an Array
the Cursor
s never have to call that function.
The idea behind this concept is maybe not obvious. The Type
knows which basic type
is used (float, int, byte, ...) but does not know how it is stored (Array
, CellDirectAccessContainer
, ...) to
prevent multiple implementations of Type
.
That's why Type
asks the DataAccess
to give the actual basic array by passing the Cursor
that calls the method. The DataAccess
is also an Array
, CellDirectAccessContainer
, ... which
can then communicate with the ArrayCursor
, CellCursor
, ... and return the current basic type array.
A typical implementation of this method looks like that (this is the FloatType
implementation):
float[] v = floatStorage.getCurrentStorageArray( c );updateContainer
in interface Type<RGBALegacyType>
c
- - the Cursor
gives a link to itself so that the Type
tell its DataAccess
to get the new basic type array.public RGBALegacyType duplicateTypeOnSameDirectAccessContainer()
Type
Type
which stores in the same physical array. This is only used internally.duplicateTypeOnSameDirectAccessContainer
in interface Type<RGBALegacyType>
Type
instance working on the same DirectAccessContainer
public RGBALegacyTypeDisplay getDefaultDisplay(Image<RGBALegacyType> image)
Type
Type
creates the default Display
for displaying the image contents. Only Type
can do this as in Image
the Type
is only a Generic. Later the user can create its own Display
s if wanted.
This could be basically a static function.getDefaultDisplay
in interface Type<RGBALegacyType>
image
- - the image to create the Display
forDisplay
public static final int rgba(int r, int g, int b, int a)
public static final int rgba(float r, float g, float b, float a)
public static final int rgba(double r, double g, double b, double a)
public static final int red(int value)
public static final int green(int value)
public static final int blue(int value)
public static final int alpha(int value)
public int get()
public void set(int f)
public void mul(float c)
mul
in interface NumericType<RGBALegacyType>
public void mul(double c)
mul
in interface NumericType<RGBALegacyType>
public void add(RGBALegacyType c)
add
in interface NumericType<RGBALegacyType>
public void div(RGBALegacyType c)
div
in interface NumericType<RGBALegacyType>
public void mul(RGBALegacyType c)
mul
in interface NumericType<RGBALegacyType>
public void sub(RGBALegacyType c)
sub
in interface NumericType<RGBALegacyType>
public void set(RGBALegacyType c)
Type
Type
.set
in interface Type<RGBALegacyType>
c
- - the new valuepublic void setOne()
setOne
in interface NumericType<RGBALegacyType>
public void setZero()
setZero
in interface NumericType<RGBALegacyType>
public RGBALegacyType[] createArray1D(int size1)
Type
Type
createArray1D
in interface Type<RGBALegacyType>
size1
- - the size of the arraypublic RGBALegacyType[][] createArray2D(int size1, int size2)
Type
Type
createArray2D
in interface Type<RGBALegacyType>
size1
- - the size of the arraysize2
- - the size of the arraypublic RGBALegacyType[][][] createArray3D(int size1, int size2, int size3)
Type
Type
createArray3D
in interface Type<RGBALegacyType>
size1
- - the size of the arraysize2
- - the size of the arraysize3
- - the size of the arraypublic RGBALegacyType createVariable()
Type
Type
which can only store one value.createVariable
in interface Type<RGBALegacyType>
Type
instancepublic RGBALegacyType copy()
Type
copy
in interface Type<RGBALegacyType>
copy
in class TypeImpl<RGBALegacyType>
Type
instancepublic String toString()
toString
in class TypeImpl<RGBALegacyType>
public int getEntitiesPerPixel()
getEntitiesPerPixel
in interface Type<RGBALegacyType>
Copyright © 2015–2021 Fiji. All rights reserved.