|
<html><head><title>dlib C++ Library - image_loader_abstract.h</title></head><body bgcolor='white'><pre> |
|
<font color='#009900'>// Copyright (C) 2006 Davis E. King ([email protected]) |
|
</font><font color='#009900'>// License: Boost Software License See LICENSE.txt for the full license. |
|
</font><font color='#0000FF'>#undef</font> DLIB_IMAGE_LOADEr_ABSTRACT_ |
|
<font color='#0000FF'>#ifdef</font> DLIB_IMAGE_LOADEr_ABSTRACT_ |
|
|
|
<font color='#0000FF'>#include</font> <font color='#5555FF'><</font>iosfwd<font color='#5555FF'>></font> |
|
<font color='#0000FF'>#include</font> "<a style='text-decoration:none' href='../algs.h.html'>../algs.h</a>" |
|
<font color='#0000FF'>#include</font> "<a style='text-decoration:none' href='../pixel.h.html'>../pixel.h</a>" |
|
<font color='#0000FF'>#include</font> "<a style='text-decoration:none' href='../image_processing/generic_image.h.html'>../image_processing/generic_image.h</a>" |
|
|
|
<font color='#0000FF'>namespace</font> dlib |
|
<b>{</b> |
|
<font color='#0000FF'>class</font> <b><a name='image_load_error'></a>image_load_error</b> : <font color='#0000FF'>public</font> dlib::error |
|
<b>{</b> |
|
<font color='#009900'>/*! |
|
WHAT THIS OBJECT REPRESENTS |
|
This is an exception used to indicate a failure to load an image. |
|
Its type member variable will be set to EIMAGE_LOAD. |
|
!*/</font> |
|
<b>}</b>; |
|
|
|
<font color='#009900'>// ---------------------------------------------------------------------------------------- |
|
</font> |
|
<font color='#0000FF'>template</font> <font color='#5555FF'><</font> |
|
<font color='#0000FF'>typename</font> image_type |
|
<font color='#5555FF'>></font> |
|
<font color='#0000FF'><u>void</u></font> <b><a name='load_bmp'></a>load_bmp</b> <font face='Lucida Console'>(</font> |
|
image_type<font color='#5555FF'>&</font> image, |
|
std::istream<font color='#5555FF'>&</font> in |
|
<font face='Lucida Console'>)</font>; |
|
<font color='#009900'>/*! |
|
requires |
|
- image_type == an image object that implements the interface defined in |
|
dlib/image_processing/generic_image.h |
|
ensures |
|
- #image == the image of the MS Windows BMP file that was available |
|
in the input stream in. |
|
- #image[0][0] will be the upper left corner of the image |
|
- #image[image.nr()-1][image.nc()-1] will be the lower right |
|
corner of the image |
|
- Performs any color space conversion necessary to convert the |
|
BMP image data into the pixel type used by the given image |
|
object. |
|
throws |
|
- image_load_error |
|
This exception is thrown if there is an error that prevents us |
|
from loading the image. If this exception is thrown then |
|
#image will have an initial value for its type. |
|
- std::bad_alloc |
|
If this exception is thrown then #image will have an initial |
|
value for its type. |
|
!*/</font> |
|
|
|
<font color='#009900'>// ---------------------------------------------------------------------------------------- |
|
</font> |
|
<font color='#0000FF'>template</font> <font color='#5555FF'><</font> |
|
<font color='#0000FF'>typename</font> image_type |
|
<font color='#5555FF'>></font> |
|
<font color='#0000FF'><u>void</u></font> <b><a name='load_bmp'></a>load_bmp</b> <font face='Lucida Console'>(</font> |
|
image_type<font color='#5555FF'>&</font> image, |
|
<font color='#0000FF'>const</font> std::string<font color='#5555FF'>&</font> file_name |
|
<font face='Lucida Console'>)</font>; |
|
<font color='#009900'>/*! |
|
requires |
|
- image_type == an image object that implements the interface defined in |
|
dlib/image_processing/generic_image.h |
|
ensures |
|
- opens the file indicated by file_name with an input file stream named fin |
|
and performs: |
|
load_bmp(image,fin); |
|
!*/</font> |
|
|
|
<font color='#009900'>// ---------------------------------------------------------------------------------------- |
|
</font> |
|
<font color='#009900'>/*! |
|
dlib dng file format: |
|
This is a file format I created for this library. It is a lossless |
|
compressed image format that is similar to the PNG format but uses |
|
the dlib PPM compression algorithms instead of the DEFLATE algorithm. |
|
!*/</font> |
|
|
|
<font color='#0000FF'>template</font> <font color='#5555FF'><</font> |
|
<font color='#0000FF'>typename</font> image_type |
|
<font color='#5555FF'>></font> |
|
<font color='#0000FF'><u>void</u></font> <b><a name='load_dng'></a>load_dng</b> <font face='Lucida Console'>(</font> |
|
image_type<font color='#5555FF'>&</font> image, |
|
std::istream<font color='#5555FF'>&</font> in |
|
<font face='Lucida Console'>)</font>; |
|
<font color='#009900'>/*! |
|
requires |
|
- image_type == an image object that implements the interface defined in |
|
dlib/image_processing/generic_image.h |
|
ensures |
|
- #image == the image of the dlib dng file that was available |
|
in the input stream in. |
|
- #image[0][0] will be the upper left corner of the image |
|
- #image[image.nr()-1][image.nc()-1] will be the lower right |
|
corner of the image |
|
- Performs any color space conversion necessary to convert the |
|
dng image data into the pixel type used by the given image |
|
object. |
|
throws |
|
- image_load_error |
|
This exception is thrown if there is an error that prevents us |
|
from loading the image. If this exception is thrown then |
|
#image will have an initial value for its type. |
|
- std::bad_alloc |
|
If this exception is thrown then #image will have an initial |
|
value for its type. |
|
!*/</font> |
|
|
|
<font color='#009900'>// ---------------------------------------------------------------------------------------- |
|
</font> |
|
<font color='#0000FF'>template</font> <font color='#5555FF'><</font> |
|
<font color='#0000FF'>typename</font> image_type |
|
<font color='#5555FF'>></font> |
|
<font color='#0000FF'><u>void</u></font> <b><a name='load_dng'></a>load_dng</b> <font face='Lucida Console'>(</font> |
|
image_type<font color='#5555FF'>&</font> image, |
|
<font color='#0000FF'>const</font> std::string<font color='#5555FF'>&</font> file_name |
|
<font face='Lucida Console'>)</font>; |
|
<font color='#009900'>/*! |
|
requires |
|
- image_type == an image object that implements the interface defined in |
|
dlib/image_processing/generic_image.h |
|
ensures |
|
- opens the file indicated by file_name with an input file stream named fin |
|
and performs: |
|
load_dng(image,fin); |
|
!*/</font> |
|
|
|
<font color='#009900'>// ---------------------------------------------------------------------------------------- |
|
</font> |
|
<b>}</b> |
|
|
|
<font color='#0000FF'>#endif</font> <font color='#009900'>// DLIB_IMAGE_LOADEr_ABSTRACT_ |
|
</font> |
|
|
|
</pre></body></html> |