Package: matlab.net.http.io
Superclasses: matlab.net.http.io.ContentConsumer
Consumer for image data in HTTP payloads
This consumer reads image data from the web and converts it to MATLAB® image data. It stores the result in the Body
property of
the ResponseMessage
to which it is applied. Specified directly as a consumer in
RequestMessage.send
, it provides the same functionality for image content
types that is provided by the default send
method when no consumer is
specified, saving the converted image, plus a possible colormap and alpha channel, in
Body.Data
, based on the Content-Type of the message. For more
information on conversion of image data in a response, see the description for
image/*
Content-Types in HTTP Data Type Conversion.
This consumer only accepts data for which it can determine a format based on headers in
the response message or the extension of the file name in the URI of the request (if any). You
can override this behavior by specifying the expected format in the
Format
property.
This consumer returns the data as a MATLAB image in one of the formats described for the return value of the imread
function. To store the original data in a file without converting it, use
a FileConsumer
.
The matlab.net.http.io.ImageConsumer
class is a handle
class.
consumer = ImageConsumer
constructs a consumer for HTTP
images.
consumer = ImageConsumer(
constructs an
fmt
)ImageConsumer
using the specified format.
consumer = ImageConsumer(___,
passes additional arguments used by arg1,...,argn
)imread
to convert the response
data.
ContentConsumer
| FileConsumer
| ImageProvider
| imfinfo
| imformats
| imread
| matlab.net.URI
| MessageBody
| RequestMessage
| ResponseMessage