Package net.imglib2.img
Class ImgFactory<T>
- java.lang.Object
-
- net.imglib2.img.ImgFactory<T>
-
- Direct Known Subclasses:
ListImgFactory,NativeImgFactory
public abstract class ImgFactory<T> extends java.lang.ObjectTODO
-
-
Constructor Summary
Constructors Constructor Description ImgFactory()Deprecated.ImgFactory(T type)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidcache(T type)Deprecated.Img<T>create(int[] dimensions)Create anImg<T>with the specifieddimensions.Img<T>create(int[] dim, T type)Deprecated.abstract Img<T>create(long... dimensions)Create anImg<T>with the specifieddimensions.abstract Img<T>create(long[] dim, T type)Deprecated.Img<T>create(java.util.function.Supplier<T> typeSupplier, int[] dim)Deprecated.Img<T>create(java.util.function.Supplier<T> typeSupplier, long... dim)Deprecated.Img<T>create(java.util.function.Supplier<T> typeSupplier, Dimensions dim)Deprecated.Img<T>create(Dimensions dimensions)Create anImg<T>with the specifieddimensions.Img<T>create(Dimensions dim, T type)Deprecated.<S> ImgFactory<S>imgFactory(java.util.function.Supplier<S> typeSupplier)Creates the sameImgFactoryfor a different generic parameter if possible.abstract <S> ImgFactory<S>imgFactory(S type)Creates the sameImgFactoryfor a different generic parameter if possible.Ttype()
-
-
-
Field Detail
-
type
private T type
-
-
Constructor Detail
-
ImgFactory
public ImgFactory(T type)
-
ImgFactory
@Deprecated public ImgFactory()
Deprecated.
-
-
Method Detail
-
type
public T type()
-
create
public abstract Img<T> create(long... dimensions)
Create anImg<T>with the specifieddimensions.- Returns:
- new image with the specified
dimensions.
-
create
public Img<T> create(Dimensions dimensions)
Create anImg<T>with the specifieddimensions.- Returns:
- new image with the specified
dimensions.
-
create
public Img<T> create(int[] dimensions)
Create anImg<T>with the specifieddimensions.Note: This is not a vararg function because the underlying
int[]based methods already copies theint[]dimensions into a disposablelong[]anyways. This would be an unnecessary copy forint...varargs.- Returns:
- new image with the specified
dimensions.
-
imgFactory
public abstract <S> ImgFactory<S> imgFactory(S type) throws IncompatibleTypeException
Creates the sameImgFactoryfor a different generic parameter if possible. If the type "S" does not suit the needs of theImgFactory(for example implementNativeTypein allNativeImgFactory, this method will throw anIncompatibleTypeException.- Type Parameters:
S- the new type- Parameters:
type- an instance of S- Returns:
ImgFactoryof type S- Throws:
IncompatibleTypeException- if type S is not compatible
-
imgFactory
public <S> ImgFactory<S> imgFactory(java.util.function.Supplier<S> typeSupplier) throws IncompatibleTypeException
Creates the sameImgFactoryfor a different generic parameter if possible. If the supplied type "S" does not suit the needs of theImgFactory(for example implementNativeTypein allNativeImgFactory, this method will throw anIncompatibleTypeException.- Type Parameters:
S- the new type- Parameters:
typeSupplier- a supplier of S- Returns:
ImgFactoryof type S- Throws:
IncompatibleTypeException- if type S is not compatible
-
create
@Deprecated public Img<T> create(Dimensions dim, T type)
Deprecated.
-
create
@Deprecated public Img<T> create(java.util.function.Supplier<T> typeSupplier, long... dim)
Deprecated.
-
create
@Deprecated public Img<T> create(java.util.function.Supplier<T> typeSupplier, Dimensions dim)
Deprecated.
-
create
@Deprecated public Img<T> create(java.util.function.Supplier<T> typeSupplier, int[] dim)
Deprecated.
-
cache
@Deprecated protected void cache(T type)
Deprecated.If the cached type instance was previously null, the giventypebecomes the cached instance. In this way, if the factory was created using one of the deprecated typeless constructor signatures, but then one of the deprecatedcreatemethods is called (i.e.: a method which provides a type instance as an argument), the provided type becomes the cached type instance so that subsequent invocations of the typelesscreatemethods will work as desired.- Parameters:
type- The type to cache if needed.
-
-