public class ARGBType extends AbstractNativeType<ARGBType> implements NumericType<ARGBType>
native
NumericType
that encodes four channels at
unsigned byte precision into one 32bit signed integer which is the format
used in most display oriented image processing libraries such as AWT or
ImageJ. ARGBType
implements NumericType
as element-wise
vector algebra.Modifier and Type | Field and Description |
---|---|
protected IntAccess |
dataAccess |
protected NativeImg<?,? extends IntAccess> |
img |
i
Constructor and Description |
---|
ARGBType() |
ARGBType(int value) |
ARGBType(IntAccess access) |
ARGBType(NativeImg<?,? extends IntAccess> intStorage) |
Modifier and Type | Method and Description |
---|---|
void |
add(ARGBType c) |
static int |
alpha(int value) |
static int |
blue(int value) |
ARGBType |
copy()
|
ARGBType |
createVariable()
Creates a new
Type variable which can only store one value. |
void |
div(ARGBType c) |
ARGBType |
duplicateTypeOnSameNativeImg()
Creates a new
NativeType which stores in the same physical array. |
boolean |
equals(Object obj) |
int |
get() |
Fraction |
getEntitiesPerPixel()
Get the number of entities in the storage array required to store one
pixel value.
|
NativeTypeFactory<ARGBType,IntAccess> |
getNativeTypeFactory() |
static int |
green(int value) |
int |
hashCode() |
void |
mul(ARGBType c) |
void |
mul(double c) |
void |
mul(float c) |
void |
pow(ARGBType c) |
void |
pow(double power) |
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(ARGBType c)
Sets the value of another
Type . |
void |
set(int f) |
void |
setOne() |
void |
setZero() |
void |
sub(ARGBType c) |
String |
toString() |
void |
updateContainer(Object c)
This method is used by an accessor (e.g., a
Cursor ) to request an
update of the current data array. |
boolean |
valueEquals(ARGBType t) |
index
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
decIndex, decIndex, getIndex, incIndex, incIndex, updateIndex
protected IntAccess dataAccess
public ARGBType(int value)
public ARGBType(IntAccess access)
public ARGBType()
public void updateContainer(Object c)
NativeType
Cursor
) to request an
update of the current data array.
As an example consider a CellCursor
moving on a CellImg
.
The cursor maintains a NativeType
which provides access to the
image data. When the cursor moves from one cell to the next, the
underlying data array of the NativeType
must be switched to the
data array of the new cell.
To achieve this, the CellCursor
calls updateContainer()
with itself as the argument. updateContainer()
in turn will call
NativeImg.update(Object)
on it's container, passing along the
reference to the cursor. In this example, the container would be a
CellImg
. While the NativeType
does not know about the
type of the cursor, the container does. CellImg
knows that it is
passed a CellCursor
instance, which can be used to figure out the
current cell and the underlying data array, which is then returned to the
NativeType
.
The idea behind this concept is maybe not obvious. The NativeType
knows which basic type is used (float, int, byte, ...). However, it does
not know how the data is stored (ArrayImg
, CellImg
, ...).
This prevents the need for multiple implementations of NativeType
.
updateContainer
in interface NativeType<ARGBType>
c
- reference to an accessor which can be passed on to the
container (which will know what to do with it).public ARGBType duplicateTypeOnSameNativeImg()
NativeType
NativeType
which stores in the same physical array.
This is only used internally.duplicateTypeOnSameNativeImg
in interface NativeType<ARGBType>
NativeType
instance working on the same
NativeImg
public NativeTypeFactory<ARGBType,IntAccess> getNativeTypeFactory()
getNativeTypeFactory
in interface NativeType<ARGBType>
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 MulFloatingPoint
public void mul(double c)
mul
in interface MulFloatingPoint
public void pow(double power)
pow
in interface PowFloatingPoint
public void set(ARGBType c)
Type
Type
.public ARGBType createVariable()
Type
Type
variable which can only store one value.createVariable
in interface Type<ARGBType>
Type
variablepublic String toString()
toString
in class AbstractNativeType<ARGBType>
public Fraction getEntitiesPerPixel()
NativeType
getEntitiesPerPixel
in interface NativeType<ARGBType>
public boolean valueEquals(ARGBType t)
valueEquals
in interface ValueEquals<ARGBType>
Copyright © 2015–2022 ImgLib2. All rights reserved.