Class jpeg_error_mgr
Contains simple error-reporting and trace-message routines.
Inheritance
Inherited Members
Namespace: BitMiracle.LibJpeg.Classic
Assembly: BitMiracle.LibJpeg.NET.dll
Syntax
public class jpeg_error_mgr
Remarks
This class is used by both the compression and decompression code.
Constructors
| Improve this Doc View Sourcejpeg_error_mgr()
Initializes a new instance of the jpeg_error_mgr class.
Declaration
public jpeg_error_mgr()
Properties
| Improve this Doc View SourceNum_warnings
Gets the number of corrupt-data warnings.
Declaration
public int Num_warnings { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The num_warnings. |
Remarks
For recoverable corrupt-data errors, we emit a warning message, but keep going
unless emit_message(Int32) chooses to abort.
emit_message
should count warnings in Num_warnings
. The surrounding application
can check for bad data by seeing if Num_warnings
is nonzero at the end of processing.
Trace_level
Gets or sets the maximum message level that will be displayed.
Declaration
public int Trace_level { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | Values are:
-1: recoverable corrupt-data warning, may want to abort. |
See Also
Methods
| Improve this Doc View Sourceemit_message(Int32)
Conditionally emit a trace or warning message.
Declaration
public virtual void emit_message(int msg_level)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | msg_level | The message severity level. |
Remarks
The main reason for overriding this method would be to abort on warnings.
This method calls output_message() for message showing.
An application might override this method if it wanted to abort on warnings or change the policy about which messages to display.
See Also
| Improve this Doc View Sourceerror_exit()
Receives control for a fatal error.
Declaration
public virtual void error_exit()
Remarks
This method calls output_message() and then throws an exception.
See Also
| Improve this Doc View Sourceformat_message()
Constructs a readable error message string.
Declaration
public virtual string format_message()
Returns
Type | Description |
---|---|
System.String | The formatted message |
Remarks
This method is called by output_message(). Few applications should need to override this method. One possible reason for doing so is to implement dynamic switching of error message language.
See Also
| Improve this Doc View SourceGetMessageText(Int32)
Gets the actual message texts.
Declaration
protected virtual string GetMessageText(int code)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | code | The message code. See J_MESSAGE_CODE for details. |
Returns
Type | Description |
---|---|
System.String | The message text associated with |
Remarks
It may be useful for an application to add its own message texts that are handled
by the same mechanism. You can override GetMessageText
for this purpose. If you number
the addon messages beginning at 1000 or so, you won't have to worry about conflicts
with the library's built-in messages.
See Also
| Improve this Doc View Sourceoutput_message()
Actual output of any JPEG message.
Declaration
public virtual void output_message()
Remarks
Override this to send messages somewhere other than Console. Note that this method does not know how to generate a message, only where to send it. For extending a generation of messages see format_message().
See Also
| Improve this Doc View Sourcereset_error_mgr()
Resets error manager to initial state.
Declaration
public virtual void reset_error_mgr()
Remarks
This is called during compression startup to reset trace/error processing to default state. An application might possibly want to override this method if it has additional error processing state.