Interface IImageProvider
- All Known Implementing Classes:
AbstractImageProvider,AbstractInputStreamImageProvider,ByteArrayImageProvider,ClassPathImageProvider,FileImageProvider,JSONImage
public interface IImageProvider
Image provider is used as "context" to manage dynamic images in the document source (odt, docx...).
-
Method Summary
Modifier and TypeMethodDescriptionfr.opensagres.xdocreport.template.formatter.NullImageBehaviourReturns the behaviour to use when the stream of the image is null.Returns the height image with pixel unit.fr.opensagres.xdocreport.core.document.ImageFormatReturns the image format.Returns the width image with pixel unit.booleanisResize()Returns true if call ofsetWidth(Float)must compute image height with ratio or if call ofsetHeight(Float)must compute image with with ratio and false otherwise.booleanReturns true if image size comes from the image and false otherwise.booleanisValid()Returns true if the image provider is valid (ex : input stream not null) and false otherwise.voidsetBehaviour(fr.opensagres.xdocreport.template.formatter.NullImageBehaviour behaviour) Set the behaviour to use when the stream of the image is null.voidSet the height image with pixel unit.voidsetResize(boolean resize) Set true if call ofsetWidth(Float)must compute image height with ratio or if call ofsetHeight(Float)must compute image with with ratio and false otherwise.voidSet the width and height image with pixel unit.voidsetUseImageSize(boolean useImageSize) Set true if image size comes from the image and false otherwise.voidSet the width image with pixel unit.voidwrite(OutputStream outputStream) Write the binary data of the image in the given output stream.
-
Method Details
-
write
Write the binary data of the image in the given output stream.- Parameters:
outputStream-- Throws:
IOException
-
getImageFormat
fr.opensagres.xdocreport.core.document.ImageFormat getImageFormat()Returns the image format.- Returns:
-
getWidth
Returns the width image with pixel unit.- Parameters:
defaultWidth- as pixel- Returns:
- Throws:
IOException
-
setWidth
Set the width image with pixel unit.- Parameters:
width-
-
getHeight
Returns the height image with pixel unit.- Parameters:
defaultHeight- as pixel- Returns:
- Throws:
IOException
-
setHeight
Set the height image with pixel unit.- Parameters:
height-
-
setSize
Set the width and height image with pixel unit.- Parameters:
width-height-
-
isUseImageSize
boolean isUseImageSize()Returns true if image size comes from the image and false otherwise.- Returns:
-
setUseImageSize
void setUseImageSize(boolean useImageSize) Set true if image size comes from the image and false otherwise.- Parameters:
useImageSize-
-
setResize
void setResize(boolean resize) Set true if call ofsetWidth(Float)must compute image height with ratio or if call ofsetHeight(Float)must compute image with with ratio and false otherwise.- Parameters:
resize-
-
isResize
boolean isResize()Returns true if call ofsetWidth(Float)must compute image height with ratio or if call ofsetHeight(Float)must compute image with with ratio and false otherwise.- Returns:
-
getBehaviour
fr.opensagres.xdocreport.template.formatter.NullImageBehaviour getBehaviour()Returns the behaviour to use when the stream of the image is null.- Returns:
-
setBehaviour
void setBehaviour(fr.opensagres.xdocreport.template.formatter.NullImageBehaviour behaviour) Set the behaviour to use when the stream of the image is null.- Parameters:
behaviour-
-
isValid
boolean isValid()Returns true if the image provider is valid (ex : input stream not null) and false otherwise.- Returns:
-