#include <ImageHandler.h>

Public Member Functions | |
| ImageHandler (QObject *pParent=NULL) | |
| ImageHandler (int port, QObject *pParent=NULL) | |
| ~ImageHandler () | |
Static Public Member Functions | |
| static bool | getSessionItemImage (SessionItem *pItem, QBuffer &buffer, const QString &format, int band, int *pBbox=NULL) |
Protected Member Functions | |
| MuHttpServer::Response | getRequest (const QString &uri, const QString &contentType, const QString &body, const FormValueMap &form) |
Definition at line 22 of file ImageHandler.h.
| ImageHandler::ImageHandler | ( | QObject * | pParent = NULL |
) |
| ImageHandler::ImageHandler | ( | int | port, | |
| QObject * | pParent = NULL | |||
| ) |
Construct a new ImageHandler.
| port | TCP port where the server should listen. If this is 0, a server will not be started. This is used to add the ImageHandler to an existing server using MuHttpServer::registerPath(). | |
| pParent | Qt parent object |
| ImageHandler::~ImageHandler | ( | ) |
Destructor.
| static bool ImageHandler::getSessionItemImage | ( | SessionItem * | pItem, | |
| QBuffer & | buffer, | |||
| const QString & | format, | |||
| int | band, | |||
| int * | pBbox = NULL | |||
| ) | [static] |
Retrieve an image for a SessionItem and place the result in a buffer.
| pItem | The SessionItem whose image is to be retrieved. Currently, this must be a: SpatialDataView or a Layer | |
| buffer | A sufficiently large buffer which will hold the resultant image. | |
| format | The format of the image data. This is anything which corresponds to a loaded Qt image format plugin. Common examples are: JPEG, PNG, TIFF, or BMP | |
| band | If pItem is a RasterLayer, change to this active band before grabbing the image. If pItem is not a RasterLayer or band is negative, this is ignored. | |
| pBbox | If this is not NULL, the bounding box as returned by SpatialDataView::getLayerImage() will be returned in this out param. |
| MuHttpServer::Response ImageHandler::getRequest | ( | const QString & | uri, | |
| const QString & | contentType, | |||
| const QString & | body, | |||
| const FormValueMap & | form | |||
| ) | [protected, virtual] |
This handles HTTP GET requests.
GET requests encode form data in the request URL using ? and &.
| uri | The URI of the request. If this object is handling sub requests via registerPath(), this will be a partial URI rooted at the path this object is registered to handle. | |
| contentType | The HTTP Content-type of the request. | |
| body | The body of the request. This is usually empty with GET requests. | |
| form | Form data encoded in the request URL. |
This method serves view and layer images. The request URL should be the SessionItem ID of the view or layer. The file extension represents the format of the image generated. Any image format supported by the current build of Qt is supported. This requires at least PNG support. If no extension is specified, PNG is assumed.
Implements MuHttpServer.