view Framework/Scene2D/ICompositor.h @ 1327:4f8db2d202c8 broker

OrthancSeriesProgressiveLoader now has two modes that can be selected at object creation : - progressive (will first load jpeg50, then jpeg90 then PAM) - non-progressive (will directly load PAM (uncompressed)) Please note that the slice loading order remains dynamic and depending upon the slice that the client code wishes to extract from the volume.
author Benjamin Golinvaux <bgo@osimis.io>
date Wed, 25 Mar 2020 14:34:27 +0100
parents 9efa66d8d3f8
children 828a9b4ee1b7
line wrap: on
line source

#pragma once

#include "Scene2D.h"
#include "ScenePoint2D.h"

#include <EmbeddedResources.h>

namespace OrthancStone
{
  class ICompositor : public boost::noncopyable
  {
  public:
    virtual ~ICompositor() 
    {
    }

    virtual unsigned int GetCanvasWidth() const = 0;

    virtual unsigned int GetCanvasHeight() const = 0;

    /**
     * WARNING: "Refresh()" must always be called with the same
     * scene. If the scene changes, a call to "ResetScene()" must be
     * done to reset the tracking of the revisions of the layers.
     **/
    virtual void Refresh(const Scene2D& scene) = 0;

    virtual void ResetScene() = 0;

#if ORTHANC_ENABLE_LOCALE == 1
    virtual void SetFont(size_t index,
                         Orthanc::EmbeddedResources::FileResourceId resource,
                         unsigned int fontSize,
                         Orthanc::Encoding codepage) = 0;
#endif

    // Get the center of the given pixel, in canvas coordinates
    ScenePoint2D GetPixelCenterCoordinates(int x, int y) const
    {
      return ScenePoint2D(
        static_cast<double>(x) + 0.5 - static_cast<double>(GetCanvasWidth()) / 2.0,
        static_cast<double>(y) + 0.5 - static_cast<double>(GetCanvasHeight()) / 2.0);
    }

    void FitContent(Scene2D& scene) const
    {
      scene.FitContent(GetCanvasWidth(), GetCanvasHeight());
    }
  };
}