C++ API Library Reference  4.3.2-74-ge1d4cca
Public Functions | List of all members
EncoderFormat Class Reference

The EncoderFormat class specifies service-side image encoder format parameters. By default, these parameters are the image mime type and quality. However, the methods in this class also allow you to specify any other custom parameter that you want to include with the image that is streamed to the client-side view. Custom parameters could be used, for example, to display image metadata.

The EncoderFormat class is only needed if you choose to overwrite the default encoding configuration; this is rare as PureWeb provides relevant defaults to optimize for performance.

Public Functions

String const & MimeType () const
 
void MimeType (String const &mimeType)
 
bool operator== (const EncoderFormat &other) const
 
Collections::IEnumerable< KeyValuePair< CSI::String, CSI::String > > const & Parameters () const
 
int const & Quality () const
 
void SetParameter (String const &key, String const &value)
 
void SetQuality (int const &value)
 
bool TryGetParameter (String const &key, String &value)
 
Constructors and Destructors
 EncoderFormat ()
 
 EncoderFormat (String const &mimeType)
 
 EncoderFormat (String const &mimeType, int const &quality)
 
 ~EncoderFormat ()
 

Usage Description

String const& MimeType ( ) const
inline

Returns the mime type currently set in the EncoderFormat object.

void MimeType ( String const &  mimeType)
inline

Sets a mime type value for the image. See SupportedEncoderMimeTypes.

bool operator== ( const EncoderFormat other) const
inline

Compares the given EncoderFormat object with that currently set in the service. Returns true if the objects match.

Collections::IEnumerable<KeyValuePair<CSI::String, CSI::String> > const& Parameters ( ) const
inline

Returns the list of custom parameters currently set in the object, if any.

int const& Quality ( ) const
inline

Returns the image encoding quality currently set in the EncoderFormat object.

void SetParameter ( String const &  key,
String const &  value 
)
inline

Adds a custom parameter to the EncoderFormat object, expressed as a key-value pair. You could use this method, for example, to send metadata along with the image.

void SetQuality ( int const &  value)
inline

Sets an image encoding quality for the EncoderFormat object. Quality is an integer between 0 and 100 that defines the fidelity (overall clarity and number of visual artifacts) of the images to be generated by the service.

bool TryGetParameter ( String const &  key,
String value 
)
inline

Checks whether the given parameter exists. If it does, returns true and assigns the value to the parameter.