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 Type
    Method
    Description
    fr.opensagres.xdocreport.template.formatter.NullImageBehaviour
    Returns the behaviour to use when the stream of the image is null.
    getHeight(Float defaultHeight)
    Returns the height image with pixel unit.
    fr.opensagres.xdocreport.core.document.ImageFormat
    Returns the image format.
    getWidth(Float defaultWidth)
    Returns the width image with pixel unit.
    boolean
    Returns true if call of setWidth(Float) must compute image height with ratio or if call of setHeight(Float) must compute image with with ratio and false otherwise.
    boolean
    Returns true if image size comes from the image and false otherwise.
    boolean
    Returns true if the image provider is valid (ex : input stream not null) and false otherwise.
    void
    setBehaviour(fr.opensagres.xdocreport.template.formatter.NullImageBehaviour behaviour)
    Set the behaviour to use when the stream of the image is null.
    void
    setHeight(Float height)
    Set the height image with pixel unit.
    void
    setResize(boolean resize)
    Set true if call of setWidth(Float) must compute image height with ratio or if call of setHeight(Float) must compute image with with ratio and false otherwise.
    void
    setSize(Float width, Float height)
    Set the width and height image with pixel unit.
    void
    setUseImageSize(boolean useImageSize)
    Set true if image size comes from the image and false otherwise.
    void
    setWidth(Float width)
    Set the width image with pixel unit.
    void
    write(OutputStream outputStream)
    Write the binary data of the image in the given output stream.
  • Method Details

    • write

      void write(OutputStream outputStream) throws IOException
      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

      Float getWidth(Float defaultWidth) throws IOException
      Returns the width image with pixel unit.
      Parameters:
      defaultWidth - as pixel
      Returns:
      Throws:
      IOException
    • setWidth

      void setWidth(Float width)
      Set the width image with pixel unit.
      Parameters:
      width -
    • getHeight

      Float getHeight(Float defaultHeight) throws IOException
      Returns the height image with pixel unit.
      Parameters:
      defaultHeight - as pixel
      Returns:
      Throws:
      IOException
    • setHeight

      void setHeight(Float height)
      Set the height image with pixel unit.
      Parameters:
      height -
    • setSize

      void setSize(Float width, Float height)
      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 of setWidth(Float) must compute image height with ratio or if call of setHeight(Float) must compute image with with ratio and false otherwise.
      Parameters:
      resize -
    • isResize

      boolean isResize()
      Returns true if call of setWidth(Float) must compute image height with ratio or if call of setHeight(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: