Package adams.data.io.output
Class OpenCVImageWriter
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.io.output.AbstractImageWriter<OpenCVImageContainer>
-
- adams.data.io.output.OpenCVImageWriter
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,FileFormatHandler,LoggingLevelHandler,LoggingSupporter,OptionHandler,SizeOfHandler,ImageWriter<OpenCVImageContainer>,Serializable
public class OpenCVImageWriter extends AbstractImageWriter<OpenCVImageContainer>
Writes images using OpenCV. Writing can be influenced via the write flags and their corresponding values.
For more information see:
https://docs.opencv.org/4.6.0/d8/d6a/group__imgcodecs__flags.html#ga292d81be8d76901bff7988d18d2b42ac
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-flag <IMWRITE_JPEG_QUALITY|IMWRITE_JPEG_PROGRESSIVE|IMWRITE_JPEG_OPTIMIZE|IMWRITE_JPEG_RST_INTERVAL|IMWRITE_JPEG_LUMA_QUALITY|IMWRITE_JPEG_CHROMA_QUALITY|IMWRITE_PNG_COMPRESSION|IMWRITE_PNG_STRATEGY|IMWRITE_PNG_BILEVEL|IMWRITE_PXM_BINARY|IMWRITE_EXR_TYPE|IMWRITE_EXR_COMPRESSION|IMWRITE_WEBP_QUALITY|IMWRITE_PAM_TUPLETYPE|IMWRITE_TIFF_RESUNIT|IMWRITE_TIFF_XDPI|IMWRITE_TIFF_YDPI|IMWRITE_TIFF_COMPRESSION|IMWRITE_JPEG2000_COMPRESSION_X1000> [-flag ...] (property: flags) The flags influencing the writing. default:
-value <adams.core.base.BaseInteger> [-value ...] (property: values) The values corresponding with the flags. default:
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected ImwriteFlag[]m_Flagsthe write flags.protected BaseInteger[]m_Valuesthe flag values.-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description OpenCVImageWriter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddefineOptions()Adds options to the internal list of options.protected StringdoWrite(PlaceholderFile file, OpenCVImageContainer cont)Performs the actual writing of the image file.StringflagsTipText()Returns the tip text for this property.ImageReadergetCorrespondingReader()Returns, if available, the corresponding reader.ImwriteFlag[]getFlags()Returns the write flags.StringgetFormatDescription()Returns a string describing the format (used in the file chooser).String[]getFormatExtensions()Returns the extension(s) of the format.BaseInteger[]getValues()Returns the values corresponding with the flags.StringglobalInfo()Returns a string describing the object.voidsetFlags(ImwriteFlag[] value)Sets the write flags.voidsetValues(BaseInteger[] value)Sets the values corresponding with the flags.StringvaluesTipText()Returns the tip text for this property.-
Methods inherited from class adams.data.io.output.AbstractImageWriter
check, getDefaultFormatExtension, getWriters, isAvailable, write
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.Destroyable
destroy
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager, toCommandLine
-
-
-
-
Field Detail
-
m_Flags
protected ImwriteFlag[] m_Flags
the write flags.
-
m_Values
protected BaseInteger[] m_Values
the flag values.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractOptionHandler
-
setFlags
public void setFlags(ImwriteFlag[] value)
Sets the write flags.- Parameters:
value- the flags
-
getFlags
public ImwriteFlag[] getFlags()
Returns the write flags.- Returns:
- the flags
-
flagsTipText
public String flagsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
setValues
public void setValues(BaseInteger[] value)
Sets the values corresponding with the flags.- Parameters:
value- the values
-
getValues
public BaseInteger[] getValues()
Returns the values corresponding with the flags.- Returns:
- the values
-
valuesTipText
public String valuesTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
getFormatDescription
public String getFormatDescription()
Returns a string describing the format (used in the file chooser).- Specified by:
getFormatDescriptionin interfaceFileFormatHandler- Specified by:
getFormatDescriptionin classAbstractImageWriter<OpenCVImageContainer>- Returns:
- a description suitable for displaying in the file chooser
-
getFormatExtensions
public String[] getFormatExtensions()
Returns the extension(s) of the format.- Specified by:
getFormatExtensionsin interfaceFileFormatHandler- Specified by:
getFormatExtensionsin classAbstractImageWriter<OpenCVImageContainer>- Returns:
- the extension (without the dot!)
-
getCorrespondingReader
public ImageReader getCorrespondingReader()
Returns, if available, the corresponding reader.- Specified by:
getCorrespondingReaderin interfaceImageWriter<OpenCVImageContainer>- Specified by:
getCorrespondingReaderin classAbstractImageWriter<OpenCVImageContainer>- Returns:
- the reader, null if none available
-
doWrite
protected String doWrite(PlaceholderFile file, OpenCVImageContainer cont)
Performs the actual writing of the image file.- Specified by:
doWritein classAbstractImageWriter<OpenCVImageContainer>- Parameters:
file- the file to write tocont- the image container to write- Returns:
- null if successfully written, otherwise error message
-
-