Public Types |
| enum | Type {
UNKNOWN = -1,
GIF = 1,
JPEG = 2,
PNG = 3,
BMP = 4
} |
| enum | Error {
SUCCESS = 0,
INVALID_FILE = 1,
INVALID_FILE_NAME = 2,
INVALID_FILE_TYPE = 3,
BAD_HEADER = 4,
BAD_IMAGE = 5
} |
| | if the image is not valid these errors are saying why. More...
|
Public Methods |
| | ImageSize (std::string file_name) |
| bool | operator! () const |
| bool | is_valid () const |
| unsigned int | get_width () const |
| unsigned int | get_height () const |
| Type | get_type () const |
| | returns the type of the image. More...
|
| Error | get_error () const |
| | more detailed description why an error occured. More...
|
Private Methods |
| | ImageSize () |
| bool | get_image_type () |
| | detects the image type out of the file_name extension. More...
|
| bool | compare (std::string a, std::string b) |
| | uncasesesitiv string compare. More...
|
| bool | get_1_byte (unsigned int &byte) |
| bool | get_le_2_bytes (unsigned int &bytes) |
| | 2 bytes, littel endian. More...
|
| bool | get_be_2_bytes (unsigned int &bytes) |
| | 2 bytes, big endian. More...
|
| bool | get_le_4_bytes (unsigned int &bytes) |
| | 4 bytes, littel endian. More...
|
| bool | get_be_4_bytes (unsigned int &bytes) |
| | 4 bytes, big endian. More...
|
| bool | jump_abs (unsigned int pos) |
| | absolut seeking in file. More...
|
| bool | jump_rel (unsigned int n) |
| | relative seeking in file. More...
|
| bool | get_string (std::string &s, unsigned int n) |
| | reads n bytes from the file and stores them as a string in s. More...
|
| void | get_gif_geometry () |
| bool | check_gif_signature () |
| void | get_jpeg_geometry () |
| bool | check_jpeg_signature () |
| bool | jpeg_find_sof0_marker () |
| void | get_png_geometry () |
| bool | check_png_signature () |
| void | get_bmp_geometry () |
| bool | check_bmp_signature () |
Private Attributes |
| bool | valid |
| unsigned int | width |
| unsigned int | height |
| std::ifstream | in |
| Type | type |
| std::string | file_name |
| Error | error |