Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CImgList< T > Struct Template Reference

Class representing list of images CImg<T>. More...

#include <CImg.h>

Inheritance diagram for CImgList< T >:

Public Types

typedef CImg< T > * iterator
 Define a CImgList<T>::iterator. More...
 
typedef const CImg< T > * const_iterator
 Define a CImgList<T>::const_iterator. More...
 
typedef T value_type
 Value type. More...
 
typedef cimg::superset< T,
bool >::type 
Tbool
 
typedef cimg::superset< T,
unsigned char >::type 
Tuchar
 
typedef cimg::superset< T,
char >::type 
Tchar
 
typedef cimg::superset< T,
unsigned short >::type 
Tushort
 
typedef cimg::superset< T,
short >::type 
Tshort
 
typedef cimg::superset< T,
unsigned int >::type 
Tuint
 
typedef cimg::superset< T, int >
::type 
Tint
 
typedef cimg::superset< T,
unsigned long >::type 
Tulong
 
typedef cimg::superset< T,
long >::type 
Tlong
 
typedef cimg::superset< T,
float >::type 
Tfloat
 
typedef cimg::superset< T,
double >::type 
Tdouble
 
typedef cimg::last< T, bool >::type boolT
 
typedef cimg::last< T,
unsigned char >::type 
ucharT
 
typedef cimg::last< T, char >::type charT
 
typedef cimg::last< T,
unsigned short >::type 
ushortT
 
typedef cimg::last< T, short >
::type 
shortT
 
typedef cimg::last< T,
unsigned int >::type 
uintT
 
typedef cimg::last< T, int >::type intT
 
typedef cimg::last< T,
unsigned long >::type 
ulongT
 
typedef cimg::last< T, long >::type longT
 
typedef cimg::last< T, float >
::type 
floatT
 
typedef cimg::last< T, double >
::type 
doubleT
 

Public Member Functions

Overloaded Operators
CImg< T > & operator[] (const unsigned int pos)
 Return a reference to the i-th element of the image list. More...
 
const CImg< T > & operator[] (const unsigned int pos) const
 
CImg< T > & operator() (const unsigned int pos)
 Equivalent to CImgList<T>::operator[]. More...
 
const CImg< T > & operator() (const unsigned int pos) const
 
T & operator() (const unsigned int pos, const unsigned int x, const unsigned int y=0, const unsigned int z=0, const unsigned int v=0)
 Return a reference to (x,y,z,v) pixel of the pos-th image of the list. More...
 
const T & operator() (const unsigned int pos, const unsigned int x, const unsigned int y=0, const unsigned int z=0, const unsigned int v=0) const
 
 operator bool () const
 Return true if list is not empty. More...
 
template<typename t >
CImgList< T > & operator= (const CImg< t > &img)
 Operator=(). More...
 
CImgList< T > & operator= (const CImgDisplay &disp)
 Operator=(). More...
 
template<typename t >
CImgList< T > & operator= (const CImgList< t > &list)
 Operator=(). More...
 
CImgList< T > & operator= (const CImgList< T > &list)
 
CImgList< T > & operator= (const char *const filename)
 Operator=(). More...
 
CImgList< T > operator+ () const
 Operator+() (unary). More...
 
template<typename t >
CImgList< T > & operator, (const CImg< t > &img)
 Operator,(). More...
 
template<typename t >
CImgList< T > & operator, (const CImgList< t > &list)
 Operator,(). More...
 
CImg< T > operator> (const char axis) const
 Operator>(). More...
 
CImgList< T > operator< (const char axis) const
 Operator<(). More...
 
Instance Checking
bool is_empty () const
 Return true if list is empty. More...
 
bool is_sameN (const unsigned int n) const
 Return true if list if of specified size. More...
 
template<typename t >
bool is_sameN (const CImgList< t > &list) const
 Return true if list if of specified size. More...
 
bool is_sameXYZV (const unsigned int dx, const unsigned int dy, const unsigned int dz, const unsigned int dv) const
 
bool is_sameNXYZV (const unsigned int n, const unsigned int dx, const unsigned int dy, const unsigned int dz, const unsigned int dv) const
 
bool containsNXYZV (const int n, const int x=0, const int y=0, const int z=0, const int v=0) const
 Return true if the list contains the pixel (n,x,y,z,v). More...
 
bool containsN (const int n) const
 Return true if the list contains the image (n). More...
 
template<typename t >
bool contains (const T &pixel, t &n, t &x, t &y, t &z, t &v) const
 Return true if one of the image list contains the specified referenced value. If true, set coordinates (n,x,y,z,v). More...
 
template<typename t >
bool contains (const T &pixel, t &n, t &x, t &y, t &z) const
 Return true if one of the image list contains the specified referenced value. If true, set coordinates (n,x,y,z). More...
 
template<typename t >
bool contains (const T &pixel, t &n, t &x, t &y) const
 Return true if one of the image list contains the specified referenced value. If true, set coordinates (n,x,y). More...
 
template<typename t >
bool contains (const T &pixel, t &n, t &x) const
 Return true if one of the image list contains the specified referenced value. If true, set coordinates (n,x). More...
 
template<typename t >
bool contains (const T &pixel, t &n) const
 Return true if one of the image list contains the specified referenced value. If true, set coordinates (n). More...
 
bool contains (const T &pixel) const
 Return true if one of the image list contains the specified referenced value. More...
 
template<typename t >
bool contains (const CImg< T > &img, t &n) const
 Return true if the list contains the image 'img'. If true, returns the position (n) of the image in the list. More...
 
bool contains (const CImg< T > &img) const
 Return true if the list contains the image img. More...
 
Mathematical Functions
T & min ()
 Return a reference to the minimum pixel value of the instance list. More...
 
const T & min () const
 
T & max ()
 Return a reference to the maximum pixel value of the instance list. More...
 
const T & max () const
 
template<typename t >
T & minmax (t &max_val)
 Return a reference to the minimum pixel value of the instance list. More...
 
template<typename t >
const T & minmax (t &max_val) const
 
template<typename t >
T & maxmin (t &min_val)
 Return a reference to the minimum pixel value of the instance list. More...
 
template<typename t >
const T & maxmin (t &min_val) const
 
List Manipulation
template<typename t >
CImgList< T > & insert (const CImg< t > &img, const unsigned int pos=~0U, const bool shared=false)
 Insert a copy of the image img into the current image list, at position pos. More...
 
CImgList< T > & insert (const CImg< T > &img, const unsigned int pos=~0U, const bool shared=false)
 
template<typename t >
CImgList< T > get_insert (const CImg< t > &img, const unsigned int pos=~0U, const bool shared=false) const
 
CImgList< T > & insert (const unsigned int n, const unsigned int pos=~0U)
 Insert n empty images img into the current image list, at position pos. More...
 
CImgList< T > get_insert (const unsigned int n, const unsigned int pos=~0U) const
 
template<typename t >
CImgList< T > & insert (const unsigned int n, const CImg< t > &img, const unsigned int pos=~0U, const bool shared=false)
 Insert n copies of the image img into the current image list, at position pos. More...
 
template<typename t >
CImgList< T > get_insert (const unsigned int n, const CImg< t > &img, const unsigned int pos=~0U, const bool shared=false) const
 
template<typename t >
CImgList< T > & insert (const CImgList< t > &list, const unsigned int pos=~0U, const bool shared=false)
 Insert a copy of the image list list into the current image list, starting from position pos. More...
 
template<typename t >
CImgList< T > get_insert (const CImgList< t > &list, const unsigned int pos=~0U, const bool shared=false) const
 
template<typename t >
CImgList< T > & insert (const unsigned int n, const CImgList< t > &list, const unsigned int pos=~0U, const bool shared=false)
 Insert n copies of the list list at position pos of the current list. More...
 
template<typename t >
CImgList< T > get_insert (const unsigned int n, const CImgList< t > &list, const unsigned int pos=~0U, const bool shared=false) const
 
CImgList< T > & remove (const unsigned int pos1, const unsigned int pos2)
 Remove the images from positions pos1 to pos2. More...
 
CImgList< T > get_remove (const unsigned int pos1, const unsigned int pos2) const
 
CImgList< T > & remove (const unsigned int pos)
 Remove the image at position pos from the image list. More...
 
CImgList< T > get_remove (const unsigned int pos) const
 
CImgList< T > & remove ()
 Remove the last image from the image list. More...
 
CImgList< T > get_remove () const
 
CImgList< T > & reverse ()
 Reverse list order. More...
 
CImgList< T > get_reverse () const
 
CImgList< T > & images (const unsigned int i0, const unsigned int i1)
 Get a sub-list. More...
 
CImgList< T > get_images (const unsigned int i0, const unsigned int i1) const
 
CImgList< T > get_shared_images (const unsigned int i0, const unsigned int i1)
 Get a shared sub-list. More...
 
const CImgList< T > get_shared_images (const unsigned int i0, const unsigned int i1) const
 
CImg< T > get_append (const char axis, const char align='p') const
 Return a single image which is the concatenation of all images of the current CImgList instance. More...
 
CImgList< T > & split (const char axis, const int nb=0)
 Return a list where each image has been split along the specified axis. More...
 
CImgList< T > get_split (const char axis, const int nb=0) const
 
template<typename t >
CImgList< T > & push_back (const CImg< t > &img)
 Insert image img at the end of the list (STL-compliant name). More...
 
template<typename t >
CImgList< T > & push_front (const CImg< t > &img)
 Insert image img at the front of the list (STL-compliant name). More...
 
template<typename t >
CImgList< T > & push_back (const CImgList< t > &list)
 Insert list list at the end of the current list (STL-compliant name). More...
 
template<typename t >
CImgList< T > & push_front (const CImgList< t > &list)
 Insert list list at the front of the current list (STL-compliant name). More...
 
CImgList< T > & pop_back ()
 Remove last element of the list (STL-compliant name). More...
 
CImgList< T > & pop_front ()
 Remove first element of the list (STL-compliant name). More...
 
CImgList< T > & erase (const iterator iter)
 Remove the element pointed by iterator iter (STL-compliant name). More...
 

Public Attributes

unsigned int width
 Size of the list (number of images). More...
 
unsigned int allocated_width
 Allocation size of the list. More...
 
CImg< T > * data
 Pointer to the first list element. More...
 

Constructors / Destructor / Instance Management

 ~CImgList ()
 Destructor. More...
 
 CImgList ()
 Default constructor. More...
 
 CImgList (const unsigned int n)
 Construct an image list containing n empty images. More...
 
 CImgList (const unsigned int n, const unsigned int width, const unsigned int height=1, const unsigned int depth=1, const unsigned int dim=1)
 Construct an image list containing n images with specified size. More...
 
 CImgList (const unsigned int n, const unsigned int width, const unsigned int height, const unsigned int depth, const unsigned int dim, const T val)
 Construct an image list containing n images with specified size, filled with specified value. More...
 
 CImgList (const unsigned int n, const unsigned int width, const unsigned int height, const unsigned int depth, const unsigned int dim, const int val0, const int val1,...)
 Construct an image list containing n images with specified size and specified pixel values (int version). More...
 
 CImgList (const unsigned int n, const unsigned int width, const unsigned int height, const unsigned int depth, const unsigned int dim, const double val0, const double val1,...)
 Construct an image list containing n images with specified size and specified pixel values (double version). More...
 
template<typename t >
 CImgList (const unsigned int n, const CImg< t > &img, const bool shared=false)
 Construct a list containing n copies of the image img. More...
 
template<typename t >
 CImgList (const CImg< t > &img, const bool shared=false)
 Construct an image list from one image. More...
 
template<typename t1 , typename t2 >
 CImgList (const CImg< t1 > &img1, const CImg< t2 > &img2, const bool shared=false)
 Construct an image list from two images. More...
 
template<typename t1 , typename t2 , typename t3 >
 CImgList (const CImg< t1 > &img1, const CImg< t2 > &img2, const CImg< t3 > &img3, const bool shared=false)
 Construct an image list from three images. More...
 
template<typename t1 , typename t2 , typename t3 , typename t4 >
 CImgList (const CImg< t1 > &img1, const CImg< t2 > &img2, const CImg< t3 > &img3, const CImg< t4 > &img4, const bool shared=false)
 Construct an image list from four images. More...
 
template<typename t1 , typename t2 , typename t3 , typename t4 , typename t5 >
 CImgList (const CImg< t1 > &img1, const CImg< t2 > &img2, const CImg< t3 > &img3, const CImg< t4 > &img4, const CImg< t5 > &img5, const bool shared=false)
 Construct an image list from five images. More...
 
template<typename t1 , typename t2 , typename t3 , typename t4 , typename t5 , typename t6 >
 CImgList (const CImg< t1 > &img1, const CImg< t2 > &img2, const CImg< t3 > &img3, const CImg< t4 > &img4, const CImg< t5 > &img5, const CImg< t6 > &img6, const bool shared=false)
 Construct an image list from six images. More...
 
template<typename t1 , typename t2 , typename t3 , typename t4 , typename t5 , typename t6 , typename t7 >
 CImgList (const CImg< t1 > &img1, const CImg< t2 > &img2, const CImg< t3 > &img3, const CImg< t4 > &img4, const CImg< t5 > &img5, const CImg< t6 > &img6, const CImg< t7 > &img7, const bool shared=false)
 Construct an image list from seven images. More...
 
template<typename t1 , typename t2 , typename t3 , typename t4 , typename t5 , typename t6 , typename t7 , typename t8 >
 CImgList (const CImg< t1 > &img1, const CImg< t2 > &img2, const CImg< t3 > &img3, const CImg< t4 > &img4, const CImg< t5 > &img5, const CImg< t6 > &img6, const CImg< t7 > &img7, const CImg< t8 > &img8, const bool shared=false)
 Construct an image list from eight images. More...
 
template<typename t >
 CImgList (const CImgList< t > &list)
 Default copy constructor. More...
 
 CImgList (const CImgList< T > &list)
 
template<typename t >
 CImgList (const CImgList< t > &list, const bool shared)
 Advanced copy constructor. More...
 
 CImgList (const char *const filename)
 Construct an image list from a filename. More...
 
 CImgList (const CImgDisplay &disp)
 Construct an image list from a display. More...
 
CImgList< T > get_shared ()
 Return a shared instance of the list. More...
 
const CImgList< T > get_shared () const
 Return a shared instance of the list. More...
 
CImgList< T > & clear ()
 In-place version of the default constructor. More...
 
CImgList< T > & assign ()
 In-place version of the default constructor and default destructor. More...
 
CImgList< T > & assign (const unsigned int n)
 In-place version of the corresponding constructor. More...
 
CImgList< T > & assign (const unsigned int n, const unsigned int width, const unsigned int height=1, const unsigned int depth=1, const unsigned int dim=1)
 In-place version of the corresponding constructor. More...
 
CImgList< T > & assign (const unsigned int n, const unsigned int width, const unsigned int height, const unsigned int depth, const unsigned int dim, const T val)
 In-place version of the corresponding constructor. More...
 
CImgList< T > & assign (const unsigned int n, const unsigned int width, const unsigned int height, const unsigned int depth, const unsigned int dim, const int val0, const int val1,...)
 In-place version of the corresponding constructor. More...
 
CImgList< T > & assign (const unsigned int n, const unsigned int width, const unsigned int height, const unsigned int depth, const unsigned int dim, const double val0, const double val1,...)
 In-place version of the corresponding constructor. More...
 
template<typename t >
CImgList< T > & assign (const CImgList< t > &list, const bool shared=false)
 In-place version of the copy constructor. More...
 
template<typename t >
CImgList< T > & assign (const unsigned int n, const CImg< t > &img, const bool shared=false)
 In-place version of the corresponding constructor. More...
 
template<typename t >
CImgList< T > & assign (const CImg< t > &img, const bool shared=false)
 In-place version of the corresponding constructor. More...
 
template<typename t1 , typename t2 >
CImgList< T > & assign (const CImg< t1 > &img1, const CImg< t2 > &img2, const bool shared=false)
 In-place version of the corresponding constructor. More...
 
template<typename t1 , typename t2 , typename t3 >
CImgList< T > & assign (const CImg< t1 > &img1, const CImg< t2 > &img2, const CImg< t3 > &img3, const bool shared=false)
 In-place version of the corresponding constructor. More...
 
template<typename t1 , typename t2 , typename t3 , typename t4 >
CImgList< T > & assign (const CImg< t1 > &img1, const CImg< t2 > &img2, const CImg< t3 > &img3, const CImg< t4 > &img4, const bool shared=false)
 In-place version of the corresponding constructor. More...
 
template<typename t1 , typename t2 , typename t3 , typename t4 , typename t5 >
CImgList< T > & assign (const CImg< t1 > &img1, const CImg< t2 > &img2, const CImg< t3 > &img3, const CImg< t4 > &img4, const CImg< t5 > &img5, const bool shared=false)
 In-place version of the corresponding constructor. More...
 
template<typename t1 , typename t2 , typename t3 , typename t4 , typename t5 , typename t6 >
CImgList< T > & assign (const CImg< t1 > &img1, const CImg< t2 > &img2, const CImg< t3 > &img3, const CImg< t4 > &img4, const CImg< t5 > &img5, const CImg< t6 > &img6, const bool shared=false)
 In-place version of the corresponding constructor. More...
 
template<typename t1 , typename t2 , typename t3 , typename t4 , typename t5 , typename t6 , typename t7 >
CImgList< T > & assign (const CImg< t1 > &img1, const CImg< t2 > &img2, const CImg< t3 > &img3, const CImg< t4 > &img4, const CImg< t5 > &img5, const CImg< t6 > &img6, const CImg< t7 > &img7, const bool shared=false)
 In-place version of the corresponding constructor. More...
 
template<typename t1 , typename t2 , typename t3 , typename t4 , typename t5 , typename t6 , typename t7 , typename t8 >
CImgList< T > & assign (const CImg< t1 > &img1, const CImg< t2 > &img2, const CImg< t3 > &img3, const CImg< t4 > &img4, const CImg< t5 > &img5, const CImg< t6 > &img6, const CImg< t7 > &img7, const CImg< t8 > &img8, const bool shared=false)
 In-place version of the corresponding constructor. More...
 
CImgList< T > & assign (const char *const filename)
 In-place version of the corresponding constructor. More...
 
CImgList< T > & assign (const CImgDisplay &disp)
 In-place version of the corresponding constructor. More...
 
template<typename t >
CImgList< T > & transfer_to (CImgList< t > &list)
 Transfer the content of the instance image list into another one. More...
 
CImgList< T > & transfer_to (CImgList< T > &list)
 
template<typename t >
CImgList< t > & transfer_to (CImgList< t > &list, const unsigned int pos)
 
CImgList< T > & swap (CImgList< T > &list)
 Swap all fields of two CImgList instances (use with care !) More...
 
static CImgList< T > & empty ()
 Return a reference to an empty list. More...
 

Instance Characteristics

int dimx () const
 Return the size of the list. More...
 
unsigned int size () const
 Return the size of the list. More...
 
CImg< T > * ptr ()
 Return a pointer to the image buffer. More...
 
const CImg< T > * ptr () const
 
CImg< T > * ptr (const unsigned int l)
 Return a pointer to the image buffer. More...
 
const CImg< T > * ptr (const unsigned int l) const
 
iterator begin ()
 Returns an iterator to the beginning of the vector (STL-compliant name). More...
 
const_iterator begin () const
 
iterator end ()
 Returns an iterator just past the last element (STL-compliant name). More...
 
const_iterator end () const
 
CImg< T > & front ()
 Returns a reference to the first element (STL-compliant name). More...
 
const CImg< T > & front () const
 
const CImg< T > & back () const
 Return a reference to the last image (STL-compliant name). More...
 
CImg< T > & back ()
 
CImg< T > & at (const int pos)
 Read an image in specified position. More...
 
T & atNXYZV (const int pos, const int x, const int y, const int z, const int v, const T out_val)
 Read a pixel value with Dirichlet boundary conditions. More...
 
atNXYZV (const int pos, const int x, const int y, const int z, const int v, const T out_val) const
 
T & atNXYZV (const int pos, const int x, const int y, const int z, const int v)
 Read a pixel value with Neumann boundary conditions. More...
 
atNXYZV (const int pos, const int x, const int y, const int z, const int v) const
 
T & _atNXYZV (const int pos, const int x, const int y, const int z, const int v)
 
_atNXYZV (const int pos, const int x, const int y, const int z, const int v) const
 
T & atNXYZ (const int pos, const int x, const int y, const int z, const int v, const T out_val)
 Read a pixel value with Dirichlet boundary conditions for the four first coordinates (pos, x,y,z). More...
 
atNXYZ (const int pos, const int x, const int y, const int z, const int v, const T out_val) const
 
T & atNXYZ (const int pos, const int x, const int y, const int z, const int v=0)
 Read a pixel value with Neumann boundary conditions for the four first coordinates (pos, x,y,z). More...
 
atNXYZ (const int pos, const int x, const int y, const int z, const int v=0) const
 
T & _atNXYZ (const int pos, const int x, const int y, const int z, const int v=0)
 
_atNXYZ (const int pos, const int x, const int y, const int z, const int v=0) const
 
T & atNXY (const int pos, const int x, const int y, const int z, const int v, const T out_val)
 Read a pixel value with Dirichlet boundary conditions for the three first coordinates (pos, x,y). More...
 
atNXY (const int pos, const int x, const int y, const int z, const int v, const T out_val) const
 
T & atNXY (const int pos, const int x, const int y, const int z=0, const int v=0)
 Read a pixel value with Neumann boundary conditions for the three first coordinates (pos, x,y). More...
 
atNXY (const int pos, const int x, const int y, const int z=0, const int v=0) const
 
T & _atNXY (const int pos, const int x, const int y, const int z=0, const int v=0)
 
_atNXY (const int pos, const int x, const int y, const int z=0, const int v=0) const
 
T & atNX (const int pos, const int x, const int y, const int z, const int v, const T out_val)
 Read a pixel value with Dirichlet boundary conditions for the two first coordinates (pos,x). More...
 
atNX (const int pos, const int x, const int y, const int z, const int v, const T out_val) const
 
T & atNX (const int pos, const int x, const int y=0, const int z=0, const int v=0)
 Read a pixel value with Neumann boundary conditions for the two first coordinates (pos, x). More...
 
atNX (const int pos, const int x, const int y=0, const int z=0, const int v=0) const
 
T & _atNX (const int pos, const int x, const int y=0, const int z=0, const int v=0)
 
_atNX (const int pos, const int x, const int y=0, const int z=0, const int v=0) const
 
T & atN (const int pos, const int x, const int y, const int z, const int v, const T out_val)
 Read a pixel value with Dirichlet boundary conditions for the first coordinates (pos). More...
 
atN (const int pos, const int x, const int y, const int z, const int v, const T out_val) const
 
T & atN (const int pos, const int x=0, const int y=0, const int z=0, const int v=0)
 Read a pixel value with Neumann boundary conditions for the first coordinates (pos). More...
 
atN (const int pos, const int x=0, const int y=0, const int z=0, const int v=0) const
 
T & _atN (const int pos, const int x=0, const int y=0, const int z=0, const int v=0)
 
_atN (const int pos, const int x=0, const int y=0, const int z=0, const int v=0) const
 
CImg< charTvalue_string (const char separator=',', const unsigned int max_size=0) const
 Return a C-string containing the values of all images in the instance list. More...
 
static const char * pixel_type ()
 Return a string describing the type of the image pixels in the list (template parameter T). More...
 

Data Input

CImgList< T > & load (const char *const filename)
 Load an image list from a file. More...
 
CImgList< T > & load_cimg (const char *const filename)
 Load an image list from a .cimg file. More...
 
CImgList< T > & load_cimg (std::FILE *const file)
 Load an image list from a .cimg file. More...
 
CImgList< T > & _load_cimg (std::FILE *const file, const char *const filename)
 
CImgList< T > & load_cimg (const char *const filename, const unsigned int n0, const unsigned int n1, const unsigned int x0, const unsigned int y0, const unsigned int z0, const unsigned int v0, const unsigned int x1, const unsigned int y1, const unsigned int z1, const unsigned int v1)
 Load a sub-image list from a non compressed .cimg file. More...
 
CImgList< T > & load_cimg (std::FILE *const file, const unsigned int n0, const unsigned int n1, const unsigned int x0, const unsigned int y0, const unsigned int z0, const unsigned int v0, const unsigned int x1, const unsigned int y1, const unsigned int z1, const unsigned int v1)
 Load a sub-image list from a non compressed .cimg file. More...
 
CImgList< T > & _load_cimg (std::FILE *const file, const char *const filename, const unsigned int n0, const unsigned int n1, const unsigned int x0, const unsigned int y0, const unsigned int z0, const unsigned int v0, const unsigned int x1, const unsigned int y1, const unsigned int z1, const unsigned int v1)
 
CImgList< T > & load_parrec (const char *const filename)
 Load an image list from a PAR/REC (Philips) file. More...
 
CImgList< T > & load_yuv (const char *const filename, const unsigned int sizex, const unsigned int sizey, const unsigned int first_frame=0, const unsigned int last_frame=~0U, const unsigned int step_frame=1, const bool yuv2rgb=true)
 Load an image sequence from a YUV file. More...
 
CImgList< T > & load_yuv (std::FILE *const file, const unsigned int sizex, const unsigned int sizey, const unsigned int first_frame=0, const unsigned int last_frame=~0U, const unsigned int step_frame=1, const bool yuv2rgb=true)
 Load an image sequence from a YUV file. More...
 
CImgList< T > & _load_yuv (std::FILE *const file, const char *const filename, const unsigned int sizex, const unsigned int sizey, const unsigned int first_frame, const unsigned int last_frame, const unsigned int step_frame, const bool yuv2rgb)
 
CImgList< T > & load_ffmpeg (const char *const filename, const unsigned int first_frame=0, const unsigned int last_frame=~0U, const unsigned int step_frame=1, const bool pixel_format=true, const bool resume=false)
 Load an image from a video file, using ffmpeg libraries. More...
 
CImgList< T > & load_ffmpeg_external (const char *const filename)
 Load an image from a video file (MPEG,AVI) using the external tool 'ffmpeg'. More...
 
CImgList< T > & load_gzip_external (const char *const filename)
 Load a gzipped list, using external tool 'gunzip'. More...
 
template<typename tf , typename tc >
CImgList< T > & load_off (const char *const filename, CImgList< tf > &primitives, CImgList< tc > &colors)
 Load a 3D object from a .OFF file. More...
 
CImgList< T > & load_tiff (const char *const filename, const unsigned int first_frame=0, const unsigned int last_frame=~0U, const unsigned int step_frame=1)
 Load a TIFF file. More...
 
static CImgList< T > get_load (const char *const filename)
 
static CImgList< T > get_load_cimg (const char *const filename)
 
static CImgList< T > get_load_cimg (std::FILE *const file)
 
static CImgList< T > get_load_cimg (const char *const filename, const unsigned int n0, const unsigned int n1, const unsigned int x0, const unsigned int y0, const unsigned int z0, const unsigned int v0, const unsigned int x1, const unsigned int y1, const unsigned int z1, const unsigned int v1)
 
static CImgList< T > get_load_cimg (std::FILE *const file, const unsigned int n0, const unsigned int n1, const unsigned int x0, const unsigned int y0, const unsigned int z0, const unsigned int v0, const unsigned int x1, const unsigned int y1, const unsigned int z1, const unsigned int v1)
 
static CImgList< T > get_load_parrec (const char *const filename)
 
static CImgList< T > get_load_yuv (const char *const filename, const unsigned int sizex, const unsigned int sizey=1, const unsigned int first_frame=0, const unsigned int last_frame=~0U, const unsigned int step_frame=1, const bool yuv2rgb=true)
 
static CImgList< T > get_load_yuv (std::FILE *const file, const unsigned int sizex, const unsigned int sizey=1, const unsigned int first_frame=0, const unsigned int last_frame=~0U, const unsigned int step_frame=1, const bool yuv2rgb=true)
 
static CImgList< T > get_load_ffmpeg (const char *const filename, const unsigned int first_frame=0, const unsigned int last_frame=~0U, const unsigned int step_frame=1, const bool pixel_format=true)
 
static CImgList< T > get_load_ffmpeg_external (const char *const filename)
 
static CImgList< T > get_load_gzip_external (const char *const filename)
 
template<typename tf , typename tc >
static CImgList< T > get_load_off (const char *const filename, CImgList< tf > &primitives, CImgList< tc > &colors)
 
static CImgList< T > get_load_tiff (const char *const filename, const unsigned int first_frame=0, const unsigned int last_frame=~0U, const unsigned int step_frame=1)
 

Data Output

const CImgList< T > & print (const char *title=0, const bool display_stats=true) const
 Print informations about the list on the standard output. More...
 
const CImgList< T > & display (CImgDisplay &disp, const char axis='x', const char align='p') const
 Display the current CImgList instance in an existing CImgDisplay window (by reference). More...
 
const CImgList< T > & display (CImgDisplay &disp, const bool display_info, const char axis='x', const char align='p') const
 Display the current CImgList instance in a new display window. More...
 
const CImgList< T > & display (const char *const title=0, const bool display_info=true, const char axis='x', const char align='p') const
 Display the current CImgList instance in a new display window. More...
 
const CImgList< T > & save (const char *const filename, const int number=-1) const
 Save an image list into a file. More...
 
const CImgList< T > & save_ffmpeg (const char *const filename, const unsigned int first_frame=0, const unsigned int last_frame=~0U, const unsigned int fps=25) const
 Save an image sequence, using FFMPEG library. More...
 
const CImgList< T > & _save_yuv (std::FILE *const file, const char *const filename, const bool rgb2yuv) const
 
const CImgList< T > & save_yuv (const char *const filename=0, const bool rgb2yuv=true) const
 Save an image sequence into a YUV file. More...
 
const CImgList< T > & save_yuv (std::FILE *const file, const bool rgb2yuv=true) const
 Save an image sequence into a YUV file. More...
 
const CImgList< T > & _save_cimg (std::FILE *const file, const char *const filename, const bool compression) const
 Save an image list into a .cimg file. More...
 
const CImgList< T > & save_cimg (std::FILE *file, const bool compress=false) const
 Save an image list into a CImg file (RAW binary file + simple header) More...
 
const CImgList< T > & save_cimg (const char *const filename, const bool compress=false) const
 Save an image list into a CImg file (RAW binary file + simple header) More...
 
const CImgList< T > & _save_cimg (std::FILE *const file, const char *const filename, const unsigned int n0, const unsigned int x0, const unsigned int y0, const unsigned int z0, const unsigned int v0) const
 
const CImgList< T > & save_cimg (const char *const filename, const unsigned int n0, const unsigned int x0, const unsigned int y0, const unsigned int z0, const unsigned int v0) const
 Insert the instance image into into an existing .cimg file, at specified coordinates. More...
 
const CImgList< T > & save_cimg (std::FILE *const file, const unsigned int n0, const unsigned int x0, const unsigned int y0, const unsigned int z0, const unsigned int v0) const
 Insert the instance image into into an existing .cimg file, at specified coordinates. More...
 
const CImgList< T > & save_gzip_external (const char *const filename) const
 Save a file in TIFF format. More...
 
const CImgList< T > & save_ffmpeg_external (const char *const filename, const unsigned int first_frame=0, const unsigned int last_frame=~0U, const char *const codec="mpeg2video") const
 Save an image sequence using the external tool 'ffmpeg'. More...
 
static void _save_empty_cimg (std::FILE *const file, const char *const filename, const unsigned int nb, const unsigned int dx, const unsigned int dy, const unsigned int dz, const unsigned int dv)
 
static void save_empty_cimg (const char *const filename, const unsigned int nb, const unsigned int dx, const unsigned int dy=1, const unsigned int dz=1, const unsigned int dv=1)
 Create an empty .cimg file with specified dimensions. More...
 
static void save_empty_cimg (std::FILE *const file, const unsigned int nb, const unsigned int dx, const unsigned int dy=1, const unsigned int dz=1, const unsigned int dv=1)
 Create an empty .cimg file with specified dimensions. More...
 

Others

CImgList< T > & crop_font ()
 Create an auto-cropped font (along the X axis) from a input font font. More...
 
CImgList< T > get_crop_font () const
 
CImgList< T > & FFT (const char axis, const bool invert=false)
 Compute a 1-D Fast Fourier Transform, along specified axis. More...
 
CImgList< Tfloatget_FFT (const char axis, const bool invert=false) const
 
CImgList< T > & FFT (const bool invert=false)
 Compute a N-D Fast Fourier Transform. More...
 
CImgList< Tfloatget_FFT (const bool invert=false) const
 
CImgList< T > & reverse_object3d ()
 Invert primitives orientation of a 3D object. More...
 
CImgList< T > get_reverse_object3d () const
 
static CImgList< T > font (const unsigned int font_width, const bool variable_size=true)
 Return a CImg pre-defined font with desired size. More...
 
static CImgList< T > _font (const unsigned int *const font, const unsigned int w, const unsigned int h, const unsigned int paddingx, const unsigned int paddingy, const bool variable_size=true)
 

Detailed Description

template<typename T = float>
struct cimg_library::CImgList< T >

Class representing list of images CImg<T>.

Definition at line 1906 of file CImg.h.

Member Typedef Documentation

typedef cimg::last<T,bool>::type boolT

Definition at line 33912 of file CImg.h.

typedef cimg::last<T,char>::type charT

Definition at line 33914 of file CImg.h.

typedef const CImg<T>* const_iterator

Define a CImgList<T>::const_iterator.

Definition at line 33895 of file CImg.h.

typedef cimg::last<T,double>::type doubleT

Definition at line 33922 of file CImg.h.

typedef cimg::last<T,float>::type floatT

Definition at line 33921 of file CImg.h.

typedef cimg::last<T,int>::type intT

Definition at line 33918 of file CImg.h.

typedef CImg<T>* iterator

Define a CImgList<T>::iterator.

Definition at line 33892 of file CImg.h.

typedef cimg::last<T,long>::type longT

Definition at line 33920 of file CImg.h.

typedef cimg::last<T,short>::type shortT

Definition at line 33916 of file CImg.h.

typedef cimg::superset<T,bool>::type Tbool

Definition at line 33901 of file CImg.h.

typedef cimg::superset<T,char>::type Tchar

Definition at line 33903 of file CImg.h.

typedef cimg::superset<T,double>::type Tdouble

Definition at line 33911 of file CImg.h.

typedef cimg::superset<T,float>::type Tfloat

Definition at line 33910 of file CImg.h.

typedef cimg::superset<T,int>::type Tint

Definition at line 33907 of file CImg.h.

typedef cimg::superset<T,long>::type Tlong

Definition at line 33909 of file CImg.h.

typedef cimg::superset<T,short>::type Tshort

Definition at line 33905 of file CImg.h.

typedef cimg::superset<T,unsigned char>::type Tuchar

Definition at line 33902 of file CImg.h.

typedef cimg::superset<T,unsigned int>::type Tuint

Definition at line 33906 of file CImg.h.

typedef cimg::superset<T,unsigned long>::type Tulong

Definition at line 33908 of file CImg.h.

typedef cimg::superset<T,unsigned short>::type Tushort

Definition at line 33904 of file CImg.h.

typedef cimg::last<T,unsigned char>::type ucharT

Definition at line 33913 of file CImg.h.

typedef cimg::last<T,unsigned int>::type uintT

Definition at line 33917 of file CImg.h.

typedef cimg::last<T,unsigned long>::type ulongT

Definition at line 33919 of file CImg.h.

typedef cimg::last<T,unsigned short>::type ushortT

Definition at line 33915 of file CImg.h.

typedef T value_type

Value type.

Definition at line 33898 of file CImg.h.

Constructor & Destructor Documentation

~CImgList ( )
inline

Destructor.

Definition at line 33966 of file CImg.h.

33966  {
33967  if (data) delete[] data;
33968  }
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
CImgList ( )
inline

Default constructor.

Definition at line 33971 of file CImg.h.

33971  :
33972  width(0),allocated_width(0),data(0) {}
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
unsigned int allocated_width
Allocation size of the list.
Definition: CImg.h:33886
CImgList ( const unsigned int  n)
inlineexplicit

Construct an image list containing n empty images.

Definition at line 33975 of file CImg.h.

33975  :width(n) {
33976  data = new CImg<T>[allocated_width = cimg::max(16UL,cimg::nearest_pow2(n))];
33977  }
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
cimg::superset< t1, t2 >::type max(const t1 &a, const t2 &b)
Return the maximum value between two numbers.
Definition: CImg.h:4749
const NT & n
unsigned int nearest_pow2(const T x)
Return the nearest power of 2 higher than a given number.
Definition: CImg.h:4776
unsigned int allocated_width
Allocation size of the list.
Definition: CImg.h:33886
CImgList ( const unsigned int  n,
const unsigned int  width,
const unsigned int  height = 1,
const unsigned int  depth = 1,
const unsigned int  dim = 1 
)
inline

Construct an image list containing n images with specified size.

Definition at line 33980 of file CImg.h.

33981  :
33982  width(0),allocated_width(0),data(0) {
33983  assign(n);
33984  cimglist_apply(*this,assign)(width,height,depth,dim);
33985  }
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
#define cimglist_apply(list, fn)
Definition: CImg.h:1881
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
const NT & n
unsigned int allocated_width
Allocation size of the list.
Definition: CImg.h:33886
CImgList ( const unsigned int  n,
const unsigned int  width,
const unsigned int  height,
const unsigned int  depth,
const unsigned int  dim,
const T  val 
)
inline

Construct an image list containing n images with specified size, filled with specified value.

Definition at line 33988 of file CImg.h.

33989  :
33990  width(0),allocated_width(0),data(0) {
33991  assign(n);
33992  cimglist_apply(*this,assign)(width,height,depth,dim,val);
33993  }
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
#define cimglist_apply(list, fn)
Definition: CImg.h:1881
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
const NT & n
unsigned int allocated_width
Allocation size of the list.
Definition: CImg.h:33886
CImgList ( const unsigned int  n,
const unsigned int  width,
const unsigned int  height,
const unsigned int  depth,
const unsigned int  dim,
const int  val0,
const int  val1,
  ... 
)
inline

Construct an image list containing n images with specified size and specified pixel values (int version).

Definition at line 33996 of file CImg.h.

33997  :
33998  width(0),allocated_width(0),data(0) {
33999 #define _CImgList_stdarg(t) { \
34000  assign(n,width,height,depth,dim); \
34001  const unsigned int siz = width*height*depth*dim, nsiz = siz*n; \
34002  T *ptrd = data->data; \
34003  va_list ap; \
34004  va_start(ap,val1); \
34005  for (unsigned int l = 0, s = 0, i = 0; i<nsiz; ++i) { \
34006  *(ptrd++) = (T)(i==0?val0:(i==1?val1:va_arg(ap,t))); \
34007  if ((++s)==siz) { ptrd = data[++l].data; s = 0; } \
34008  } \
34009  va_end(ap); \
34010  }
34011  _CImgList_stdarg(int);
34012  }
#define _CImgList_stdarg(t)
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
unsigned int allocated_width
Allocation size of the list.
Definition: CImg.h:33886
CImgList ( const unsigned int  n,
const unsigned int  width,
const unsigned int  height,
const unsigned int  depth,
const unsigned int  dim,
const double  val0,
const double  val1,
  ... 
)
inline

Construct an image list containing n images with specified size and specified pixel values (double version).

Definition at line 34015 of file CImg.h.

34016  :
34017  width(0),allocated_width(0),data(0) {
34018  _CImgList_stdarg(double);
34019  }
#define _CImgList_stdarg(t)
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
unsigned int allocated_width
Allocation size of the list.
Definition: CImg.h:33886
CImgList ( const unsigned int  n,
const CImg< t > &  img,
const bool  shared = false 
)
inline

Construct a list containing n copies of the image img.

Definition at line 34023 of file CImg.h.

34023  :width(0),allocated_width(0),data(0) {
34024  assign(n);
34025  cimglist_apply(*this,assign)(img,shared);
34026  }
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
#define cimglist_apply(list, fn)
Definition: CImg.h:1881
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
const NT & n
unsigned int allocated_width
Allocation size of the list.
Definition: CImg.h:33886
CImgList ( const CImg< t > &  img,
const bool  shared = false 
)
inlineexplicit

Construct an image list from one image.

Definition at line 34030 of file CImg.h.

34030  :width(0),allocated_width(0),data(0) {
34031  assign(1);
34032  data[0].assign(img,shared);
34033  }
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
unsigned int allocated_width
Allocation size of the list.
Definition: CImg.h:33886
CImgList ( const CImg< t1 > &  img1,
const CImg< t2 > &  img2,
const bool  shared = false 
)
inline

Construct an image list from two images.

Definition at line 34037 of file CImg.h.

34037  :width(0),allocated_width(0),data(0) {
34038  assign(2);
34039  data[0].assign(img1,shared); data[1].assign(img2,shared);
34040  }
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
unsigned int allocated_width
Allocation size of the list.
Definition: CImg.h:33886
CImgList ( const CImg< t1 > &  img1,
const CImg< t2 > &  img2,
const CImg< t3 > &  img3,
const bool  shared = false 
)
inline

Construct an image list from three images.

Definition at line 34044 of file CImg.h.

34044  :
34045  width(0),allocated_width(0),data(0) {
34046  assign(3);
34047  data[0].assign(img1,shared); data[1].assign(img2,shared); data[2].assign(img3,shared);
34048  }
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
unsigned int allocated_width
Allocation size of the list.
Definition: CImg.h:33886
CImgList ( const CImg< t1 > &  img1,
const CImg< t2 > &  img2,
const CImg< t3 > &  img3,
const CImg< t4 > &  img4,
const bool  shared = false 
)
inline

Construct an image list from four images.

Definition at line 34052 of file CImg.h.

34052  :
34053  width(0),allocated_width(0),data(0) {
34054  assign(4);
34055  data[0].assign(img1,shared); data[1].assign(img2,shared); data[2].assign(img3,shared); data[3].assign(img4,shared);
34056  }
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
unsigned int allocated_width
Allocation size of the list.
Definition: CImg.h:33886
CImgList ( const CImg< t1 > &  img1,
const CImg< t2 > &  img2,
const CImg< t3 > &  img3,
const CImg< t4 > &  img4,
const CImg< t5 > &  img5,
const bool  shared = false 
)
inline

Construct an image list from five images.

Definition at line 34060 of file CImg.h.

34061  :
34062  width(0),allocated_width(0),data(0) {
34063  assign(5);
34064  data[0].assign(img1,shared); data[1].assign(img2,shared); data[2].assign(img3,shared); data[3].assign(img4,shared);
34065  data[4].assign(img5,shared);
34066  }
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
unsigned int allocated_width
Allocation size of the list.
Definition: CImg.h:33886
CImgList ( const CImg< t1 > &  img1,
const CImg< t2 > &  img2,
const CImg< t3 > &  img3,
const CImg< t4 > &  img4,
const CImg< t5 > &  img5,
const CImg< t6 > &  img6,
const bool  shared = false 
)
inline

Construct an image list from six images.

Definition at line 34070 of file CImg.h.

34071  :
34072  width(0),allocated_width(0),data(0) {
34073  assign(6);
34074  data[0].assign(img1,shared); data[1].assign(img2,shared); data[2].assign(img3,shared); data[3].assign(img4,shared);
34075  data[4].assign(img5,shared); data[5].assign(img6,shared);
34076  }
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
unsigned int allocated_width
Allocation size of the list.
Definition: CImg.h:33886
CImgList ( const CImg< t1 > &  img1,
const CImg< t2 > &  img2,
const CImg< t3 > &  img3,
const CImg< t4 > &  img4,
const CImg< t5 > &  img5,
const CImg< t6 > &  img6,
const CImg< t7 > &  img7,
const bool  shared = false 
)
inline

Construct an image list from seven images.

Definition at line 34080 of file CImg.h.

34081  :
34082  width(0),allocated_width(0),data(0) {
34083  assign(7);
34084  data[0].assign(img1,shared); data[1].assign(img2,shared); data[2].assign(img3,shared); data[3].assign(img4,shared);
34085  data[4].assign(img5,shared); data[5].assign(img6,shared); data[6].assign(img7,shared);
34086  }
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
unsigned int allocated_width
Allocation size of the list.
Definition: CImg.h:33886
CImgList ( const CImg< t1 > &  img1,
const CImg< t2 > &  img2,
const CImg< t3 > &  img3,
const CImg< t4 > &  img4,
const CImg< t5 > &  img5,
const CImg< t6 > &  img6,
const CImg< t7 > &  img7,
const CImg< t8 > &  img8,
const bool  shared = false 
)
inline

Construct an image list from eight images.

Definition at line 34090 of file CImg.h.

34091  :
34092  width(0),allocated_width(0),data(0) {
34093  assign(8);
34094  data[0].assign(img1,shared); data[1].assign(img2,shared); data[2].assign(img3,shared); data[3].assign(img4,shared);
34095  data[4].assign(img5,shared); data[5].assign(img6,shared); data[6].assign(img7,shared); data[7].assign(img8,shared);
34096  }
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
unsigned int allocated_width
Allocation size of the list.
Definition: CImg.h:33886
CImgList ( const CImgList< t > &  list)
inline

Default copy constructor.

Definition at line 34100 of file CImg.h.

34100  :width(0),allocated_width(0),data(0) {
34101  assign(list.width);
34102  cimglist_for(*this,l) data[l].assign(list[l],false);
34103  }
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
#define cimglist_for(list, l)
Definition: CImg.h:1877
unsigned int allocated_width
Allocation size of the list.
Definition: CImg.h:33886
CImgList ( const CImgList< T > &  list)
inline

Definition at line 34105 of file CImg.h.

34105  :width(0),allocated_width(0),data(0) {
34106  assign(list.width);
34107  cimglist_for(*this,l) data[l].assign(list[l],list[l].is_shared);
34108  }
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
#define cimglist_for(list, l)
Definition: CImg.h:1877
unsigned int allocated_width
Allocation size of the list.
Definition: CImg.h:33886
CImgList ( const CImgList< t > &  list,
const bool  shared 
)
inline

Advanced copy constructor.

Definition at line 34112 of file CImg.h.

34112  :width(0),allocated_width(0),data(0) {
34113  assign(list.width);
34114  cimglist_for(*this,l) data[l].assign(list[l],shared);
34115  }
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
#define cimglist_for(list, l)
Definition: CImg.h:1877
unsigned int allocated_width
Allocation size of the list.
Definition: CImg.h:33886
CImgList ( const char *const  filename)
inlineexplicit

Construct an image list from a filename.

Definition at line 34118 of file CImg.h.

34118  :width(0),allocated_width(0),data(0) {
34119  assign(filename);
34120  }
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
unsigned int allocated_width
Allocation size of the list.
Definition: CImg.h:33886
CImgList ( const CImgDisplay disp)
inlineexplicit

Construct an image list from a display.

Definition at line 34123 of file CImg.h.

34123  :width(0),allocated_width(0),data(0) {
34124  assign(disp);
34125  }
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
unsigned int allocated_width
Allocation size of the list.
Definition: CImg.h:33886

Member Function Documentation

T& _atN ( const int  pos,
const int  x = 0,
const int  y = 0,
const int  z = 0,
const int  v = 0 
)
inline

Definition at line 34703 of file CImg.h.

Referenced by CImgList< uintT >::atN().

34703  {
34704  return data[pos<0?0:(pos>=(int)width?(int)width-1:pos)](x,y,z,v);
34705  }
void int int REAL REAL * y
Definition: read.cpp:74
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
void int int int REAL REAL REAL * z
Definition: write.cpp:76
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
void int int REAL * x
Definition: read.cpp:74

Here is the caller graph for this function:

T _atN ( const int  pos,
const int  x = 0,
const int  y = 0,
const int  z = 0,
const int  v = 0 
) const
inline

Definition at line 34707 of file CImg.h.

34707  {
34708  return data[pos<0?0:(pos>=(int)width?(int)width-1:pos)](x,y,z,v);
34709  }
void int int REAL REAL * y
Definition: read.cpp:74
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
void int int int REAL REAL REAL * z
Definition: write.cpp:76
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
void int int REAL * x
Definition: read.cpp:74
T& _atNX ( const int  pos,
const int  x,
const int  y = 0,
const int  z = 0,
const int  v = 0 
)
inline

Definition at line 34671 of file CImg.h.

Referenced by CImgList< uintT >::atNX().

34671  {
34672  return data[pos<0?0:(pos>=(int)width?(int)width-1:pos)].atX(x,y,z,v);
34673  }
void int int REAL REAL * y
Definition: read.cpp:74
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
void int int int REAL REAL REAL * z
Definition: write.cpp:76
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
void int int REAL * x
Definition: read.cpp:74

Here is the caller graph for this function:

T _atNX ( const int  pos,
const int  x,
const int  y = 0,
const int  z = 0,
const int  v = 0 
) const
inline

Definition at line 34675 of file CImg.h.

34675  {
34676  return data[pos<0?0:(pos>=(int)width?(int)width-1:pos)].atX(x,y,z,v);
34677  }
void int int REAL REAL * y
Definition: read.cpp:74
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
void int int int REAL REAL REAL * z
Definition: write.cpp:76
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
void int int REAL * x
Definition: read.cpp:74
T& _atNXY ( const int  pos,
const int  x,
const int  y,
const int  z = 0,
const int  v = 0 
)
inline

Definition at line 34639 of file CImg.h.

Referenced by CImgList< uintT >::atNXY().

34639  {
34640  return data[pos<0?0:(pos>=(int)width?(int)width-1:pos)].atXY(x,y,z,v);
34641  }
void int int REAL REAL * y
Definition: read.cpp:74
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
void int int int REAL REAL REAL * z
Definition: write.cpp:76
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
void int int REAL * x
Definition: read.cpp:74

Here is the caller graph for this function:

T _atNXY ( const int  pos,
const int  x,
const int  y,
const int  z = 0,
const int  v = 0 
) const
inline

Definition at line 34643 of file CImg.h.

34643  {
34644  return data[pos<0?0:(pos>=(int)width?(int)width-1:pos)].atXY(x,y,z,v);
34645  }
void int int REAL REAL * y
Definition: read.cpp:74
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
void int int int REAL REAL REAL * z
Definition: write.cpp:76
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
void int int REAL * x
Definition: read.cpp:74
T& _atNXYZ ( const int  pos,
const int  x,
const int  y,
const int  z,
const int  v = 0 
)
inline

Definition at line 34607 of file CImg.h.

Referenced by CImgList< uintT >::atNXYZ().

34607  {
34608  return data[pos<0?0:(pos>=(int)width?(int)width-1:pos)].atXYZ(x,y,z,v);
34609  }
void int int REAL REAL * y
Definition: read.cpp:74
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
void int int int REAL REAL REAL * z
Definition: write.cpp:76
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
void int int REAL * x
Definition: read.cpp:74

Here is the caller graph for this function:

T _atNXYZ ( const int  pos,
const int  x,
const int  y,
const int  z,
const int  v = 0 
) const
inline

Definition at line 34611 of file CImg.h.

34611  {
34612  return data[pos<0?0:(pos>=(int)width?(int)width-1:pos)].atXYZ(x,y,z,v);
34613  }
void int int REAL REAL * y
Definition: read.cpp:74
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
void int int int REAL REAL REAL * z
Definition: write.cpp:76
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
void int int REAL * x
Definition: read.cpp:74
T& _atNXYZV ( const int  pos,
const int  x,
const int  y,
const int  z,
const int  v 
)
inline

Definition at line 34575 of file CImg.h.

Referenced by CImgList< uintT >::atNXYZV().

34575  {
34576  return data[pos<0?0:(pos>=(int)width?(int)width-1:pos)].atXYZV(x,y,z,v);
34577  }
void int int REAL REAL * y
Definition: read.cpp:74
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
void int int int REAL REAL REAL * z
Definition: write.cpp:76
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
void int int REAL * x
Definition: read.cpp:74

Here is the caller graph for this function:

T _atNXYZV ( const int  pos,
const int  x,
const int  y,
const int  z,
const int  v 
) const
inline

Definition at line 34579 of file CImg.h.

34579  {
34580  return data[pos<0?0:(pos>=(int)width?(int)width-1:pos)].atXYZV(x,y,z,v);
34581  }
void int int REAL REAL * y
Definition: read.cpp:74
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
void int int int REAL REAL REAL * z
Definition: write.cpp:76
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
void int int REAL * x
Definition: read.cpp:74
static CImgList<T> _font ( const unsigned int *const  font,
const unsigned int  w,
const unsigned int  h,
const unsigned int  paddingx,
const unsigned int  paddingy,
const bool  variable_size = true 
)
inlinestatic

Definition at line 37097 of file CImg.h.

Referenced by CImgList< uintT >::font().

37098  {
37099  CImgList<T> res = CImgList<T>(256,w,h,1,3);
37100  res.insert(256); cimglist_for_in(res,256,511,l) res[l].assign(w,h,1,1);
37101  const unsigned int *ptr = font;
37102  unsigned int m = 0, val = 0;
37103  for (unsigned int y = 0; y<h; ++y)
37104  for (unsigned int x = 0; x<256*w; ++x) {
37105  m>>=1; if (!m) { m = 0x80000000; val = *(ptr++); }
37106  CImg<T>& img = res[x/w], &mask = res[x/w+256];
37107  unsigned int xm = x%w;
37108  img(xm,y,0) = img(xm,y,1) = img(xm,y,2) = mask(xm,y,0) = (T)((val&m)?1:0);
37109  }
37110  if (variable_size) res.crop_font();
37111  if (paddingx || paddingy) cimglist_for(res,l) res[l].resize(res[l].dimx() + paddingx,res[l].dimy() + paddingy,1,-100,0);
37112  return res;
37113  }
CImg< T > * ptr()
Return a pointer to the image buffer.
Definition: CImg.h:34475
void int int REAL REAL * y
Definition: read.cpp:74
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
void int int REAL * x
Definition: read.cpp:74
#define cimglist_for(list, l)
Definition: CImg.h:1877
std::vector< std::vector< bool > > mask
Masks the points that are shared (true) share (false) not shared.
Definition: hdf2pltV2.C:62
for(;;)
#define cimglist_for_in(list, l0, l1, l)
Definition: CImg.h:1878
static CImgList< T > font(const unsigned int font_width, const bool variable_size=true)
Return a CImg pre-defined font with desired size.
Definition: CImg.h:37048
int dimx() const
Return the size of the list.
Definition: CImg.h:34465

Here is the caller graph for this function:

CImgList<T>& _load_cimg ( std::FILE *const  file,
const char *const  filename 
)
inline

Definition at line 35550 of file CImg.h.

Referenced by CImgList< uintT >::load_cimg().

35550  {
35551 #ifdef cimg_use_zlib
35552 #define _cimgz_load_cimg_case(Tss) { \
35553  Bytef *const cbuf = new Bytef[csiz]; \
35554  cimg::fread(cbuf,csiz,nfile); \
35555  raw.assign(W,H,D,V); \
35556  unsigned long destlen = (unsigned long)raw.size()*sizeof(T); \
35557  uncompress((Bytef*)raw.data,&destlen,cbuf,csiz); \
35558  delete[] cbuf; \
35559  const Tss *ptrs = raw.data; \
35560  for (unsigned int off = raw.size(); off; --off) *(ptrd++) = (T)*(ptrs++); \
35561 }
35562 #else
35563 #define _cimgz_load_cimg_case(Tss) \
35564  throw CImgIOException("CImgList<%s>::load_cimg() : File '%s' contains compressed data, zlib must be used",\
35565  pixel_type(),filename?filename:"(FILE*)");
35566 #endif
35567 
35568 #define _cimg_load_cimg_case(Ts,Tss) \
35569  if (!loaded && !cimg::strcasecmp(Ts,str_pixeltype)) { \
35570  for (unsigned int l = 0; l<N; ++l) { \
35571  j = 0; while ((i=std::fgetc(nfile))!='\n' && i>=0) tmp[j++] = (char)i; tmp[j] = 0; \
35572  W = H = D = V = 0; csiz = 0; \
35573  if ((err = std::sscanf(tmp,"%u %u %u %u #%u",&W,&H,&D,&V,&csiz))<4) \
35574  throw CImgIOException("CImgList<%s>::load_cimg() : File '%s', Image %u has an invalid size (%u,%u,%u,%u)\n", \
35575  pixel_type(),filename?filename:("(FILE*)"),W,H,D,V); \
35576  if (W*H*D*V>0) { \
35577  CImg<Tss> raw; \
35578  CImg<T> &img = data[l]; \
35579  img.assign(W,H,D,V); \
35580  T *ptrd = img.data; \
35581  if (err==5) _cimgz_load_cimg_case(Tss) \
35582  else for (int toread = (int)img.size(); toread>0; ) { \
35583  raw.assign(cimg::min(toread,cimg_iobuffer)); \
35584  cimg::fread(raw.data,raw.width,nfile); \
35585  if (endian!=cimg::endianness()) cimg::invert_endianness(raw.data,raw.width); \
35586  toread-=raw.width; \
35587  const Tss *ptrs = raw.data; \
35588  for (unsigned int off = raw.width; off; --off) *(ptrd++) = (T)*(ptrs++); \
35589  } \
35590  } \
35591  } \
35592  loaded = true; \
35593  }
35594 
35595  if (!filename && !file)
35596  throw CImgArgumentException("CImgList<%s>::load_cimg() : Cannot load (null) filename.",
35597  pixel_type());
35598  typedef unsigned char uchar;
35599  typedef unsigned short ushort;
35600  typedef unsigned int uint;
35601  typedef unsigned long ulong;
35602  const int cimg_iobuffer = 12*1024*1024;
35603  std::FILE *const nfile = file?file:cimg::fopen(filename,"rb");
35604  bool loaded = false, endian = cimg::endianness();
35605  char tmp[256] = { 0 }, str_pixeltype[256] = { 0 }, str_endian[256] = { 0 };
35606  unsigned int j, err, N = 0, W, H, D, V, csiz;
35607  int i;
35608  j = 0; while((i=std::fgetc(nfile))!='\n' && i!=EOF && j<256) tmp[j++] = (char)i; tmp[j] = 0;
35609  err = std::sscanf(tmp,"%u%*c%255[A-Za-z_]%*c%255[sA-Za-z_ ]",&N,str_pixeltype,str_endian);
35610  if (err<2) {
35611  if (!file) cimg::fclose(nfile);
35612  throw CImgIOException("CImgList<%s>::load_cimg() : File '%s', Unknow CImg RAW header.",
35613  pixel_type(),filename?filename:"(FILE*)");
35614  }
35615  if (!cimg::strncasecmp("little",str_endian,6)) endian = false;
35616  else if (!cimg::strncasecmp("big",str_endian,3)) endian = true;
35617  assign(N);
35618  _cimg_load_cimg_case("bool",bool);
35619  _cimg_load_cimg_case("unsigned_char",uchar);
35620  _cimg_load_cimg_case("uchar",uchar);
35621  _cimg_load_cimg_case("char",char);
35622  _cimg_load_cimg_case("unsigned_short",ushort);
35623  _cimg_load_cimg_case("ushort",ushort);
35624  _cimg_load_cimg_case("short",short);
35625  _cimg_load_cimg_case("unsigned_int",uint);
35626  _cimg_load_cimg_case("uint",uint);
35627  _cimg_load_cimg_case("int",int);
35628  _cimg_load_cimg_case("unsigned_long",ulong);
35629  _cimg_load_cimg_case("ulong",ulong);
35630  _cimg_load_cimg_case("long",long);
35631  _cimg_load_cimg_case("float",float);
35632  _cimg_load_cimg_case("double",double);
35633  if (!loaded) {
35634  if (!file) cimg::fclose(nfile);
35635  throw CImgIOException("CImgList<%s>::load_cimg() : File '%s', cannot read images of pixels coded as '%s'.",
35636  pixel_type(),filename?filename:"(FILE*)",str_pixeltype);
35637  }
35638  if (!file) cimg::fclose(nfile);
35639  return *this;
35640  }
#define _cimg_load_cimg_case(Ts, Tss)
bool endianness()
Return the current endianness of the CPU.
Definition: CImg.h:4572
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
int fclose(std::FILE *file)
Close a file, and check for possible errors.
Definition: CImg.h:5507
int strncasecmp(const char *const s1, const char *const s2, const int l)
Compare the first n characters of two C-strings, ignoring the case.
Definition: CImg.h:4915
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
blockLoc i
Definition: read.cpp:79
j indices j
Definition: Indexing.h:6
std::FILE * fopen(const char *const path, const char *const mode)
Open a file, and check for possible errors.
Definition: CImg.h:5494

Here is the caller graph for this function:

CImgList<T>& _load_cimg ( std::FILE *const  file,
const char *const  filename,
const unsigned int  n0,
const unsigned int  n1,
const unsigned int  x0,
const unsigned int  y0,
const unsigned int  z0,
const unsigned int  v0,
const unsigned int  x1,
const unsigned int  y1,
const unsigned int  z1,
const unsigned int  v1 
)
inline

Definition at line 35672 of file CImg.h.

35675  {
35676 #define _cimg_load_cimg_case2(Ts,Tss) \
35677  if (!loaded && !cimg::strcasecmp(Ts,str_pixeltype)) { \
35678  for (unsigned int l = 0; l<=nn1; ++l) { \
35679  j = 0; while ((i=std::fgetc(nfile))!='\n' && i>=0) tmp[j++] = (char)i; tmp[j] = 0; \
35680  W = H = D = V = 0; \
35681  if (std::sscanf(tmp,"%u %u %u %u",&W,&H,&D,&V)!=4) \
35682  throw CImgIOException("CImgList<%s>::load_cimg() : File '%s', Image %u has an invalid size (%u,%u,%u,%u)\n", \
35683  pixel_type(), filename?filename:("(FILE*)"), W, H, D, V); \
35684  if (W*H*D*V>0) { \
35685  if (l<n0 || x0>=W || y0>=H || z0>=D || v0>=D) std::fseek(nfile,W*H*D*V*sizeof(Tss),SEEK_CUR); \
35686  else { \
35687  const unsigned int \
35688  nx1 = x1>=W?W-1:x1, \
35689  ny1 = y1>=H?H-1:y1, \
35690  nz1 = z1>=D?D-1:z1, \
35691  nv1 = v1>=V?V-1:v1; \
35692  CImg<Tss> raw(1 + nx1 - x0); \
35693  CImg<T> &img = data[l - n0]; \
35694  img.assign(1 + nx1 - x0,1 + ny1 - y0,1 + nz1 - z0,1 + nv1 - v0); \
35695  T *ptrd = img.data; \
35696  const unsigned int skipvb = v0*W*H*D*sizeof(Tss); \
35697  if (skipvb) std::fseek(nfile,skipvb,SEEK_CUR); \
35698  for (unsigned int v = 1 + nv1 - v0; v; --v) { \
35699  const unsigned int skipzb = z0*W*H*sizeof(Tss); \
35700  if (skipzb) std::fseek(nfile,skipzb,SEEK_CUR); \
35701  for (unsigned int z = 1 + nz1 - z0; z; --z) { \
35702  const unsigned int skipyb = y0*W*sizeof(Tss); \
35703  if (skipyb) std::fseek(nfile,skipyb,SEEK_CUR); \
35704  for (unsigned int y = 1 + ny1 - y0; y; --y) { \
35705  const unsigned int skipxb = x0*sizeof(Tss); \
35706  if (skipxb) std::fseek(nfile,skipxb,SEEK_CUR); \
35707  cimg::fread(raw.data,raw.width,nfile); \
35708  if (endian!=cimg::endianness()) cimg::invert_endianness(raw.data,raw.width); \
35709  const Tss *ptrs = raw.data; \
35710  for (unsigned int off = raw.width; off; --off) *(ptrd++) = (T)*(ptrs++); \
35711  const unsigned int skipxe = (W-1-nx1)*sizeof(Tss); \
35712  if (skipxe) std::fseek(nfile,skipxe,SEEK_CUR); \
35713  } \
35714  const unsigned int skipye = (H-1-ny1)*W*sizeof(Tss); \
35715  if (skipye) std::fseek(nfile,skipye,SEEK_CUR); \
35716  } \
35717  const unsigned int skipze = (D-1-nz1)*W*H*sizeof(Tss); \
35718  if (skipze) std::fseek(nfile,skipze,SEEK_CUR); \
35719  } \
35720  const unsigned int skipve = (V-1-nv1)*W*H*D*sizeof(Tss); \
35721  if (skipve) std::fseek(nfile,skipve,SEEK_CUR); \
35722  } \
35723  } \
35724  } \
35725  loaded = true; \
35726  }
35727 
35728  if (!filename && !file)
35729  throw CImgArgumentException("CImgList<%s>::load_cimg() : Cannot load (null) filename.",
35730  pixel_type());
35731  typedef unsigned char uchar;
35732  typedef unsigned short ushort;
35733  typedef unsigned int uint;
35734  typedef unsigned long ulong;
35735  if (n1<n0 || x1<x0 || y1<y0 || z1<z0 || v1<v0)
35736  throw CImgArgumentException("CImgList<%s>::load_cimg() : File '%s', Bad sub-region coordinates [%u->%u] "
35737  "(%u,%u,%u,%u)->(%u,%u,%u,%u).",
35738  pixel_type(),filename?filename:"(FILE*)",
35739  n0,n1,x0,y0,z0,v0,x1,y1,z1,v1);
35740  std::FILE *const nfile = file?file:cimg::fopen(filename,"rb");
35741  bool loaded = false, endian = cimg::endianness();
35742  char tmp[256] = { 0 }, str_pixeltype[256] = { 0 }, str_endian[256] = { 0 };
35743  unsigned int j, err, N, W, H, D, V;
35744  int i;
35745  j = 0; while((i=std::fgetc(nfile))!='\n' && i!=EOF && j<256) tmp[j++] = (char)i; tmp[j] = 0;
35746  err = std::sscanf(tmp,"%u%*c%255[A-Za-z_]%*c%255[sA-Za-z_ ]",&N,str_pixeltype,str_endian);
35747  if (err<2) {
35748  if (!file) cimg::fclose(nfile);
35749  throw CImgIOException("CImgList<%s>::load_cimg() : File '%s', Unknow CImg RAW header.",
35750  pixel_type(),filename?filename:"(FILE*)");
35751  }
35752  if (!cimg::strncasecmp("little",str_endian,6)) endian = false;
35753  else if (!cimg::strncasecmp("big",str_endian,3)) endian = true;
35754  const unsigned int nn1 = n1>=N?N-1:n1;
35755  assign(1+nn1-n0);
35756  _cimg_load_cimg_case2("bool",bool);
35757  _cimg_load_cimg_case2("unsigned_char",uchar);
35758  _cimg_load_cimg_case2("uchar",uchar);
35759  _cimg_load_cimg_case2("char",char);
35760  _cimg_load_cimg_case2("unsigned_short",ushort);
35761  _cimg_load_cimg_case2("ushort",ushort);
35762  _cimg_load_cimg_case2("short",short);
35763  _cimg_load_cimg_case2("unsigned_int",uint);
35764  _cimg_load_cimg_case2("uint",uint);
35765  _cimg_load_cimg_case2("int",int);
35766  _cimg_load_cimg_case2("unsigned_long",ulong);
35767  _cimg_load_cimg_case2("ulong",ulong);
35768  _cimg_load_cimg_case2("long",long);
35769  _cimg_load_cimg_case2("float",float);
35770  _cimg_load_cimg_case2("double",double);
35771  if (!loaded) {
35772  if (!file) cimg::fclose(nfile);
35773  throw CImgIOException("CImgList<%s>::load_cimg() : File '%s', cannot read images of pixels coded as '%s'.",
35774  pixel_type(),filename?filename:"(FILE*)",str_pixeltype);
35775  }
35776  if (!file) cimg::fclose(nfile);
35777  return *this;
35778  }
bool endianness()
Return the current endianness of the CPU.
Definition: CImg.h:4572
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
int fclose(std::FILE *file)
Close a file, and check for possible errors.
Definition: CImg.h:5507
int strncasecmp(const char *const s1, const char *const s2, const int l)
Compare the first n characters of two C-strings, ignoring the case.
Definition: CImg.h:4915
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
blockLoc i
Definition: read.cpp:79
j indices j
Definition: Indexing.h:6
#define _cimg_load_cimg_case2(Ts, Tss)
std::FILE * fopen(const char *const path, const char *const mode)
Open a file, and check for possible errors.
Definition: CImg.h:5494
CImgList<T>& _load_yuv ( std::FILE *const  file,
const char *const  filename,
const unsigned int  sizex,
const unsigned int  sizey,
const unsigned int  first_frame,
const unsigned int  last_frame,
const unsigned int  step_frame,
const bool  yuv2rgb 
)
inline

Definition at line 35904 of file CImg.h.

Referenced by CImgList< uintT >::load_yuv().

35907  {
35908  if (!filename && !file)
35909  throw CImgArgumentException("CImgList<%s>::load_yuv() : Cannot load (null) filename.",
35910  pixel_type());
35911  if (sizex%2 || sizey%2)
35912  throw CImgArgumentException("CImgList<%s>::load_yuv() : File '%s', image dimensions along X and Y must be "
35913  "even numbers (given are %ux%u)\n",
35914  pixel_type(),filename?filename:"(FILE*)",sizex,sizey);
35915  if (!sizex || !sizey)
35916  throw CImgArgumentException("CImgList<%s>::load_yuv() : File '%s', given image sequence size (%u,%u) is invalid",
35917  pixel_type(),filename?filename:"(FILE*)",sizex,sizey);
35918 
35919  const unsigned int
35920  nfirst_frame = first_frame<last_frame?first_frame:last_frame,
35921  nlast_frame = first_frame<last_frame?last_frame:first_frame,
35922  nstep_frame = step_frame?step_frame:1;
35923 
35924  CImg<ucharT> tmp(sizex,sizey,1,3), UV(sizex/2,sizey/2,1,2);
35925  std::FILE *const nfile = file?file:cimg::fopen(filename,"rb");
35926  bool stopflag = false;
35927  int err;
35928  if (nfirst_frame) {
35929  err = std::fseek(nfile,nfirst_frame*(sizex*sizey + sizex*sizey/2),SEEK_CUR);
35930  if (err) {
35931  if (!file) cimg::fclose(nfile);
35932  throw CImgIOException("CImgList<%s>::load_yuv() : File '%s' doesn't contain frame number %u "
35933  "(out of range error).",
35934  pixel_type(),filename?filename:"(FILE*)",nfirst_frame);
35935  }
35936  }
35937  unsigned int frame;
35938  for (frame = nfirst_frame; !stopflag && frame<=nlast_frame; frame+=nstep_frame) {
35939  tmp.fill(0);
35940  // *TRY* to read the luminance part, do not replace by cimg::fread !
35941  err = (int)std::fread((void*)(tmp.data),1,(size_t)(tmp.width*tmp.height),nfile);
35942  if (err!=(int)(tmp.width*tmp.height)) {
35943  stopflag = true;
35944  if (err>0)
35945  cimg::warn("CImgList<%s>::load_yuv() : File '%s' contains incomplete data,"
35946  " or given image dimensions (%u,%u) are incorrect.",
35947  pixel_type(),filename?filename:"(FILE*)",sizex,sizey);
35948  } else {
35949  UV.fill(0);
35950  // *TRY* to read the luminance part, do not replace by cimg::fread !
35951  err = (int)std::fread((void*)(UV.data),1,(size_t)(UV.size()),nfile);
35952  if (err!=(int)(UV.size())) {
35953  stopflag = true;
35954  if (err>0)
35955  cimg::warn("CImgList<%s>::load_yuv() : File '%s' contains incomplete data,"
35956  " or given image dimensions (%u,%u) are incorrect.",
35957  pixel_type(),filename?filename:"(FILE*)",sizex,sizey);
35958  } else {
35959  cimg_forXY(UV,x,y) {
35960  const int x2 = x*2, y2 = y*2;
35961  tmp(x2,y2,1) = tmp(x2+1,y2,1) = tmp(x2,y2+1,1) = tmp(x2+1,y2+1,1) = UV(x,y,0);
35962  tmp(x2,y2,2) = tmp(x2+1,y2,2) = tmp(x2,y2+1,2) = tmp(x2+1,y2+1,2) = UV(x,y,1);
35963  }
35964  if (yuv2rgb) tmp.YCbCrtoRGB();
35965  insert(tmp);
35966  if (nstep_frame>1) std::fseek(nfile,(nstep_frame-1)*(sizex*sizey + sizex*sizey/2),SEEK_CUR);
35967  }
35968  }
35969  }
35970  if (stopflag && nlast_frame!=~0U && frame!=nlast_frame)
35971  cimg::warn("CImgList<%s>::load_yuv() : File '%s', frame %d not reached since only %u frames were found in the file.",
35972  pixel_type(),filename?filename:"(FILE*)",nlast_frame,frame-1,filename);
35973  if (!file) cimg::fclose(nfile);
35974  return *this;
35975  }
int fread(T *const ptr, const unsigned int nmemb, std::FILE *stream)
Read file data, and check for possible errors.
Definition: CImg.h:5569
void warn(const char *format,...)
Display a warning message.
Definition: CImg.h:4470
void int int REAL REAL * y
Definition: read.cpp:74
int fclose(std::FILE *file)
Close a file, and check for possible errors.
Definition: CImg.h:5507
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
void int int REAL * x
Definition: read.cpp:74
#define cimg_forXY(img, x, y)
Definition: CImg.h:597
CImgList< T > & insert(const CImg< t > &img, const unsigned int pos=~0U, const bool shared=false)
Insert a copy of the image img into the current image list, at position pos.
Definition: CImg.h:35041
std::FILE * fopen(const char *const path, const char *const mode)
Open a file, and check for possible errors.
Definition: CImg.h:5494

Here is the caller graph for this function:

const CImgList<T>& _save_cimg ( std::FILE *const  file,
const char *const  filename,
const bool  compression 
) const
inline

Save an image list into a .cimg file.

A CImg RAW file is a simple uncompressed binary file that may be used to save list of CImg<T> images.

Parameters
filename: name of the output file.
Returns
A reference to the current CImgList instance is returned.

Definition at line 36700 of file CImg.h.

Referenced by CImgList< uintT >::save_cimg().

36700  {
36701  if (is_empty())
36702  throw CImgInstanceException("CImgList<%s>::save_cimg() : File '%s', instance list (%u,%p) is empty.",
36703  pixel_type(),filename?filename:"(FILE*)",width,data);
36704  if (!file && !filename)
36705  throw CImgArgumentException("CImg<%s>::save_cimg() : Instance list (%u,%p), specified file is (null).",
36706  pixel_type(),width,data);
36707  std::FILE *const nfile = file?file:cimg::fopen(filename,"wb");
36708  const char *const ptype = pixel_type(), *const etype = cimg::endianness()?"big":"little";
36709  if (std::strstr(ptype,"unsigned")==ptype) std::fprintf(nfile,"%u unsigned_%s %s_endian\n",width,ptype+9,etype);
36710  else std::fprintf(nfile,"%u %s %s_endian\n",width,ptype,etype);
36711  cimglist_for(*this,l) {
36712  const CImg<T>& img = data[l];
36713  std::fprintf(nfile,"%u %u %u %u",img.width,img.height,img.depth,img.dim);
36714  if (img.data) {
36715  CImg<T> tmp;
36716  if (cimg::endianness()) { tmp = img; cimg::invert_endianness(tmp.data,tmp.size()); }
36717  const CImg<T>& ref = cimg::endianness()?tmp:img;
36718  bool compressed = false;
36719  if (compression) {
36720 #ifdef cimg_use_zlib
36721  const unsigned long siz = sizeof(T)*ref.size();
36722  unsigned long csiz = siz + siz/100 + 16;
36723  Bytef *const cbuf = new Bytef[csiz];
36724  if (compress(cbuf,&csiz,(Bytef*)ref.data,siz)) {
36725  cimg::warn("CImgList<%s>::save_cimg() : File '%s', failed to save compressed data.\n Data will be saved uncompressed.",
36726  pixel_type(),filename?filename:"(FILE*)");
36727  compressed = false;
36728  } else {
36729  std::fprintf(nfile," #%lu\n",csiz);
36730  cimg::fwrite(cbuf,csiz,nfile);
36731  delete[] cbuf;
36732  compressed = true;
36733  }
36734 #else
36735  cimg::warn("CImgList<%s>::save_cimg() : File '%s', cannot save compressed data unless zlib is used "
36736  "('cimg_use_zlib' must be defined).\n Data will be saved uncompressed.",
36737  pixel_type(),filename?filename:"(FILE*)");
36738  compressed = false;
36739 #endif
36740  }
36741  if (!compressed) {
36742  std::fputc('\n',nfile);
36743  cimg::fwrite(ref.data,ref.size(),nfile);
36744  }
36745  } else std::fputc('\n',nfile);
36746  }
36747  if (!file) cimg::fclose(nfile);
36748  return *this;
36749  }
void warn(const char *format,...)
Display a warning message.
Definition: CImg.h:4470
bool endianness()
Return the current endianness of the CPU.
Definition: CImg.h:4572
int fclose(std::FILE *file)
Close a file, and check for possible errors.
Definition: CImg.h:5507
void invert_endianness(T *const buffer, const unsigned int size)
Invert endianness of a memory buffer.
Definition: CImg.h:4579
int fwrite(const T *ptr, const unsigned int nmemb, std::FILE *stream)
Write data to a file, and check for possible errors.
Definition: CImg.h:5587
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
#define cimglist_for(list, l)
Definition: CImg.h:1877
bool is_empty() const
Return true if list is empty.
Definition: CImg.h:34734
std::FILE * fopen(const char *const path, const char *const mode)
Open a file, and check for possible errors.
Definition: CImg.h:5494

Here is the caller graph for this function:

const CImgList<T>& _save_cimg ( std::FILE *const  file,
const char *const  filename,
const unsigned int  n0,
const unsigned int  x0,
const unsigned int  y0,
const unsigned int  z0,
const unsigned int  v0 
) const
inline

Definition at line 36762 of file CImg.h.

36765  {
36766 #define _cimg_save_cimg_case(Ts,Tss) \
36767  if (!saved && !cimg::strcasecmp(Ts,str_pixeltype)) { \
36768  for (unsigned int l = 0; l<lmax; ++l) { \
36769  j = 0; while((i=std::fgetc(nfile))!='\n') tmp[j++]=(char)i; tmp[j] = 0; \
36770  W = H = D = V = 0; \
36771  if (std::sscanf(tmp,"%u %u %u %u",&W,&H,&D,&V)!=4) \
36772  throw CImgIOException("CImgList<%s>::save_cimg() : File '%s', Image %u has an invalid size (%u,%u,%u,%u)\n", \
36773  pixel_type(), filename?filename:("(FILE*)"), W, H, D, V); \
36774  if (W*H*D*V>0) { \
36775  if (l<n0 || x0>=W || y0>=H || z0>=D || v0>=D) std::fseek(nfile,W*H*D*V*sizeof(Tss),SEEK_CUR); \
36776  else { \
36777  const CImg<T>& img = (*this)[l - n0]; \
36778  const T *ptrs = img.data; \
36779  const unsigned int \
36780  x1 = x0 + img.width - 1, \
36781  y1 = y0 + img.height - 1, \
36782  z1 = z0 + img.depth - 1, \
36783  v1 = v0 + img.dim - 1, \
36784  nx1 = x1>=W?W-1:x1, \
36785  ny1 = y1>=H?H-1:y1, \
36786  nz1 = z1>=D?D-1:z1, \
36787  nv1 = v1>=V?V-1:v1; \
36788  CImg<Tss> raw(1+nx1-x0); \
36789  const unsigned int skipvb = v0*W*H*D*sizeof(Tss); \
36790  if (skipvb) std::fseek(nfile,skipvb,SEEK_CUR); \
36791  for (unsigned int v = 1 + nv1 - v0; v; --v) { \
36792  const unsigned int skipzb = z0*W*H*sizeof(Tss); \
36793  if (skipzb) std::fseek(nfile,skipzb,SEEK_CUR); \
36794  for (unsigned int z = 1 + nz1 - z0; z; --z) { \
36795  const unsigned int skipyb = y0*W*sizeof(Tss); \
36796  if (skipyb) std::fseek(nfile,skipyb,SEEK_CUR); \
36797  for (unsigned int y = 1 + ny1 - y0; y; --y) { \
36798  const unsigned int skipxb = x0*sizeof(Tss); \
36799  if (skipxb) std::fseek(nfile,skipxb,SEEK_CUR); \
36800  raw.assign(ptrs, raw.width); \
36801  ptrs+=img.width; \
36802  if (endian) cimg::invert_endianness(raw.data,raw.width); \
36803  cimg::fwrite(raw.data,raw.width,nfile); \
36804  const unsigned int skipxe = (W - 1 - nx1)*sizeof(Tss); \
36805  if (skipxe) std::fseek(nfile,skipxe,SEEK_CUR); \
36806  } \
36807  const unsigned int skipye = (H - 1 - ny1)*W*sizeof(Tss); \
36808  if (skipye) std::fseek(nfile,skipye,SEEK_CUR); \
36809  } \
36810  const unsigned int skipze = (D - 1 - nz1)*W*H*sizeof(Tss); \
36811  if (skipze) std::fseek(nfile,skipze,SEEK_CUR); \
36812  } \
36813  const unsigned int skipve = (V - 1 - nv1)*W*H*D*sizeof(Tss); \
36814  if (skipve) std::fseek(nfile,skipve,SEEK_CUR); \
36815  } \
36816  } \
36817  } \
36818  saved = true; \
36819  }
36820  if (is_empty())
36821  throw CImgInstanceException("CImgList<%s>::save_cimg() : File '%s', instance list (%u,%p) is empty.",
36822  pixel_type(),filename?filename:"(FILE*)",width,data);
36823  if (!file && !filename)
36824  throw CImgArgumentException("CImg<%s>::save_cimg() : Instance list (%u,%p), specified file is (null).",
36825  pixel_type(),width,data);
36826  typedef unsigned char uchar;
36827  typedef unsigned short ushort;
36828  typedef unsigned int uint;
36829  typedef unsigned long ulong;
36830  std::FILE *const nfile = file?file:cimg::fopen(filename,"rb+");
36831  bool saved = false, endian = cimg::endianness();
36832  char tmp[256] = { 0 }, str_pixeltype[256] = { 0 }, str_endian[256] = { 0 };
36833  unsigned int j, err, N, W, H, D, V;
36834  int i;
36835  j = 0; while((i=std::fgetc(nfile))!='\n' && i!=EOF && j<256) tmp[j++] = (char)i; tmp[j] = 0;
36836  err = std::sscanf(tmp,"%u%*c%255[A-Za-z_]%*c%255[sA-Za-z_ ]",&N,str_pixeltype,str_endian);
36837  if (err<2) {
36838  if (!file) cimg::fclose(nfile);
36839  throw CImgIOException("CImgList<%s>::save_cimg() : File '%s', Unknow CImg RAW header.",
36840  pixel_type(),filename?filename:"(FILE*)");
36841  }
36842  if (!cimg::strncasecmp("little",str_endian,6)) endian = false;
36843  else if (!cimg::strncasecmp("big",str_endian,3)) endian = true;
36844  const unsigned int lmax = cimg::min(N,n0+width);
36845  _cimg_save_cimg_case("bool",bool);
36846  _cimg_save_cimg_case("unsigned_char",uchar);
36847  _cimg_save_cimg_case("uchar",uchar);
36848  _cimg_save_cimg_case("char",char);
36849  _cimg_save_cimg_case("unsigned_short",ushort);
36850  _cimg_save_cimg_case("ushort",ushort);
36851  _cimg_save_cimg_case("short",short);
36852  _cimg_save_cimg_case("unsigned_int",uint);
36853  _cimg_save_cimg_case("uint",uint);
36854  _cimg_save_cimg_case("int",int);
36855  _cimg_save_cimg_case("unsigned_long",ulong);
36856  _cimg_save_cimg_case("ulong",ulong);
36857  _cimg_save_cimg_case("long",long);
36858  _cimg_save_cimg_case("float",float);
36859  _cimg_save_cimg_case("double",double);
36860  if (!saved) {
36861  if (!file) cimg::fclose(nfile);
36862  throw CImgIOException("CImgList<%s>::save_cimg() : File '%s', cannot save images of pixels coded as '%s'.",
36863  pixel_type(),filename?filename:"(FILE*)",str_pixeltype);
36864  }
36865  if (!file) cimg::fclose(nfile);
36866  return *this;
36867  }
cimg::superset< t1, t2 >::type min(const t1 &a, const t2 &b)
Return the minimum value between two numbers.
Definition: CImg.h:4728
bool endianness()
Return the current endianness of the CPU.
Definition: CImg.h:4572
#define _cimg_save_cimg_case(Ts, Tss)
int fclose(std::FILE *file)
Close a file, and check for possible errors.
Definition: CImg.h:5507
int strncasecmp(const char *const s1, const char *const s2, const int l)
Compare the first n characters of two C-strings, ignoring the case.
Definition: CImg.h:4915
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
blockLoc i
Definition: read.cpp:79
j indices j
Definition: Indexing.h:6
bool is_empty() const
Return true if list is empty.
Definition: CImg.h:34734
std::FILE * fopen(const char *const path, const char *const mode)
Open a file, and check for possible errors.
Definition: CImg.h:5494
static void _save_empty_cimg ( std::FILE *const  file,
const char *const  filename,
const unsigned int  nb,
const unsigned int  dx,
const unsigned int  dy,
const unsigned int  dz,
const unsigned int  dv 
)
inlinestatic

Definition at line 36886 of file CImg.h.

Referenced by CImgList< uintT >::save_empty_cimg().

36889  {
36890  std::FILE *const nfile = file?file:cimg::fopen(filename,"wb");
36891  const unsigned int siz = dx*dy*dz*dv*sizeof(T);
36892  std::fprintf(nfile,"%u %s\n",nb,pixel_type());
36893  for (unsigned int i=nb; i; --i) {
36894  std::fprintf(nfile,"%u %u %u %u\n",dx,dy,dz,dv);
36895  for (unsigned int off=siz; off; --off) std::fputc(0,nfile);
36896  }
36897  if (!file) cimg::fclose(nfile);
36898  }
NT dx
int fclose(std::FILE *file)
Close a file, and check for possible errors.
Definition: CImg.h:5507
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
blockLoc i
Definition: read.cpp:79
NT dy
std::FILE * fopen(const char *const path, const char *const mode)
Open a file, and check for possible errors.
Definition: CImg.h:5494

Here is the caller graph for this function:

const CImgList<T>& _save_yuv ( std::FILE *const  file,
const char *const  filename,
const bool  rgb2yuv 
) const
inline

Definition at line 36661 of file CImg.h.

Referenced by CImgList< uintT >::save_yuv().

36661  {
36662  if (is_empty())
36663  throw CImgInstanceException("CImgList<%s>::save_yuv() : File '%s', instance list (%u,%p) is empty.",
36664  pixel_type(),filename?filename:"(FILE*)",width,data);
36665  if (!file && !filename)
36666  throw CImgArgumentException("CImg<%s>::save_yuv() : Instance list (%u,%p), specified file is (null).",
36667  pixel_type(),width,data);
36668  if ((*this)[0].dimx()%2 || (*this)[0].dimy()%2)
36669  throw CImgInstanceException("CImgList<%s>::save_yuv() : File '%s', image dimensions must be even numbers (current are %ux%u).",
36670  pixel_type(),filename?filename:"(FILE*)",(*this)[0].dimx(),(*this)[0].dimy());
36671 
36672  std::FILE *const nfile = file?file:cimg::fopen(filename,"wb");
36673  cimglist_for(*this,l) {
36674  CImg<ucharT> YCbCr((*this)[l]);
36675  if (rgb2yuv) YCbCr.RGBtoYCbCr();
36676  cimg::fwrite(YCbCr.data,YCbCr.width*YCbCr.height,nfile);
36677  cimg::fwrite(YCbCr.get_resize(YCbCr.width/2, YCbCr.height/2,1,3,3).ptr(0,0,0,1),
36678  YCbCr.width*YCbCr.height/2,nfile);
36679  }
36680  if (!file) cimg::fclose(nfile);
36681  return *this;
36682  }
int fclose(std::FILE *file)
Close a file, and check for possible errors.
Definition: CImg.h:5507
int fwrite(const T *ptr, const unsigned int nmemb, std::FILE *stream)
Write data to a file, and check for possible errors.
Definition: CImg.h:5587
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
#define cimglist_for(list, l)
Definition: CImg.h:1877
bool is_empty() const
Return true if list is empty.
Definition: CImg.h:34734
std::FILE * fopen(const char *const path, const char *const mode)
Open a file, and check for possible errors.
Definition: CImg.h:5494
int dimx() const
Return the size of the list.
Definition: CImg.h:34465

Here is the caller graph for this function:

CImgList<T>& assign ( )
inline

In-place version of the default constructor and default destructor.

Definition at line 34151 of file CImg.h.

Referenced by CImg< uintT >::_display_object3d(), CImgList< uintT >::_load_cimg(), CImg< uintT >::_load_off(), CImg< uintT >::append_object3d(), CImgList< uintT >::assign(), CImg< uintT >::box3d(), CImgList< uintT >::CImgList(), CImgList< uintT >::clear(), CImg< uintT >::cone3d(), CImg< uintT >::cylinder3d(), CImg< uintT >::elevation3d(), CImg< uintT >::ellipsoid3d(), CImg< uintT >::get_elevation3d(), CImg< uintT >::get_gradient(), CImg< uintT >::get_hessian(), CImg< uintT >::get_isocurve3d(), CImg< uintT >::get_isosurface3d(), CImg< uintT >::get_split(), CImg< uintT >::isocurve3d(), CImg< uintT >::isosurface3d(), CImgList< uintT >::load(), CImgList< uintT >::load_ffmpeg(), CImgList< uintT >::load_ffmpeg_external(), CImgList< uintT >::load_tiff(), CImgList< uintT >::operator=(), CImg< uintT >::plane3d(), CImgList< uintT >::remove(), CImg< uintT >::sphere3d(), CImg< uintT >::torus3d(), and CImgList< uintT >::transfer_to().

34151  {
34152  if (data) delete[] data;
34153  width = allocated_width = 0;
34154  data = 0;
34155  return *this;
34156  }
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
unsigned int allocated_width
Allocation size of the list.
Definition: CImg.h:33886

Here is the caller graph for this function:

CImgList<T>& assign ( const unsigned int  n)
inline

In-place version of the corresponding constructor.

Definition at line 34159 of file CImg.h.

34159  {
34160  if (n) {
34161  if (allocated_width<n || allocated_width>(n<<2)) {
34162  if (data) delete[] data;
34163  data = new CImg<T>[allocated_width=cimg::max(16UL,cimg::nearest_pow2(n))];
34164  }
34165  width = n;
34166  } else assign();
34167  return *this;
34168  }
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
cimg::superset< t1, t2 >::type max(const t1 &a, const t2 &b)
Return the maximum value between two numbers.
Definition: CImg.h:4749
const NT & n
unsigned int nearest_pow2(const T x)
Return the nearest power of 2 higher than a given number.
Definition: CImg.h:4776
unsigned int allocated_width
Allocation size of the list.
Definition: CImg.h:33886
CImgList<T>& assign ( const unsigned int  n,
const unsigned int  width,
const unsigned int  height = 1,
const unsigned int  depth = 1,
const unsigned int  dim = 1 
)
inline

In-place version of the corresponding constructor.

Definition at line 34171 of file CImg.h.

34172  {
34173  assign(n);
34174  cimglist_apply(*this,assign)(width,height,depth,dim);
34175  return *this;
34176  }
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
#define cimglist_apply(list, fn)
Definition: CImg.h:1881
const NT & n
CImgList<T>& assign ( const unsigned int  n,
const unsigned int  width,
const unsigned int  height,
const unsigned int  depth,
const unsigned int  dim,
const T  val 
)
inline

In-place version of the corresponding constructor.

Definition at line 34179 of file CImg.h.

34180  {
34181  assign(n);
34182  cimglist_apply(*this,assign)(width,height,depth,dim,val);
34183  return *this;
34184  }
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
#define cimglist_apply(list, fn)
Definition: CImg.h:1881
const NT & n
CImgList<T>& assign ( const unsigned int  n,
const unsigned int  width,
const unsigned int  height,
const unsigned int  depth,
const unsigned int  dim,
const int  val0,
const int  val1,
  ... 
)
inline

In-place version of the corresponding constructor.

Definition at line 34187 of file CImg.h.

34188  {
34189  _CImgList_stdarg(int);
34190  return *this;
34191  }
#define _CImgList_stdarg(t)
CImgList<T>& assign ( const unsigned int  n,
const unsigned int  width,
const unsigned int  height,
const unsigned int  depth,
const unsigned int  dim,
const double  val0,
const double  val1,
  ... 
)
inline

In-place version of the corresponding constructor.

Definition at line 34194 of file CImg.h.

34195  {
34196  _CImgList_stdarg(double);
34197  return *this;
34198  }
#define _CImgList_stdarg(t)
CImgList<T>& assign ( const CImgList< t > &  list,
const bool  shared = false 
)
inline

In-place version of the copy constructor.

Definition at line 34202 of file CImg.h.

34202  {
34203  assign(list.width);
34204  cimglist_for(*this,l) data[l].assign(list[l],shared);
34205  return *this;
34206  }
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
#define cimglist_for(list, l)
Definition: CImg.h:1877
CImgList<T>& assign ( const unsigned int  n,
const CImg< t > &  img,
const bool  shared = false 
)
inline

In-place version of the corresponding constructor.

Definition at line 34210 of file CImg.h.

34210  {
34211  assign(n);
34212  cimglist_apply(*this,assign)(img,shared);
34213  return *this;
34214  }
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
#define cimglist_apply(list, fn)
Definition: CImg.h:1881
const NT & n
CImgList<T>& assign ( const CImg< t > &  img,
const bool  shared = false 
)
inline

In-place version of the corresponding constructor.

Definition at line 34218 of file CImg.h.

34218  {
34219  assign(1);
34220  data[0].assign(img,shared);
34221  return *this;
34222  }
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
CImgList<T>& assign ( const CImg< t1 > &  img1,
const CImg< t2 > &  img2,
const bool  shared = false 
)
inline

In-place version of the corresponding constructor.

Definition at line 34226 of file CImg.h.

34226  {
34227  assign(2);
34228  data[0].assign(img1,shared); data[1].assign(img2,shared);
34229  return *this;
34230  }
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
CImgList<T>& assign ( const CImg< t1 > &  img1,
const CImg< t2 > &  img2,
const CImg< t3 > &  img3,
const bool  shared = false 
)
inline

In-place version of the corresponding constructor.

Definition at line 34234 of file CImg.h.

34234  {
34235  assign(3);
34236  data[0].assign(img1,shared); data[1].assign(img2,shared); data[2].assign(img3,shared);
34237  return *this;
34238  }
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
CImgList<T>& assign ( const CImg< t1 > &  img1,
const CImg< t2 > &  img2,
const CImg< t3 > &  img3,
const CImg< t4 > &  img4,
const bool  shared = false 
)
inline

In-place version of the corresponding constructor.

Definition at line 34242 of file CImg.h.

34243  {
34244  assign(4);
34245  data[0].assign(img1,shared); data[1].assign(img2,shared); data[2].assign(img3,shared); data[3].assign(img4,shared);
34246  return *this;
34247  }
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
CImgList<T>& assign ( const CImg< t1 > &  img1,
const CImg< t2 > &  img2,
const CImg< t3 > &  img3,
const CImg< t4 > &  img4,
const CImg< t5 > &  img5,
const bool  shared = false 
)
inline

In-place version of the corresponding constructor.

Definition at line 34251 of file CImg.h.

34252  {
34253  assign(5);
34254  data[0].assign(img1,shared); data[1].assign(img2,shared); data[2].assign(img3,shared); data[3].assign(img4,shared);
34255  data[4].assign(img5,shared);
34256  return *this;
34257  }
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
CImgList<T>& assign ( const CImg< t1 > &  img1,
const CImg< t2 > &  img2,
const CImg< t3 > &  img3,
const CImg< t4 > &  img4,
const CImg< t5 > &  img5,
const CImg< t6 > &  img6,
const bool  shared = false 
)
inline

In-place version of the corresponding constructor.

Definition at line 34261 of file CImg.h.

34262  {
34263  assign(6);
34264  data[0].assign(img1,shared); data[1].assign(img2,shared); data[2].assign(img3,shared); data[3].assign(img4,shared);
34265  data[4].assign(img5,shared); data[5].assign(img6,shared);
34266  return *this;
34267  }
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
CImgList<T>& assign ( const CImg< t1 > &  img1,
const CImg< t2 > &  img2,
const CImg< t3 > &  img3,
const CImg< t4 > &  img4,
const CImg< t5 > &  img5,
const CImg< t6 > &  img6,
const CImg< t7 > &  img7,
const bool  shared = false 
)
inline

In-place version of the corresponding constructor.

Definition at line 34271 of file CImg.h.

34272  {
34273  assign(7);
34274  data[0].assign(img1,shared); data[1].assign(img2,shared); data[2].assign(img3,shared); data[3].assign(img4,shared);
34275  data[4].assign(img5,shared); data[5].assign(img6,shared); data[6].assign(img7,shared);
34276  return *this;
34277  }
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
CImgList<T>& assign ( const CImg< t1 > &  img1,
const CImg< t2 > &  img2,
const CImg< t3 > &  img3,
const CImg< t4 > &  img4,
const CImg< t5 > &  img5,
const CImg< t6 > &  img6,
const CImg< t7 > &  img7,
const CImg< t8 > &  img8,
const bool  shared = false 
)
inline

In-place version of the corresponding constructor.

Definition at line 34281 of file CImg.h.

34283  {
34284  assign(8);
34285  data[0].assign(img1,shared); data[1].assign(img2,shared); data[2].assign(img3,shared); data[3].assign(img4,shared);
34286  data[4].assign(img5,shared); data[5].assign(img6,shared); data[6].assign(img7,shared); data[7].assign(img8,shared);
34287  return *this;
34288  }
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
CImgList<T>& assign ( const char *const  filename)
inline

In-place version of the corresponding constructor.

Definition at line 34291 of file CImg.h.

34291  {
34292  return load(filename);
34293  }
CImgList< T > & load(const char *const filename)
Load an image list from a file.
Definition: CImg.h:35449
CImgList<T>& assign ( const CImgDisplay disp)
inline

In-place version of the corresponding constructor.

Definition at line 34296 of file CImg.h.

34296  {
34297  return assign(CImg<T>(disp));
34298  }
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
CImg<T>& at ( const int  pos)
inline

Read an image in specified position.

Definition at line 34544 of file CImg.h.

34544  {
34545  if (is_empty())
34546  throw CImgInstanceException("CImgList<%s>::at() : Instance list is empty.",
34547  pixel_type());
34548  return data[pos<0?0:pos>=(int)width?(int)width-1:pos];
34549  }
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
bool is_empty() const
Return true if list is empty.
Definition: CImg.h:34734
T& atN ( const int  pos,
const int  x,
const int  y,
const int  z,
const int  v,
const T  out_val 
)
inline

Read a pixel value with Dirichlet boundary conditions for the first coordinates (pos).

Definition at line 34680 of file CImg.h.

34680  {
34681  return (pos<0 || pos>=(int)width)?(cimg::temporary(out_val)=out_val):(*this)(pos,x,y,z,v);
34682  }
void int int REAL REAL * y
Definition: read.cpp:74
T & temporary(const T &)
Return a reference to a temporary variable of type T.
Definition: CImg.h:4515
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
void int int int REAL REAL REAL * z
Definition: write.cpp:76
void int int REAL * x
Definition: read.cpp:74
T atN ( const int  pos,
const int  x,
const int  y,
const int  z,
const int  v,
const T  out_val 
) const
inline

Definition at line 34684 of file CImg.h.

34684  {
34685  return (pos<0 || pos>=(int)width)?out_val:(*this)(pos,x,y,z,v);
34686  }
void int int REAL REAL * y
Definition: read.cpp:74
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
void int int int REAL REAL REAL * z
Definition: write.cpp:76
void int int REAL * x
Definition: read.cpp:74
T& atN ( const int  pos,
const int  x = 0,
const int  y = 0,
const int  z = 0,
const int  v = 0 
)
inline

Read a pixel value with Neumann boundary conditions for the first coordinates (pos).

Definition at line 34689 of file CImg.h.

34689  {
34690  if (is_empty())
34691  throw CImgInstanceException("CImgList<%s>::atN() : Instance list is empty.",
34692  pixel_type());
34693  return _atN(pos,x,y,z,v);
34694  }
void int int REAL REAL * y
Definition: read.cpp:74
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
void int int int REAL REAL REAL * z
Definition: write.cpp:76
void int int REAL * x
Definition: read.cpp:74
bool is_empty() const
Return true if list is empty.
Definition: CImg.h:34734
T & _atN(const int pos, const int x=0, const int y=0, const int z=0, const int v=0)
Definition: CImg.h:34703
T atN ( const int  pos,
const int  x = 0,
const int  y = 0,
const int  z = 0,
const int  v = 0 
) const
inline

Definition at line 34696 of file CImg.h.

34696  {
34697  if (is_empty())
34698  throw CImgInstanceException("CImgList<%s>::atN() : Instance list is empty.",
34699  pixel_type());
34700  return _atN(pos,x,y,z,v);
34701  }
void int int REAL REAL * y
Definition: read.cpp:74
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
void int int int REAL REAL REAL * z
Definition: write.cpp:76
void int int REAL * x
Definition: read.cpp:74
bool is_empty() const
Return true if list is empty.
Definition: CImg.h:34734
T & _atN(const int pos, const int x=0, const int y=0, const int z=0, const int v=0)
Definition: CImg.h:34703
T& atNX ( const int  pos,
const int  x,
const int  y,
const int  z,
const int  v,
const T  out_val 
)
inline

Read a pixel value with Dirichlet boundary conditions for the two first coordinates (pos,x).

Definition at line 34648 of file CImg.h.

34648  {
34649  return (pos<0 || pos>=(int)width)?(cimg::temporary(out_val)=out_val):data[pos].atX(x,y,z,v,out_val);
34650  }
void int int REAL REAL * y
Definition: read.cpp:74
T & temporary(const T &)
Return a reference to a temporary variable of type T.
Definition: CImg.h:4515
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
void int int int REAL REAL REAL * z
Definition: write.cpp:76
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
void int int REAL * x
Definition: read.cpp:74
T atNX ( const int  pos,
const int  x,
const int  y,
const int  z,
const int  v,
const T  out_val 
) const
inline

Definition at line 34652 of file CImg.h.

34652  {
34653  return (pos<0 || pos>=(int)width)?out_val:data[pos].atX(x,y,z,v,out_val);
34654  }
void int int REAL REAL * y
Definition: read.cpp:74
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
void int int int REAL REAL REAL * z
Definition: write.cpp:76
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
void int int REAL * x
Definition: read.cpp:74
T& atNX ( const int  pos,
const int  x,
const int  y = 0,
const int  z = 0,
const int  v = 0 
)
inline

Read a pixel value with Neumann boundary conditions for the two first coordinates (pos, x).

Definition at line 34657 of file CImg.h.

34657  {
34658  if (is_empty())
34659  throw CImgInstanceException("CImgList<%s>::atNX() : Instance list is empty.",
34660  pixel_type());
34661  return _atNX(pos,x,y,z,v);
34662  }
void int int REAL REAL * y
Definition: read.cpp:74
T & _atNX(const int pos, const int x, const int y=0, const int z=0, const int v=0)
Definition: CImg.h:34671
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
void int int int REAL REAL REAL * z
Definition: write.cpp:76
void int int REAL * x
Definition: read.cpp:74
bool is_empty() const
Return true if list is empty.
Definition: CImg.h:34734
T atNX ( const int  pos,
const int  x,
const int  y = 0,
const int  z = 0,
const int  v = 0 
) const
inline

Definition at line 34664 of file CImg.h.

34664  {
34665  if (is_empty())
34666  throw CImgInstanceException("CImgList<%s>::atNX() : Instance list is empty.",
34667  pixel_type());
34668  return _atNX(pos,x,y,z,v);
34669  }
void int int REAL REAL * y
Definition: read.cpp:74
T & _atNX(const int pos, const int x, const int y=0, const int z=0, const int v=0)
Definition: CImg.h:34671
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
void int int int REAL REAL REAL * z
Definition: write.cpp:76
void int int REAL * x
Definition: read.cpp:74
bool is_empty() const
Return true if list is empty.
Definition: CImg.h:34734
T& atNXY ( const int  pos,
const int  x,
const int  y,
const int  z,
const int  v,
const T  out_val 
)
inline

Read a pixel value with Dirichlet boundary conditions for the three first coordinates (pos, x,y).

Definition at line 34616 of file CImg.h.

34616  {
34617  return (pos<0 || pos>=(int)width)?(cimg::temporary(out_val)=out_val):data[pos].atXY(x,y,z,v,out_val);
34618  }
void int int REAL REAL * y
Definition: read.cpp:74
T & temporary(const T &)
Return a reference to a temporary variable of type T.
Definition: CImg.h:4515
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
void int int int REAL REAL REAL * z
Definition: write.cpp:76
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
void int int REAL * x
Definition: read.cpp:74
T atNXY ( const int  pos,
const int  x,
const int  y,
const int  z,
const int  v,
const T  out_val 
) const
inline

Definition at line 34620 of file CImg.h.

34620  {
34621  return (pos<0 || pos>=(int)width)?out_val:data[pos].atXY(x,y,z,v,out_val);
34622  }
void int int REAL REAL * y
Definition: read.cpp:74
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
void int int int REAL REAL REAL * z
Definition: write.cpp:76
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
void int int REAL * x
Definition: read.cpp:74
T& atNXY ( const int  pos,
const int  x,
const int  y,
const int  z = 0,
const int  v = 0 
)
inline

Read a pixel value with Neumann boundary conditions for the three first coordinates (pos, x,y).

Definition at line 34625 of file CImg.h.

34625  {
34626  if (is_empty())
34627  throw CImgInstanceException("CImgList<%s>::atNXY() : Instance list is empty.",
34628  pixel_type());
34629  return _atNXY(pos,x,y,z,v);
34630  }
void int int REAL REAL * y
Definition: read.cpp:74
T & _atNXY(const int pos, const int x, const int y, const int z=0, const int v=0)
Definition: CImg.h:34639
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
void int int int REAL REAL REAL * z
Definition: write.cpp:76
void int int REAL * x
Definition: read.cpp:74
bool is_empty() const
Return true if list is empty.
Definition: CImg.h:34734
T atNXY ( const int  pos,
const int  x,
const int  y,
const int  z = 0,
const int  v = 0 
) const
inline

Definition at line 34632 of file CImg.h.

34632  {
34633  if (is_empty())
34634  throw CImgInstanceException("CImgList<%s>::atNXY() : Instance list is empty.",
34635  pixel_type());
34636  return _atNXY(pos,x,y,z,v);
34637  }
void int int REAL REAL * y
Definition: read.cpp:74
T & _atNXY(const int pos, const int x, const int y, const int z=0, const int v=0)
Definition: CImg.h:34639
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
void int int int REAL REAL REAL * z
Definition: write.cpp:76
void int int REAL * x
Definition: read.cpp:74
bool is_empty() const
Return true if list is empty.
Definition: CImg.h:34734
T& atNXYZ ( const int  pos,
const int  x,
const int  y,
const int  z,
const int  v,
const T  out_val 
)
inline

Read a pixel value with Dirichlet boundary conditions for the four first coordinates (pos, x,y,z).

Definition at line 34584 of file CImg.h.

34584  {
34585  return (pos<0 || pos>=(int)width)?(cimg::temporary(out_val)=out_val):data[pos].atXYZ(x,y,z,v,out_val);
34586  }
void int int REAL REAL * y
Definition: read.cpp:74
T & temporary(const T &)
Return a reference to a temporary variable of type T.
Definition: CImg.h:4515
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
void int int int REAL REAL REAL * z
Definition: write.cpp:76
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
void int int REAL * x
Definition: read.cpp:74
T atNXYZ ( const int  pos,
const int  x,
const int  y,
const int  z,
const int  v,
const T  out_val 
) const
inline

Definition at line 34588 of file CImg.h.

34588  {
34589  return (pos<0 || pos>=(int)width)?out_val:data[pos].atXYZ(x,y,z,v,out_val);
34590  }
void int int REAL REAL * y
Definition: read.cpp:74
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
void int int int REAL REAL REAL * z
Definition: write.cpp:76
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
void int int REAL * x
Definition: read.cpp:74
T& atNXYZ ( const int  pos,
const int  x,
const int  y,
const int  z,
const int  v = 0 
)
inline

Read a pixel value with Neumann boundary conditions for the four first coordinates (pos, x,y,z).

Definition at line 34593 of file CImg.h.

34593  {
34594  if (is_empty())
34595  throw CImgInstanceException("CImgList<%s>::atNXYZ() : Instance list is empty.",
34596  pixel_type());
34597  return _atNXYZ(pos,x,y,z,v);
34598  }
void int int REAL REAL * y
Definition: read.cpp:74
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
void int int int REAL REAL REAL * z
Definition: write.cpp:76
T & _atNXYZ(const int pos, const int x, const int y, const int z, const int v=0)
Definition: CImg.h:34607
void int int REAL * x
Definition: read.cpp:74
bool is_empty() const
Return true if list is empty.
Definition: CImg.h:34734
T atNXYZ ( const int  pos,
const int  x,
const int  y,
const int  z,
const int  v = 0 
) const
inline

Definition at line 34600 of file CImg.h.

34600  {
34601  if (is_empty())
34602  throw CImgInstanceException("CImgList<%s>::atNXYZ() : Instance list is empty.",
34603  pixel_type());
34604  return _atNXYZ(pos,x,y,z,v);
34605  }
void int int REAL REAL * y
Definition: read.cpp:74
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
void int int int REAL REAL REAL * z
Definition: write.cpp:76
T & _atNXYZ(const int pos, const int x, const int y, const int z, const int v=0)
Definition: CImg.h:34607
void int int REAL * x
Definition: read.cpp:74
bool is_empty() const
Return true if list is empty.
Definition: CImg.h:34734
T& atNXYZV ( const int  pos,
const int  x,
const int  y,
const int  z,
const int  v,
const T  out_val 
)
inline

Read a pixel value with Dirichlet boundary conditions.

Definition at line 34552 of file CImg.h.

34552  {
34553  return (pos<0 || pos>=(int)width)?(cimg::temporary(out_val)=out_val):data[pos].atXYZV(x,y,z,v,out_val);
34554  }
void int int REAL REAL * y
Definition: read.cpp:74
T & temporary(const T &)
Return a reference to a temporary variable of type T.
Definition: CImg.h:4515
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
void int int int REAL REAL REAL * z
Definition: write.cpp:76
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
void int int REAL * x
Definition: read.cpp:74
T atNXYZV ( const int  pos,
const int  x,
const int  y,
const int  z,
const int  v,
const T  out_val 
) const
inline

Definition at line 34556 of file CImg.h.

34556  {
34557  return (pos<0 || pos>=(int)width)?out_val:data[pos].atXYZV(x,y,z,v,out_val);
34558  }
void int int REAL REAL * y
Definition: read.cpp:74
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
void int int int REAL REAL REAL * z
Definition: write.cpp:76
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
void int int REAL * x
Definition: read.cpp:74
T& atNXYZV ( const int  pos,
const int  x,
const int  y,
const int  z,
const int  v 
)
inline

Read a pixel value with Neumann boundary conditions.

Definition at line 34561 of file CImg.h.

34561  {
34562  if (is_empty())
34563  throw CImgInstanceException("CImgList<%s>::atNXYZV() : Instance list is empty.",
34564  pixel_type());
34565  return _atNXYZV(pos,x,y,z,v);
34566  }
void int int REAL REAL * y
Definition: read.cpp:74
T & _atNXYZV(const int pos, const int x, const int y, const int z, const int v)
Definition: CImg.h:34575
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
void int int int REAL REAL REAL * z
Definition: write.cpp:76
void int int REAL * x
Definition: read.cpp:74
bool is_empty() const
Return true if list is empty.
Definition: CImg.h:34734
T atNXYZV ( const int  pos,
const int  x,
const int  y,
const int  z,
const int  v 
) const
inline

Definition at line 34568 of file CImg.h.

34568  {
34569  if (is_empty())
34570  throw CImgInstanceException("CImgList<%s>::atNXYZV() : Instance list is empty.",
34571  pixel_type());
34572  return _atNXYZV(pos,x,y,z,v);
34573  }
void int int REAL REAL * y
Definition: read.cpp:74
T & _atNXYZV(const int pos, const int x, const int y, const int z, const int v)
Definition: CImg.h:34575
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
void int int int REAL REAL REAL * z
Definition: write.cpp:76
void int int REAL * x
Definition: read.cpp:74
bool is_empty() const
Return true if list is empty.
Definition: CImg.h:34734
const CImg<T>& back ( ) const
inline

Return a reference to the last image (STL-compliant name).

Definition at line 34535 of file CImg.h.

34535  {
34536  return *(data + width - 1);
34537  }
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
CImg<T>& back ( )
inline

Definition at line 34539 of file CImg.h.

34539  {
34540  return *(data + width - 1);
34541  }
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
iterator begin ( )
inline

Returns an iterator to the beginning of the vector (STL-compliant name).

Definition at line 34508 of file CImg.h.

Referenced by CImgList< uintT >::print().

34508  {
34509  return data;
34510  }
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889

Here is the caller graph for this function:

const_iterator begin ( ) const
inline

Definition at line 34512 of file CImg.h.

34512  {
34513  return data;
34514  }
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
CImgList<T>& clear ( )
inline

In-place version of the default constructor.

This function is strictly equivalent to assign() and has been introduced for having a STL-compliant function name.

Definition at line 34146 of file CImg.h.

34146  {
34147  return assign();
34148  }
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
bool contains ( const T &  pixel,
t &  n,
t &  x,
t &  y,
t &  z,
t &  v 
) const
inline

Return true if one of the image list contains the specified referenced value. If true, set coordinates (n,x,y,z,v).

Definition at line 34838 of file CImg.h.

Referenced by CImgList< uintT >::contains().

34838  {
34839  if (is_empty()) return false;
34840  cimglist_for(*this,l) if (data[l].contains(pixel,x,y,z,v)) { n = (t)l; return true; }
34841  return false;
34842  }
if(dy > dx)
void int int REAL REAL * y
Definition: read.cpp:74
bool contains(const T &pixel, t &n, t &x, t &y, t &z, t &v) const
Return true if one of the image list contains the specified referenced value. If true, set coordinates (n,x,y,z,v).
Definition: CImg.h:34838
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
void int int int REAL REAL REAL * z
Definition: write.cpp:76
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
void int int REAL * x
Definition: read.cpp:74
const NT & n
#define cimglist_for(list, l)
Definition: CImg.h:1877
bool is_empty() const
Return true if list is empty.
Definition: CImg.h:34734

Here is the caller graph for this function:

bool contains ( const T &  pixel,
t &  n,
t &  x,
t &  y,
t &  z 
) const
inline

Return true if one of the image list contains the specified referenced value. If true, set coordinates (n,x,y,z).

Definition at line 34846 of file CImg.h.

34846  {
34847  t v;
34848  return contains(pixel,n,x,y,z,v);
34849  }
void int int REAL REAL * y
Definition: read.cpp:74
bool contains(const T &pixel, t &n, t &x, t &y, t &z, t &v) const
Return true if one of the image list contains the specified referenced value. If true, set coordinates (n,x,y,z,v).
Definition: CImg.h:34838
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
void int int int REAL REAL REAL * z
Definition: write.cpp:76
void int int REAL * x
Definition: read.cpp:74
const NT & n
bool contains ( const T &  pixel,
t &  n,
t &  x,
t &  y 
) const
inline

Return true if one of the image list contains the specified referenced value. If true, set coordinates (n,x,y).

Definition at line 34853 of file CImg.h.

34853  {
34854  t z,v;
34855  return contains(pixel,n,x,y,z,v);
34856  }
void int int REAL REAL * y
Definition: read.cpp:74
bool contains(const T &pixel, t &n, t &x, t &y, t &z, t &v) const
Return true if one of the image list contains the specified referenced value. If true, set coordinates (n,x,y,z,v).
Definition: CImg.h:34838
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
void int int int REAL REAL REAL * z
Definition: write.cpp:76
void int int REAL * x
Definition: read.cpp:74
const NT & n
bool contains ( const T &  pixel,
t &  n,
t &  x 
) const
inline

Return true if one of the image list contains the specified referenced value. If true, set coordinates (n,x).

Definition at line 34860 of file CImg.h.

34860  {
34861  t y,z,v;
34862  return contains(pixel,n,x,y,z,v);
34863  }
void int int REAL REAL * y
Definition: read.cpp:74
bool contains(const T &pixel, t &n, t &x, t &y, t &z, t &v) const
Return true if one of the image list contains the specified referenced value. If true, set coordinates (n,x,y,z,v).
Definition: CImg.h:34838
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
void int int int REAL REAL REAL * z
Definition: write.cpp:76
void int int REAL * x
Definition: read.cpp:74
const NT & n
bool contains ( const T &  pixel,
t &  n 
) const
inline

Return true if one of the image list contains the specified referenced value. If true, set coordinates (n).

Definition at line 34867 of file CImg.h.

34867  {
34868  t x,y,z,v;
34869  return contains(pixel,n,x,y,z,v);
34870  }
void int int REAL REAL * y
Definition: read.cpp:74
bool contains(const T &pixel, t &n, t &x, t &y, t &z, t &v) const
Return true if one of the image list contains the specified referenced value. If true, set coordinates (n,x,y,z,v).
Definition: CImg.h:34838
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
void int int int REAL REAL REAL * z
Definition: write.cpp:76
void int int REAL * x
Definition: read.cpp:74
const NT & n
bool contains ( const T &  pixel) const
inline

Return true if one of the image list contains the specified referenced value.

Definition at line 34873 of file CImg.h.

34873  {
34874  unsigned int n,x,y,z,v;
34875  return contains(pixel,n,x,y,z,v);
34876  }
void int int REAL REAL * y
Definition: read.cpp:74
bool contains(const T &pixel, t &n, t &x, t &y, t &z, t &v) const
Return true if one of the image list contains the specified referenced value. If true, set coordinates (n,x,y,z,v).
Definition: CImg.h:34838
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
void int int int REAL REAL REAL * z
Definition: write.cpp:76
void int int REAL * x
Definition: read.cpp:74
const NT & n
bool contains ( const CImg< T > &  img,
t &  n 
) const
inline

Return true if the list contains the image 'img'. If true, returns the position (n) of the image in the list.

Definition at line 34880 of file CImg.h.

34880  {
34881  if (is_empty()) return false;
34882  const CImg<T> *const ptr = &img;
34883  cimglist_for(*this,i) if (data+i==ptr) { n = (t)i; return true; }
34884  return false;
34885  }
if(dy > dx)
CImg< T > * ptr()
Return a pointer to the image buffer.
Definition: CImg.h:34475
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
blockLoc i
Definition: read.cpp:79
const NT & n
#define cimglist_for(list, l)
Definition: CImg.h:1877
bool is_empty() const
Return true if list is empty.
Definition: CImg.h:34734
bool contains ( const CImg< T > &  img) const
inline

Return true if the list contains the image img.

Definition at line 34888 of file CImg.h.

34888  {
34889  unsigned int n;
34890  return contains(img,n);
34891  }
bool contains(const T &pixel, t &n, t &x, t &y, t &z, t &v) const
Return true if one of the image list contains the specified referenced value. If true, set coordinates (n,x,y,z,v).
Definition: CImg.h:34838
const NT & n
bool containsN ( const int  n) const
inline

Return true if the list contains the image (n).

Definition at line 34831 of file CImg.h.

34831  {
34832  if (is_empty()) return false;
34833  return n>=0 && n<(int)width;
34834  }
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
const NT & n
bool is_empty() const
Return true if list is empty.
Definition: CImg.h:34734
bool containsNXYZV ( const int  n,
const int  x = 0,
const int  y = 0,
const int  z = 0,
const int  v = 0 
) const
inline

Return true if the list contains the pixel (n,x,y,z,v).

Definition at line 34825 of file CImg.h.

34825  {
34826  if (is_empty()) return false;
34827  return n>=0 && n<(int)width && x>=0 && x<data[n].dimx() && y>=0 && y<data[n].dimy() && z>=0 && z<data[n].dimz() && v>=0 && v<data[n].dimv();
34828  }
void int int REAL REAL * y
Definition: read.cpp:74
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
void int int int REAL REAL REAL * z
Definition: write.cpp:76
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
void int int REAL * x
Definition: read.cpp:74
const NT & n
bool is_empty() const
Return true if list is empty.
Definition: CImg.h:34734
CImgList<T>& crop_font ( )
inline

Create an auto-cropped font (along the X axis) from a input font font.

Definition at line 37025 of file CImg.h.

37025  {
37026  return get_crop_font().transfer_to(*this);
37027  }
CImgList< T > get_crop_font() const
Definition: CImg.h:37029
int dimx ( ) const
inline

Return the size of the list.

Definition at line 34465 of file CImg.h.

Referenced by CImgList< uintT >::_font(), CImgList< uintT >::_save_yuv(), and cimg_library::cimg::dialog().

34465  {
34466  return (int)width;
34467  }
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883

Here is the caller graph for this function:

const CImgList<T>& display ( CImgDisplay disp,
const char  axis = 'x',
const char  align = 'p' 
) const
inline

Display the current CImgList instance in an existing CImgDisplay window (by reference).

This function displays the list images of the current CImgList instance into an existing CImgDisplay window. Images of the list are concatenated in a single temporarly image for visualization purposes. The function returns immediately.

Parameters
disp: reference to an existing CImgDisplay instance, where the current image list will be displayed.
axis: specify the axis for image concatenation. Can be 'x','y','z' or 'v'.
align: specify the alignment for image concatenation. Can be 'p' (top), 'c' (center) or 'n' (bottom).
Returns
A reference to the current CImgList instance is returned.

Definition at line 36301 of file CImg.h.

36301  {
36302  get_append(axis,align).display(disp);
36303  return *this;
36304  }
CImg< T > get_append(const char axis, const char align='p') const
Return a single image which is the concatenation of all images of the current CImgList instance...
Definition: CImg.h:35280
const CImgList<T>& display ( CImgDisplay disp,
const bool  display_info,
const char  axis = 'x',
const char  align = 'p' 
) const
inline

Display the current CImgList instance in a new display window.

This function opens a new window with a specific title and displays the list images of the current CImgList instance into it. Images of the list are concatenated in a single temporarly image for visualization purposes. The function returns when a key is pressed or the display window is closed by the user.

Parameters
title: specify the title of the opening display window.
axis: specify the axis for image concatenation. Can be 'x','y','z' or 'v'.
align: specify the alignment for image concatenation. Can be 'p' (top), 'c' (center) or 'n' (bottom).
Returns
A reference to the current CImgList instance is returned.

Definition at line 36316 of file CImg.h.

36317  {
36318  if (is_empty())
36319  throw CImgInstanceException("CImgList<%s>::display() : Instance list (%u,%u) is empty.",
36320  pixel_type(),width,data);
36321  const CImg<T> visu = get_append(axis,align);
36322  if (display_info) print(disp.title);
36323  visu.display(disp,false);
36324  return *this;
36325  }
const CImgList< T > & print(const char *title=0, const bool display_stats=true) const
Print informations about the list on the standard output.
Definition: CImg.h:36269
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
CImg< T > get_append(const char axis, const char align='p') const
Return a single image which is the concatenation of all images of the current CImgList instance...
Definition: CImg.h:35280
bool is_empty() const
Return true if list is empty.
Definition: CImg.h:34734
const CImgList<T>& display ( const char *const  title = 0,
const bool  display_info = true,
const char  axis = 'x',
const char  align = 'p' 
) const
inline

Display the current CImgList instance in a new display window.

Definition at line 36328 of file CImg.h.

36329  {
36330  const CImg<T> visu = get_append(axis,align);
36331  char ntitle[64] = { 0 };
36332  if (!title) std::sprintf(ntitle,"CImgList<%s>",pixel_type());
36333  if (display_info) print(title?title:ntitle);
36334  visu.display(title?title:ntitle,false);
36335  return *this;
36336  }
const CImgList< T > & print(const char *title=0, const bool display_stats=true) const
Print informations about the list on the standard output.
Definition: CImg.h:36269
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
CImg< T > get_append(const char axis, const char align='p') const
Return a single image which is the concatenation of all images of the current CImgList instance...
Definition: CImg.h:35280
static CImgList<T>& empty ( void  )
inlinestatic

Return a reference to an empty list.

Definition at line 34333 of file CImg.h.

Referenced by cimg_library::cimg::eval().

34333  {
34334  static CImgList<T> _empty;
34335  return _empty.assign();
34336  }

Here is the caller graph for this function:

iterator end ( )
inline

Returns an iterator just past the last element (STL-compliant name).

Definition at line 34517 of file CImg.h.

Referenced by CImgList< uintT >::print().

34517  {
34518  return data + width;
34519  }
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889

Here is the caller graph for this function:

const_iterator end ( ) const
inline

Definition at line 34521 of file CImg.h.

34521  {
34522  return data + width;
34523  }
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
CImgList<T>& erase ( const iterator  iter)
inline

Remove the element pointed by iterator iter (STL-compliant name).

Definition at line 35437 of file CImg.h.

35437  {
35438  return remove(iter-data);
35439  }
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
CImgList<T>& FFT ( const char  axis,
const bool  invert = false 
)
inline

Compute a 1-D Fast Fourier Transform, along specified axis.

Definition at line 37116 of file CImg.h.

Referenced by CImgList< uintT >::get_FFT().

37116  {
37117  if (is_empty()) return *this;
37118  if (width==1) insert(1);
37119  if (width>2) cimg::warn("CImgList<%s>::FFT() : Instance list (%u,%p) have more than 2 images",
37120  pixel_type(),width,data);
37121  CImg<T>::FFT(data[0],data[1],axis,invert);
37122  return *this;
37123  }
void warn(const char *format,...)
Display a warning message.
Definition: CImg.h:4470
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
CImg< _cimg_Tfloat > invert(const CImg< T > &instance)
Definition: CImg.h:6086
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
bool is_empty() const
Return true if list is empty.
Definition: CImg.h:34734
CImgList< T > & insert(const CImg< t > &img, const unsigned int pos=~0U, const bool shared=false)
Insert a copy of the image img into the current image list, at position pos.
Definition: CImg.h:35041
static void FFT(CImg< T > &real, CImg< T > &imag, const char axis, const bool invert=false)
Compute a 1D Fast Fourier Transform, along a specified axis.
Definition: CImg.h:20832

Here is the caller graph for this function:

CImgList<T>& FFT ( const bool  invert = false)
inline

Compute a N-D Fast Fourier Transform.

Definition at line 37130 of file CImg.h.

37130  {
37131  if (is_empty()) return *this;
37132  if (width==1) insert(1);
37133  if (width>2) cimg::warn("CImgList<%s>::FFT() : Instance list (%u,%p) have more than 2 images",
37134  pixel_type(),width,data);
37135  CImg<T>::FFT(data[0],data[1],invert);
37136  return *this;
37137  }
void warn(const char *format,...)
Display a warning message.
Definition: CImg.h:4470
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
CImg< _cimg_Tfloat > invert(const CImg< T > &instance)
Definition: CImg.h:6086
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
bool is_empty() const
Return true if list is empty.
Definition: CImg.h:34734
CImgList< T > & insert(const CImg< t > &img, const unsigned int pos=~0U, const bool shared=false)
Insert a copy of the image img into the current image list, at position pos.
Definition: CImg.h:35041
static void FFT(CImg< T > &real, CImg< T > &imag, const char axis, const bool invert=false)
Compute a 1D Fast Fourier Transform, along a specified axis.
Definition: CImg.h:20832
static CImgList<T> font ( const unsigned int  font_width,
const bool  variable_size = true 
)
inlinestatic

Return a CImg pre-defined font with desired size.

Parameters
font_height= height of the desired font (can be 11,13,24,38 or 57)
fixed_size= tell if the font has a fixed or variable width.

Definition at line 37048 of file CImg.h.

Referenced by CImgList< uintT >::_font(), and CImg< uintT >::draw_text().

37048  {
37049  if (font_width<=11) {
37050  static CImgList<T> font7x11, nfont7x11;
37051  if (!variable_size && !font7x11) font7x11 = _font(cimg::font7x11,7,11,1,0,false);
37052  if (variable_size && !nfont7x11) nfont7x11 = _font(cimg::font7x11,7,11,1,0,true);
37053  return variable_size?nfont7x11:font7x11;
37054  }
37055  if (font_width<=13) {
37056  static CImgList<T> font10x13, nfont10x13;
37057  if (!variable_size && !font10x13) font10x13 = _font(cimg::font10x13,10,13,1,0,false);
37058  if (variable_size && !nfont10x13) nfont10x13 = _font(cimg::font10x13,10,13,1,0,true);
37059  return variable_size?nfont10x13:font10x13;
37060  }
37061  if (font_width<=17) {
37062  static CImgList<T> font8x17, nfont8x17;
37063  if (!variable_size && !font8x17) font8x17 = _font(cimg::font8x17,8,17,1,0,false);
37064  if (variable_size && !nfont8x17) nfont8x17 = _font(cimg::font8x17,8,17,1,0,true);
37065  return variable_size?nfont8x17:font8x17;
37066  }
37067  if (font_width<=19) {
37068  static CImgList<T> font10x19, nfont10x19;
37069  if (!variable_size && !font10x19) font10x19 = _font(cimg::font10x19,10,19,2,0,false);
37070  if (variable_size && !nfont10x19) nfont10x19 = _font(cimg::font10x19,10,19,2,0,true);
37071  return variable_size?nfont10x19:font10x19;
37072  }
37073  if (font_width<=24) {
37074  static CImgList<T> font12x24, nfont12x24;
37075  if (!variable_size && !font12x24) font12x24 = _font(cimg::font12x24,12,24,2,0,false);
37076  if (variable_size && !nfont12x24) nfont12x24 = _font(cimg::font12x24,12,24,2,0,true);
37077  return variable_size?nfont12x24:font12x24;
37078  }
37079  if (font_width<=32) {
37080  static CImgList<T> font16x32, nfont16x32;
37081  if (!variable_size && !font16x32) font16x32 = _font(cimg::font16x32,16,32,2,0,false);
37082  if (variable_size && !nfont16x32) nfont16x32 = _font(cimg::font16x32,16,32,2,0,true);
37083  return variable_size?nfont16x32:font16x32;
37084  }
37085  if (font_width<=38) {
37086  static CImgList<T> font19x38, nfont19x38;
37087  if (!variable_size && !font19x38) font19x38 = _font(cimg::font19x38,19,38,3,0,false);
37088  if (variable_size && !nfont19x38) nfont19x38 = _font(cimg::font19x38,19,38,3,0,true);
37089  return variable_size?nfont19x38:font19x38;
37090  }
37091  static CImgList<T> font29x57, nfont29x57;
37092  if (!variable_size && !font29x57) font29x57 = _font(cimg::font29x57,29,57,5,0,false);
37093  if (variable_size && !nfont29x57) nfont29x57 = _font(cimg::font29x57,29,57,5,0,true);
37094  return variable_size?nfont29x57:font29x57;
37095  }
const unsigned int font19x38[19 *38 *256/32]
Definition: CImg.h:3403
const unsigned int font12x24[12 *24 *256/32]
Definition: CImg.h:3030
const unsigned int font10x13[256 *10 *13/32]
Definition: CImg.h:2805
const unsigned int font8x17[8 *17 *256/32]
Definition: CImg.h:2868
const unsigned int font29x57[29 *57 *256/32]
Definition: CImg.h:3729
const unsigned int font16x32[16 *32 *256/32]
Definition: CImg.h:3169
static CImgList< T > _font(const unsigned int *const font, const unsigned int w, const unsigned int h, const unsigned int paddingx, const unsigned int paddingy, const bool variable_size=true)
Definition: CImg.h:37097
const unsigned int font7x11[7 *11 *256/32]
Definition: CImg.h:2764
const unsigned int font10x19[10 *19 *256/32]
Definition: CImg.h:2935

Here is the caller graph for this function:

CImg<T>& front ( )
inline

Returns a reference to the first element (STL-compliant name).

Definition at line 34526 of file CImg.h.

34526  {
34527  return *data;
34528  }
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
const CImg<T>& front ( ) const
inline

Definition at line 34530 of file CImg.h.

34530  {
34531  return *data;
34532  }
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
CImg<T> get_append ( const char  axis,
const char  align = 'p' 
) const
inline

Return a single image which is the concatenation of all images of the current CImgList instance.

Parameters
axis: specify the axis for image concatenation. Can be 'x','y','z' or 'v'.
align: specify the alignment for image concatenation. Can be 'p' (top), 'c' (center) or 'n' (bottom).
Returns
A CImg<T> image corresponding to the concatenation is returned.

Definition at line 35280 of file CImg.h.

Referenced by CImgDisplay::display(), CImgList< uintT >::display(), CImg< uintT >::load_cimg(), CImg< uintT >::load_parrec(), and CImgList< uintT >::operator>().

35280  {
35281  if (align!='p' && align!='c' && align!='n')
35282  throw CImgArgumentException("CImg<%s>::get_append() : Invalid alignment parameter '%c' (should be 'p','c' or 'n').",
35283  pixel_type(),align);
35284  if (is_empty()) return CImg<T>();
35285  if (width==1) return +((*this)[0]);
35286  unsigned int dx = 0, dy = 0, dz = 0, dv = 0, pos = 0;
35287  CImg<T> res;
35288  switch (cimg::uncase(axis)) {
35289  case 'x' : { // Along the X-axis.
35290  cimglist_for(*this,l) {
35291  const CImg<T>& img = (*this)[l];
35292  dx += img.width; dy = cimg::max(dy,img.height); dz = cimg::max(dz,img.depth); dv = cimg::max(dv,img.dim);
35293  }
35294  res.assign(dx,dy,dz,dv,0);
35295  if (res) switch (cimg::uncase(align)) {
35296  case 'p' : {
35297  cimglist_for(*this,l) {
35298  res.draw_image(pos,(*this)[l]);
35299  pos+=(*this)[l].width;
35300  }
35301  } break;
35302  case 'c' : {
35303  cimglist_for(*this,l) {
35304  res.draw_image(pos,(dy-(*this)[l].height)/2,(dz-(*this)[l].depth)/2,(dv-(*this)[l].dim)/2,(*this)[l]);
35305  pos+=(*this)[l].width;
35306  }
35307  } break;
35308  default : {
35309  cimglist_for(*this,l) {
35310  res.draw_image(pos,dy-(*this)[l].height,dz-(*this)[l].depth,dv-(*this)[l].dim,(*this)[l]);
35311  pos+=(*this)[l].width;
35312  }
35313  }}
35314  } break;
35315  case 'y' : { // Along the Y-axis.
35316  cimglist_for(*this,l) {
35317  const CImg<T>& img = (*this)[l];
35318  dx = cimg::max(dx,img.width); dy += img.height; dz = cimg::max(dz,img.depth); dv = cimg::max(dv,img.dim);
35319  }
35320  res.assign(dx,dy,dz,dv,0);
35321  if (res) switch (cimg::uncase(align)) {
35322  case 'p' : {
35323  cimglist_for(*this,l) { res.draw_image(0,pos,(*this)[l]); pos+=(*this)[l].height; }
35324  } break;
35325  case 'c' : {
35326  cimglist_for(*this,l) {
35327  res.draw_image((dx-(*this)[l].width)/2,pos,(dz-(*this)[l].depth)/2,(dv-(*this)[l].dim)/2,(*this)[l]);
35328  pos+=(*this)[l].height;
35329  }
35330  } break;
35331  default : {
35332  cimglist_for(*this,l) {
35333  res.draw_image(dx-(*this)[l].width,pos,dz-(*this)[l].depth,dv-(*this)[l].dim,(*this)[l]);
35334  pos+=(*this)[l].height;
35335  }
35336  }}
35337  } break;
35338  case 'z' : { // Along the Z-axis.
35339  cimglist_for(*this,l) {
35340  const CImg<T>& img = (*this)[l];
35341  dx = cimg::max(dx,img.width); dy = cimg::max(dy,img.height); dz += img.depth; dv = cimg::max(dv,img.dim);
35342  }
35343  res.assign(dx,dy,dz,dv,0);
35344  if (res) switch (cimg::uncase(align)) {
35345  case 'p' : {
35346  cimglist_for(*this,l) { res.draw_image(0,0,pos,(*this)[l]); pos+=(*this)[l].depth; }
35347  } break;
35348  case 'c' : {
35349  cimglist_for(*this,l) {
35350  res.draw_image((dx-(*this)[l].width)/2,(dy-(*this)[l].height)/2,pos,(dv-(*this)[l].dim)/2,(*this)[l]);
35351  pos+=(*this)[l].depth;
35352  }
35353  } break;
35354  default : {
35355  cimglist_for(*this,l) {
35356  res.draw_image(dx-(*this)[l].width,dy-(*this)[l].height,pos,dv-(*this)[l].dim,(*this)[l]);
35357  pos+=(*this)[l].depth;
35358  }
35359  }}
35360  } break;
35361  case 'v' : { // Along the V-axis.
35362  cimglist_for(*this,l) {
35363  const CImg<T>& img = (*this)[l];
35364  dx = cimg::max(dx,img.width); dy = cimg::max(dy,img.height); dz = cimg::max(dz,img.depth); dv += img.dim;
35365  }
35366  res.assign(dx,dy,dz,dv,0);
35367  if (res) switch (cimg::uncase(align)) {
35368  case 'p' : {
35369  cimglist_for(*this,l) { res.draw_image(0,0,0,pos,(*this)[l]); pos+=(*this)[l].dim; }
35370  } break;
35371  case 'c' : {
35372  cimglist_for(*this,l) {
35373  res.draw_image((dx-(*this)[l].width)/2,(dy-(*this)[l].height)/2,(dz-(*this)[l].depth)/2,pos,(*this)[l]);
35374  pos+=(*this)[l].dim;
35375  }
35376  } break;
35377  default : {
35378  cimglist_for(*this,l) {
35379  res.draw_image(dx-(*this)[l].width,dy-(*this)[l].height,dz-(*this)[l].depth,pos,(*this)[l]);
35380  pos+=(*this)[l].dim;
35381  }
35382  }}
35383  } break;
35384  default :
35385  throw CImgArgumentException("CImgList<%s>::get_append() : Invalid axis parameter '%c' (should be 'x','y','z' or 'v').",
35386  pixel_type(),axis);
35387  }
35388  return res;
35389  }
NT dx
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
cimg::superset< t1, t2 >::type max(const t1 &a, const t2 &b)
Return the maximum value between two numbers.
Definition: CImg.h:4749
#define cimglist_for(list, l)
Definition: CImg.h:1877
char uncase(const char x)
Remove the &#39;case&#39; of an ASCII character.
Definition: CImg.h:4888
NT dy
bool is_empty() const
Return true if list is empty.
Definition: CImg.h:34734

Here is the caller graph for this function:

CImgList<T> get_crop_font ( ) const
inline

Definition at line 37029 of file CImg.h.

Referenced by CImgList< uintT >::crop_font().

37029  {
37030  CImgList<T> res;
37031  cimglist_for(*this,l) {
37032  const CImg<T>& letter = (*this)[l];
37033  int xmin = letter.width, xmax = 0;
37034  cimg_forXY(letter,x,y) if (letter(x,y)) { if (x<xmin) xmin=x; if (x>xmax) xmax=x; }
37035  if (xmin>xmax) CImg<T>(letter.width,letter.height,1,letter.dim,0).transfer_to(res);
37036  else letter.get_crop(xmin,0,xmax,letter.height-1).transfer_to(res);
37037  }
37038  res[' '].resize(res['f'].width);
37039  res[' '+256].resize(res['f'].width);
37040  return res;
37041  }
if(dy > dx)
void int int REAL REAL * y
Definition: read.cpp:74
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
void int int REAL * x
Definition: read.cpp:74
#define cimg_forXY(img, x, y)
Definition: CImg.h:597
#define cimglist_for(list, l)
Definition: CImg.h:1877
CImgList< T > & transfer_to(CImgList< t > &list)
Transfer the content of the instance image list into another one.
Definition: CImg.h:34302

Here is the caller graph for this function:

CImgList<Tfloat> get_FFT ( const char  axis,
const bool  invert = false 
) const
inline

Definition at line 37125 of file CImg.h.

37125  {
37126  return CImgList<Tfloat>(*this,false).FFT(axis,invert);
37127  }
CImgList< T > & FFT(const char axis, const bool invert=false)
Compute a 1-D Fast Fourier Transform, along specified axis.
Definition: CImg.h:37116
CImg< _cimg_Tfloat > invert(const CImg< T > &instance)
Definition: CImg.h:6086
CImgList<Tfloat> get_FFT ( const bool  invert = false) const
inline

Definition at line 37139 of file CImg.h.

37139  {
37140  return CImgList<Tfloat>(*this,false).FFT(invert);
37141  }
CImgList< T > & FFT(const char axis, const bool invert=false)
Compute a 1-D Fast Fourier Transform, along specified axis.
Definition: CImg.h:37116
CImg< _cimg_Tfloat > invert(const CImg< T > &instance)
Definition: CImg.h:6086
CImgList<T> get_images ( const unsigned int  i0,
const unsigned int  i1 
) const
inline

Definition at line 35246 of file CImg.h.

Referenced by CImgList< uintT >::images().

35246  {
35247  if (i0>i1 || i1>=width)
35248  throw CImgArgumentException("CImgList<%s>::images() : Cannot build a sublist (%u->%u) from a list (%u,%p)",
35249  pixel_type(),i0,i1,width,data);
35250  CImgList<T> res(i1-i0+1);
35251  cimglist_for(res,l) res[l].assign(data[i0+l]);
35252  return res;
35253  }
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
#define cimglist_for(list, l)
Definition: CImg.h:1877

Here is the caller graph for this function:

CImgList<T> get_insert ( const CImg< t > &  img,
const unsigned int  pos = ~0U,
const bool  shared = false 
) const
inline

Definition at line 35112 of file CImg.h.

35112  {
35113  return (+*this).insert(img,pos,shared);
35114  }
CImgList<T> get_insert ( const unsigned int  n,
const unsigned int  pos = ~0U 
) const
inline

Definition at line 35125 of file CImg.h.

35125  {
35126  return (+*this).insert(n,pos);
35127  }
const NT & n
CImgList<T> get_insert ( const unsigned int  n,
const CImg< t > &  img,
const unsigned int  pos = ~0U,
const bool  shared = false 
) const
inline

Definition at line 35140 of file CImg.h.

35140  {
35141  return (+*this).insert(n,img,pos,shared);
35142  }
const NT & n
CImgList<T> get_insert ( const CImgList< t > &  list,
const unsigned int  pos = ~0U,
const bool  shared = false 
) const
inline

Definition at line 35154 of file CImg.h.

35154  {
35155  return (+*this).insert(list,pos,shared);
35156  }
CImgList<T> get_insert ( const unsigned int  n,
const CImgList< t > &  list,
const unsigned int  pos = ~0U,
const bool  shared = false 
) const
inline

Definition at line 35168 of file CImg.h.

35168  {
35169  return (+*this).insert(n,list,pos,shared);
35170  }
const NT & n
static CImgList<T> get_load ( const char *const  filename)
inlinestatic

Definition at line 35528 of file CImg.h.

35528  {
35529  return CImgList<T>().load(filename);
35530  }
CImgList< T > & load(const char *const filename)
Load an image list from a file.
Definition: CImg.h:35449
static CImgList<T> get_load_cimg ( const char *const  filename)
inlinestatic

Definition at line 35537 of file CImg.h.

35537  {
35538  return CImgList<T>().load_cimg(filename);
35539  }
CImgList< T > & load_cimg(const char *const filename)
Load an image list from a .cimg file.
Definition: CImg.h:35533
static CImgList<T> get_load_cimg ( std::FILE *const  file)
inlinestatic

Definition at line 35546 of file CImg.h.

35546  {
35547  return CImgList<T>().load_cimg(file);
35548  }
CImgList< T > & load_cimg(const char *const filename)
Load an image list from a .cimg file.
Definition: CImg.h:35533
static CImgList<T> get_load_cimg ( const char *const  filename,
const unsigned int  n0,
const unsigned int  n1,
const unsigned int  x0,
const unsigned int  y0,
const unsigned int  z0,
const unsigned int  v0,
const unsigned int  x1,
const unsigned int  y1,
const unsigned int  z1,
const unsigned int  v1 
)
inlinestatic

Definition at line 35650 of file CImg.h.

35653  {
35654  return CImgList<T>().load_cimg(filename,n0,n1,x0,y0,z0,v0,x1,y1,z1,v1);
35655  }
CImgList< T > & load_cimg(const char *const filename)
Load an image list from a .cimg file.
Definition: CImg.h:35533
static CImgList<T> get_load_cimg ( std::FILE *const  file,
const unsigned int  n0,
const unsigned int  n1,
const unsigned int  x0,
const unsigned int  y0,
const unsigned int  z0,
const unsigned int  v0,
const unsigned int  x1,
const unsigned int  y1,
const unsigned int  z1,
const unsigned int  v1 
)
inlinestatic

Definition at line 35665 of file CImg.h.

35668  {
35669  return CImgList<T>().load_cimg(file,n0,n1,x0,y0,z0,v0,x1,y1,z1,v1);
35670  }
CImgList< T > & load_cimg(const char *const filename)
Load an image list from a .cimg file.
Definition: CImg.h:35533
static CImgList<T> get_load_ffmpeg ( const char *const  filename,
const unsigned int  first_frame = 0,
const unsigned int  last_frame = ~0U,
const unsigned int  step_frame = 1,
const bool  pixel_format = true 
)
inlinestatic

Definition at line 36121 of file CImg.h.

36122  {
36123  return CImgList<T>().load_ffmpeg(filename,first_frame,last_frame,step_frame,pixel_format);
36124  }
CImgList< T > & load_ffmpeg(const char *const filename, const unsigned int first_frame=0, const unsigned int last_frame=~0U, const unsigned int step_frame=1, const bool pixel_format=true, const bool resume=false)
Load an image from a video file, using ffmpeg libraries.
Definition: CImg.h:35980
static CImgList<T> get_load_ffmpeg_external ( const char *const  filename)
inlinestatic

Definition at line 36164 of file CImg.h.

36164  {
36165  return CImgList<T>().load_ffmpeg_external(filename);
36166  }
CImgList< T > & load_ffmpeg_external(const char *const filename)
Load an image from a video file (MPEG,AVI) using the external tool &#39;ffmpeg&#39;.
Definition: CImg.h:36127
static CImgList<T> get_load_gzip_external ( const char *const  filename)
inlinestatic

Definition at line 36200 of file CImg.h.

36200  {
36201  return CImgList<T>().load_gzip_external(filename);
36202  }
CImgList< T > & load_gzip_external(const char *const filename)
Load a gzipped list, using external tool &#39;gunzip&#39;.
Definition: CImg.h:36169
static CImgList<T> get_load_off ( const char *const  filename,
CImgList< tf > &  primitives,
CImgList< tc > &  colors 
)
inlinestatic

Definition at line 36212 of file CImg.h.

Referenced by CImgList< uintT >::load_off().

36213  {
36214  return CImg<T>().load_off(filename,primitives,colors)<'x';
36215  }
CImgList< T > & load_off(const char *const filename, CImgList< tf > &primitives, CImgList< tc > &colors)
Load a 3D object from a .OFF file.
Definition: CImg.h:36206

Here is the caller graph for this function:

static CImgList<T> get_load_parrec ( const char *const  filename)
inlinestatic

Definition at line 35870 of file CImg.h.

35870  {
35871  return CImgList<T>().load_parrec(filename);
35872  }
CImgList< T > & load_parrec(const char *const filename)
Load an image list from a PAR/REC (Philips) file.
Definition: CImg.h:35781
static CImgList<T> get_load_tiff ( const char *const  filename,
const unsigned int  first_frame = 0,
const unsigned int  last_frame = ~0U,
const unsigned int  step_frame = 1 
)
inlinestatic

Definition at line 36255 of file CImg.h.

36257  {
36258  return CImgList<T>().load_tiff(filename,first_frame,last_frame,step_frame);
36259  }
CImgList< T > & load_tiff(const char *const filename, const unsigned int first_frame=0, const unsigned int last_frame=~0U, const unsigned int step_frame=1)
Load a TIFF file.
Definition: CImg.h:36218
static CImgList<T> get_load_yuv ( const char *const  filename,
const unsigned int  sizex,
const unsigned int  sizey = 1,
const unsigned int  first_frame = 0,
const unsigned int  last_frame = ~0U,
const unsigned int  step_frame = 1,
const bool  yuv2rgb = true 
)
inlinestatic

Definition at line 35882 of file CImg.h.

35885  {
35886  return CImgList<T>().load_yuv(filename,sizex,sizey,first_frame,last_frame,step_frame,yuv2rgb);
35887  }
CImgList< T > & load_yuv(const char *const filename, const unsigned int sizex, const unsigned int sizey, const unsigned int first_frame=0, const unsigned int last_frame=~0U, const unsigned int step_frame=1, const bool yuv2rgb=true)
Load an image sequence from a YUV file.
Definition: CImg.h:35875
static CImgList<T> get_load_yuv ( std::FILE *const  file,
const unsigned int  sizex,
const unsigned int  sizey = 1,
const unsigned int  first_frame = 0,
const unsigned int  last_frame = ~0U,
const unsigned int  step_frame = 1,
const bool  yuv2rgb = true 
)
inlinestatic

Definition at line 35897 of file CImg.h.

35900  {
35901  return CImgList<T>().load_yuv(file,sizex,sizey,first_frame,last_frame,step_frame,yuv2rgb);
35902  }
CImgList< T > & load_yuv(const char *const filename, const unsigned int sizex, const unsigned int sizey, const unsigned int first_frame=0, const unsigned int last_frame=~0U, const unsigned int step_frame=1, const bool yuv2rgb=true)
Load an image sequence from a YUV file.
Definition: CImg.h:35875
CImgList<T> get_remove ( const unsigned int  pos1,
const unsigned int  pos2 
) const
inline

Definition at line 35206 of file CImg.h.

35206  {
35207  return (+*this).remove(pos1,pos2);
35208  }
CImgList<T> get_remove ( const unsigned int  pos) const
inline

Definition at line 35215 of file CImg.h.

35215  {
35216  return (+*this).remove(pos);
35217  }
CImgList<T> get_remove ( ) const
inline

Definition at line 35227 of file CImg.h.

35227  {
35228  return (+*this).remove();
35229  }
CImgList<T> get_reverse ( ) const
inline

Definition at line 35237 of file CImg.h.

35237  {
35238  return (+*this).reverse();
35239  }
CImgList<T> get_reverse_object3d ( ) const
inline

Definition at line 37154 of file CImg.h.

37154  {
37155  return (+*this).reverse_object3d();
37156  }
CImgList<T> get_shared ( )
inline

Return a shared instance of the list.

Definition at line 34128 of file CImg.h.

34128  {
34129  CImgList<T> res(width);
34130  cimglist_for(*this,l) res[l].assign(data[l],true);
34131  return res;
34132  }
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
#define cimglist_for(list, l)
Definition: CImg.h:1877
const CImgList<T> get_shared ( ) const
inline

Return a shared instance of the list.

Definition at line 34135 of file CImg.h.

34135  {
34136  CImgList<T> res(width);
34137  cimglist_for(*this,l) res[l].assign(data[l],true);
34138  return res;
34139  }
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
#define cimglist_for(list, l)
Definition: CImg.h:1877
CImgList<T> get_shared_images ( const unsigned int  i0,
const unsigned int  i1 
)
inline

Get a shared sub-list.

Definition at line 35256 of file CImg.h.

35256  {
35257  if (i0>i1 || i1>=width)
35258  throw CImgArgumentException("CImgList<%s>::get_shared_images() : Cannot build a sublist (%u->%u) from a list (%u,%p)",
35259  pixel_type(),i0,i1,width,data);
35260  CImgList<T> res(i1-i0+1);
35261  cimglist_for(res,l) res[l].assign(data[i0+l],true);
35262  return res;
35263  }
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
#define cimglist_for(list, l)
Definition: CImg.h:1877
const CImgList<T> get_shared_images ( const unsigned int  i0,
const unsigned int  i1 
) const
inline

Definition at line 35265 of file CImg.h.

35265  {
35266  if (i0>i1 || i1>=width)
35267  throw CImgArgumentException("CImgList<%s>::get_shared_images() : Cannot build a sublist (%u->%u) from a list (%u,%p)",
35268  pixel_type(),i0,i1,width,data);
35269  CImgList<T> res(i1-i0+1);
35270  cimglist_for(res,l) res[l].assign(data[i0+l],true);
35271  return res;
35272  }
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
#define cimglist_for(list, l)
Definition: CImg.h:1877
CImgList<T> get_split ( const char  axis,
const int  nb = 0 
) const
inline

Definition at line 35396 of file CImg.h.

Referenced by CImgList< uintT >::operator<(), and CImgList< uintT >::split().

35396  {
35397  CImgList<T> res;
35398  cimglist_for(*this,l) data[l].get_split(axis,nb).transfer_to(res,~0U);
35399  return res;
35400  }
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
CImgList< T > get_split(const char axis, const int nb=0) const
Definition: CImg.h:35396
#define cimglist_for(list, l)
Definition: CImg.h:1877
CImgList< T > & transfer_to(CImgList< t > &list)
Transfer the content of the instance image list into another one.
Definition: CImg.h:34302

Here is the caller graph for this function:

CImgList<T>& images ( const unsigned int  i0,
const unsigned int  i1 
)
inline

Get a sub-list.

Definition at line 35242 of file CImg.h.

35242  {
35243  return get_images(i0,i1).transfer_to(*this);
35244  }
CImgList< T > get_images(const unsigned int i0, const unsigned int i1) const
Definition: CImg.h:35246
CImgList<T>& insert ( const CImg< t > &  img,
const unsigned int  pos = ~0U,
const bool  shared = false 
)
inline

Insert a copy of the image img into the current image list, at position pos.

Definition at line 35041 of file CImg.h.

Referenced by CImg< uintT >::_display_object3d(), CImg< uintT >::_load_off(), CImgList< uintT >::_load_yuv(), CImg< uintT >::_save_off(), CImg< uintT >::append_object3d(), CImgList< uintT >::FFT(), CImg< uintT >::get_gradient(), CImgList< uintT >::get_insert(), CImg< uintT >::get_split(), CImgList< uintT >::insert(), CImgList< uintT >::operator,(), CImgList< uintT >::push_back(), CImgList< uintT >::push_front(), and CImg< uintT >::transfer_to().

35041  {
35042  const unsigned int npos = pos==~0U?width:pos;
35043  if (npos>width)
35044  throw CImgArgumentException("CImgList<%s>::insert() : Cannot insert image (%u,%u,%u,%u,%p) at position %u in a list "
35045  "containing %u elements",
35046  pixel_type(),img.width,img.height,img.depth,img.dim,img.data,npos,width);
35047  if (shared)
35048  throw CImgArgumentException("CImgList<%s>::insert() : Cannot insert a shared image CImg<%s> in a CImgList<%s>",
35049  pixel_type(),img.pixel_type(),pixel_type());
35050  CImg<T> *new_data = (++width>allocated_width)?new CImg<T>[allocated_width?(allocated_width<<=1):(allocated_width=16)]:0;
35051  if (!width || !data) {
35052  data = new_data;
35053  *data = img;
35054  } else {
35055  if (new_data) {
35056  if (npos) std::memcpy(new_data,data,sizeof(CImg<T>)*npos);
35057  if (npos!=width-1) std::memcpy(new_data+npos+1,data+npos,sizeof(CImg<T>)*(width-1-npos));
35058  std::memset(data,0,sizeof(CImg<T>)*(width-1));
35059  delete[] data;
35060  data = new_data;
35061  }
35062  else if (npos!=width-1) std::memmove(data+npos+1,data+npos,sizeof(CImg<T>)*(width-1-npos));
35063  data[npos].width = data[npos].height = data[npos].depth = data[npos].dim = 0; data[npos].data = 0;
35064  data[npos] = img;
35065  }
35066  return *this;
35067  }
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
unsigned int allocated_width
Allocation size of the list.
Definition: CImg.h:33886

Here is the caller graph for this function:

CImgList<T>& insert ( const CImg< T > &  img,
const unsigned int  pos = ~0U,
const bool  shared = false 
)
inline

Definition at line 35069 of file CImg.h.

35069  {
35070  const unsigned int npos = pos==~0U?width:pos;
35071  if (npos>width)
35072  throw CImgArgumentException("CImgList<%s>::insert() : Cannot insert at position %u into a list with %u elements",
35073  pixel_type(),npos,width);
35074  if (&img>=data && &img<data + width) return insert(+img,pos,shared);
35075  CImg<T> *new_data = (++width>allocated_width)?new CImg<T>[allocated_width?(allocated_width<<=1):(allocated_width=16)]:0;
35076  if (!width || !data) {
35077  data = new_data;
35078  if (shared && img) {
35079  data->width = img.width; data->height = img.height; data->depth = img.depth; data->dim = img.dim;
35080  data->is_shared = true; data->data = img.data;
35081  } else *data = img;
35082  }
35083  else {
35084  if (new_data) {
35085  if (npos) std::memcpy(new_data,data,sizeof(CImg<T>)*npos);
35086  if (npos!=width-1) std::memcpy(new_data+npos+1,data+npos,sizeof(CImg<T>)*(width-1-npos));
35087  if (shared && img) {
35088  new_data[npos].width = img.width; new_data[npos].height = img.height; new_data[npos].depth = img.depth;
35089  new_data[npos].dim = img.dim; new_data[npos].is_shared = true; new_data[npos].data = img.data;
35090  } else {
35091  new_data[npos].width = new_data[npos].height = new_data[npos].depth = new_data[npos].dim = 0; new_data[npos].data = 0;
35092  new_data[npos] = img;
35093  }
35094  std::memset(data,0,sizeof(CImg<T>)*(width-1));
35095  delete[] data;
35096  data = new_data;
35097  } else {
35098  if (npos!=width-1) std::memmove(data+npos+1,data+npos,sizeof(CImg<T>)*(width-1-npos));
35099  if (shared && img) {
35100  data[npos].width = img.width; data[npos].height = img.height; data[npos].depth = img.depth; data[npos].dim = img.dim;
35101  data[npos].is_shared = true; data[npos].data = img.data;
35102  } else {
35103  data[npos].width = data[npos].height = data[npos].depth = data[npos].dim = 0; data[npos].data = 0;
35104  data[npos] = img;
35105  }
35106  }
35107  }
35108  return *this;
35109  }
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
CImgList< T > & insert(const CImg< t > &img, const unsigned int pos=~0U, const bool shared=false)
Insert a copy of the image img into the current image list, at position pos.
Definition: CImg.h:35041
unsigned int allocated_width
Allocation size of the list.
Definition: CImg.h:33886
CImgList<T>& insert ( const unsigned int  n,
const unsigned int  pos = ~0U 
)
inline

Insert n empty images img into the current image list, at position pos.

Definition at line 35117 of file CImg.h.

35117  {
35118  CImg<T> foo;
35119  if (!n) return *this;
35120  const unsigned int npos = pos==~0U?width:pos;
35121  for (unsigned int i = 0; i<n; ++i) insert(foo,npos+i);
35122  return *this;
35123  }
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
blockLoc i
Definition: read.cpp:79
const NT & n
CImgList< T > & insert(const CImg< t > &img, const unsigned int pos=~0U, const bool shared=false)
Insert a copy of the image img into the current image list, at position pos.
Definition: CImg.h:35041
CImgList<T>& insert ( const unsigned int  n,
const CImg< t > &  img,
const unsigned int  pos = ~0U,
const bool  shared = false 
)
inline

Insert n copies of the image img into the current image list, at position pos.

Definition at line 35131 of file CImg.h.

35131  {
35132  if (!n) return *this;
35133  const unsigned int npos = pos==~0U?width:pos;
35134  insert(img,npos,shared);
35135  for (unsigned int i = 1; i<n; ++i) insert(data[npos],npos+i,shared);
35136  return *this;
35137  }
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
blockLoc i
Definition: read.cpp:79
const NT & n
CImgList< T > & insert(const CImg< t > &img, const unsigned int pos=~0U, const bool shared=false)
Insert a copy of the image img into the current image list, at position pos.
Definition: CImg.h:35041
CImgList<T>& insert ( const CImgList< t > &  list,
const unsigned int  pos = ~0U,
const bool  shared = false 
)
inline

Insert a copy of the image list list into the current image list, starting from position pos.

Definition at line 35146 of file CImg.h.

35146  {
35147  const unsigned int npos = pos==~0U?width:pos;
35148  if ((void*)this!=(void*)&list) cimglist_for(list,l) insert(list[l],npos+l,shared);
35149  else insert(CImgList<T>(list),npos,shared);
35150  return *this;
35151  }
CImgList()
Default constructor.
Definition: CImg.h:33971
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
#define cimglist_for(list, l)
Definition: CImg.h:1877
CImgList< T > & insert(const CImg< t > &img, const unsigned int pos=~0U, const bool shared=false)
Insert a copy of the image img into the current image list, at position pos.
Definition: CImg.h:35041
CImgList<T>& insert ( const unsigned int  n,
const CImgList< t > &  list,
const unsigned int  pos = ~0U,
const bool  shared = false 
)
inline

Insert n copies of the list list at position pos of the current list.

Definition at line 35160 of file CImg.h.

35160  {
35161  if (!n) return *this;
35162  const unsigned int npos = pos==~0U?width:pos;
35163  for (unsigned int i = 0; i<n; ++i) insert(list,npos,shared);
35164  return *this;
35165  }
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
blockLoc i
Definition: read.cpp:79
const NT & n
CImgList< T > & insert(const CImg< t > &img, const unsigned int pos=~0U, const bool shared=false)
Insert a copy of the image img into the current image list, at position pos.
Definition: CImg.h:35041
bool is_sameN ( const unsigned int  n) const
inline

Return true if list if of specified size.

Definition at line 34739 of file CImg.h.

Referenced by CImgList< uintT >::is_sameNXYZV().

34739  {
34740  return (width==n);
34741  }
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
const NT & n

Here is the caller graph for this function:

bool is_sameN ( const CImgList< t > &  list) const
inline

Return true if list if of specified size.

Definition at line 34745 of file CImg.h.

34745  {
34746  return (width==list.width);
34747  }
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
bool is_sameNXYZV ( const unsigned int  n,
const unsigned int  dx,
const unsigned int  dy,
const unsigned int  dz,
const unsigned int  dv 
) const
inline

Definition at line 34820 of file CImg.h.

34820  {
34821  return is_sameN(n) && is_sameXYZV(dx,dy,dz,dv);
34822  }
NT dx
bool is_sameN(const unsigned int n) const
Return true if list if of specified size.
Definition: CImg.h:34739
bool is_sameXYZV(const unsigned int dx, const unsigned int dy, const unsigned int dz, const unsigned int dv) const
Definition: CImg.h:34814
const NT & n
NT dy
bool is_sameXYZV ( const unsigned int  dx,
const unsigned int  dy,
const unsigned int  dz,
const unsigned int  dv 
) const
inline

Definition at line 34814 of file CImg.h.

Referenced by CImgList< uintT >::is_sameNXYZV(), and CImgList< uintT >::is_sameXYZV().

34814  {
34815  bool res = true;
34816  for (unsigned int l = 0; l<width && res; ++l) res = data[l].is_sameXYZV(dx,dy,dz,dv);
34817  return res;
34818  }
NT dx
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
bool is_sameXYZV(const unsigned int dx, const unsigned int dy, const unsigned int dz, const unsigned int dv) const
Definition: CImg.h:34814
NT dy

Here is the caller graph for this function:

CImgList<T>& load ( const char *const  filename)
inline

Load an image list from a file.

Definition at line 35449 of file CImg.h.

Referenced by CImgList< uintT >::assign(), CImgList< uintT >::get_load(), and CImgList< uintT >::load_gzip_external().

35449  {
35450  const char *ext = cimg::split_filename(filename);
35451  const unsigned int omode = cimg::exception_mode();
35452  cimg::exception_mode() = 0;
35453  assign();
35454  try {
35455 #ifdef cimglist_load_plugin
35456  cimglist_load_plugin(filename);
35457 #endif
35458 #ifdef cimglist_load_plugin1
35459  cimglist_load_plugin1(filename);
35460 #endif
35461 #ifdef cimglist_load_plugin2
35462  cimglist_load_plugin2(filename);
35463 #endif
35464 #ifdef cimglist_load_plugin3
35465  cimglist_load_plugin3(filename);
35466 #endif
35467 #ifdef cimglist_load_plugin4
35468  cimglist_load_plugin4(filename);
35469 #endif
35470 #ifdef cimglist_load_plugin5
35471  cimglist_load_plugin5(filename);
35472 #endif
35473 #ifdef cimglist_load_plugin6
35474  cimglist_load_plugin6(filename);
35475 #endif
35476 #ifdef cimglist_load_plugin7
35477  cimglist_load_plugin7(filename);
35478 #endif
35479 #ifdef cimglist_load_plugin8
35480  cimglist_load_plugin8(filename);
35481 #endif
35482  if (!cimg::strcasecmp(ext,"tif") ||
35483  !cimg::strcasecmp(ext,"tiff")) load_tiff(filename);
35484  if (!cimg::strcasecmp(ext,"cimg") ||
35485  !cimg::strcasecmp(ext,"cimgz") ||
35486  !ext[0]) load_cimg(filename);
35487  if (!cimg::strcasecmp(ext,"rec") ||
35488  !cimg::strcasecmp(ext,"par")) load_parrec(filename);
35489  if (!cimg::strcasecmp(ext,"avi") ||
35490  !cimg::strcasecmp(ext,"mov") ||
35491  !cimg::strcasecmp(ext,"asf") ||
35492  !cimg::strcasecmp(ext,"divx") ||
35493  !cimg::strcasecmp(ext,"flv") ||
35494  !cimg::strcasecmp(ext,"mpg") ||
35495  !cimg::strcasecmp(ext,"m1v") ||
35496  !cimg::strcasecmp(ext,"m2v") ||
35497  !cimg::strcasecmp(ext,"m4v") ||
35498  !cimg::strcasecmp(ext,"mjp") ||
35499  !cimg::strcasecmp(ext,"mkv") ||
35500  !cimg::strcasecmp(ext,"mpe") ||
35501  !cimg::strcasecmp(ext,"movie") ||
35502  !cimg::strcasecmp(ext,"ogm") ||
35503  !cimg::strcasecmp(ext,"qt") ||
35504  !cimg::strcasecmp(ext,"rm") ||
35505  !cimg::strcasecmp(ext,"vob") ||
35506  !cimg::strcasecmp(ext,"wmv") ||
35507  !cimg::strcasecmp(ext,"xvid") ||
35508  !cimg::strcasecmp(ext,"mpeg")) load_ffmpeg(filename);
35509  if (!cimg::strcasecmp(ext,"gz")) load_gzip_external(filename);
35510  if (is_empty()) throw CImgIOException("CImgList<%s>::load()",pixel_type());
35511  } catch (CImgIOException& e) {
35512  if (!cimg::strncasecmp(e.message,"cimg::fopen()",13)) {
35513  cimg::exception_mode() = omode;
35514  throw CImgIOException("CImgList<%s>::load() : File '%s' cannot be opened.",pixel_type(),filename);
35515  } else try {
35516  assign(1);
35517  data->load(filename);
35518  } catch (CImgException&) {
35519  assign();
35520  }
35521  }
35522  cimg::exception_mode() = omode;
35523  if (is_empty())
35524  throw CImgIOException("CImgList<%s>::load() : File '%s', format not recognized.",pixel_type(),filename);
35525  return *this;
35526  }
CImgList< T > & load_parrec(const char *const filename)
Load an image list from a PAR/REC (Philips) file.
Definition: CImg.h:35781
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
CImgList< T > & load_ffmpeg(const char *const filename, const unsigned int first_frame=0, const unsigned int last_frame=~0U, const unsigned int step_frame=1, const bool pixel_format=true, const bool resume=false)
Load an image from a video file, using ffmpeg libraries.
Definition: CImg.h:35980
int strncasecmp(const char *const s1, const char *const s2, const int l)
Compare the first n characters of two C-strings, ignoring the case.
Definition: CImg.h:4915
unsigned int & exception_mode()
Get/set the current CImg exception mode.
Definition: CImg.h:1940
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
int strcasecmp(const char *const s1, const char *const s2)
Compare two C-strings, ignoring the case.
Definition: CImg.h:4928
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
CImgList< T > & load_cimg(const char *const filename)
Load an image list from a .cimg file.
Definition: CImg.h:35533
CImgList< T > & load_tiff(const char *const filename, const unsigned int first_frame=0, const unsigned int last_frame=~0U, const unsigned int step_frame=1)
Load a TIFF file.
Definition: CImg.h:36218
const char * split_filename(const char *const filename, char *const body=0)
Split a filename into two strings &#39;body&#39; and &#39;extension&#39;.
Definition: CImg.h:5470
bool is_empty() const
Return true if list is empty.
Definition: CImg.h:34734
CImgList< T > & load_gzip_external(const char *const filename)
Load a gzipped list, using external tool &#39;gunzip&#39;.
Definition: CImg.h:36169

Here is the caller graph for this function:

CImgList<T>& load_cimg ( const char *const  filename)
inline

Load an image list from a .cimg file.

Definition at line 35533 of file CImg.h.

Referenced by CImgList< uintT >::get_load_cimg(), CImgList< uintT >::load(), and CImg< uintT >::load_cimg().

35533  {
35534  return _load_cimg(0,filename);
35535  }
CImgList< T > & _load_cimg(std::FILE *const file, const char *const filename)
Definition: CImg.h:35550

Here is the caller graph for this function:

CImgList<T>& load_cimg ( std::FILE *const  file)
inline

Load an image list from a .cimg file.

Definition at line 35542 of file CImg.h.

35542  {
35543  return _load_cimg(file,0);
35544  }
CImgList< T > & _load_cimg(std::FILE *const file, const char *const filename)
Definition: CImg.h:35550
CImgList<T>& load_cimg ( const char *const  filename,
const unsigned int  n0,
const unsigned int  n1,
const unsigned int  x0,
const unsigned int  y0,
const unsigned int  z0,
const unsigned int  v0,
const unsigned int  x1,
const unsigned int  y1,
const unsigned int  z1,
const unsigned int  v1 
)
inline

Load a sub-image list from a non compressed .cimg file.

Definition at line 35643 of file CImg.h.

35646  {
35647  return _load_cimg(0,filename,n0,n1,x0,y0,z0,v0,x1,y1,z1,v1);
35648  }
CImgList< T > & _load_cimg(std::FILE *const file, const char *const filename)
Definition: CImg.h:35550
CImgList<T>& load_cimg ( std::FILE *const  file,
const unsigned int  n0,
const unsigned int  n1,
const unsigned int  x0,
const unsigned int  y0,
const unsigned int  z0,
const unsigned int  v0,
const unsigned int  x1,
const unsigned int  y1,
const unsigned int  z1,
const unsigned int  v1 
)
inline

Load a sub-image list from a non compressed .cimg file.

Definition at line 35658 of file CImg.h.

35661  {
35662  return _load_cimg(file,0,n0,n1,x0,y0,z0,v0,x1,y1,z1,v1);
35663  }
CImgList< T > & _load_cimg(std::FILE *const file, const char *const filename)
Definition: CImg.h:35550
CImgList<T>& load_ffmpeg ( const char *const  filename,
const unsigned int  first_frame = 0,
const unsigned int  last_frame = ~0U,
const unsigned int  step_frame = 1,
const bool  pixel_format = true,
const bool  resume = false 
)
inline

Load an image from a video file, using ffmpeg libraries.

Definition at line 35980 of file CImg.h.

Referenced by CImgList< uintT >::get_load_ffmpeg(), and CImgList< uintT >::load().

35981  {
35982  if (!filename)
35983  throw CImgArgumentException("CImgList<%s>::load_ffmpeg() : Cannot load (null) filename.",
35984  pixel_type());
35985  const unsigned int
35986  nfirst_frame = first_frame<last_frame?first_frame:last_frame,
35987  nlast_frame = first_frame<last_frame?last_frame:first_frame,
35988  nstep_frame = step_frame?step_frame:1;
35989  assign();
35990 
35991 #ifndef cimg_use_ffmpeg
35992  if ((nfirst_frame || nlast_frame!=~0U || nstep_frame>1) || (resume && (pixel_format || !pixel_format)))
35993  throw CImgArgumentException("CImg<%s>::load_ffmpeg() : File '%s', reading sub-frames from a video file requires the use of ffmpeg.\n"
35994  "('cimg_use_ffmpeg' must be defined).",
35995  pixel_type(),filename);
35996  return load_ffmpeg_external(filename);
35997 #else
35998  const unsigned int ffmpeg_pixfmt = pixel_format?PIX_FMT_RGB24:PIX_FMT_GRAY8;
35999  avcodec_register_all();
36000  av_register_all();
36001  static AVFormatContext *format_ctx = 0;
36002  static AVCodecContext *codec_ctx = 0;
36003  static AVCodec *codec = 0;
36004  static AVFrame *avframe = avcodec_alloc_frame(), *converted_frame = avcodec_alloc_frame();
36005  static int vstream = 0;
36006 
36007  if (resume) {
36008  if (!format_ctx || !codec_ctx || !codec || !avframe || !converted_frame)
36009  throw CImgArgumentException("CImgList<%s>::load_ffmpeg() : File '%s', cannot resume due to unallocated FFMPEG structures.",
36010  pixel_type(),filename);
36011  } else {
36012  // Open video file, find main video stream and codec.
36013  if (format_ctx) av_close_input_file(format_ctx);
36014  if (av_open_input_file(&format_ctx,filename,0,0,0)!=0)
36015  throw CImgIOException("CImgList<%s>::load_ffmpeg() : File '%s' cannot be opened.",
36016  pixel_type(),filename);
36017  if (!avframe || !converted_frame || av_find_stream_info(format_ctx)<0) {
36018  av_close_input_file(format_ctx); format_ctx = 0;
36019  cimg::warn("CImgList<%s>::load_ffmpeg() : File '%s', cannot retrieve stream information.\n"
36020  "Trying with external ffmpeg executable.",
36021  pixel_type(),filename);
36022  return load_ffmpeg_external(filename);
36023  }
36024 #if cimg_debug>=3
36025  dump_format(format_ctx,0,0,0);
36026 #endif
36027 
36028  // Special command : Return informations on main video stream.
36029  // as a vector 1x4 containing : (nb_frames,width,height,fps).
36030  if (!first_frame && !last_frame && !step_frame) {
36031  for (vstream = 0; vstream<(int)(format_ctx->nb_streams); ++vstream)
36032  if (format_ctx->streams[vstream]->codec->codec_type==CODEC_TYPE_VIDEO) break;
36033  if (vstream==(int)format_ctx->nb_streams) assign();
36034  else {
36035  CImgList<doubleT> timestamps;
36036  int nb_frames;
36037  AVPacket packet;
36038  // Count frames and store timestamps.
36039  for (nb_frames = 0; av_read_frame(format_ctx,&packet)>=0; av_free_packet(&packet))
36040  if (packet.stream_index==vstream) {
36041  CImg<doubleT>::vector((double)packet.pts).transfer_to(timestamps);
36042  ++nb_frames;
36043  }
36044  // Get frame with, height and fps.
36045  const int
36046  framew = format_ctx->streams[vstream]->codec->width,
36047  frameh = format_ctx->streams[vstream]->codec->height;
36048  const float
36049  num = (float)(format_ctx->streams[vstream]->r_frame_rate).num,
36050  den = (float)(format_ctx->streams[vstream]->r_frame_rate).den,
36051  fps = num/den;
36052  // Return infos as a list.
36053  assign(2);
36054  (*this)[0].assign(1,4).fill((T)nb_frames,(T)framew,(T)frameh,(T)fps);
36055  (*this)[1] = (timestamps>'y');
36056  }
36057  av_close_input_file(format_ctx); format_ctx = 0;
36058  return *this;
36059  }
36060 
36061  for (vstream = 0; vstream<(int)(format_ctx->nb_streams) &&
36062  format_ctx->streams[vstream]->codec->codec_type!=CODEC_TYPE_VIDEO; ) ++vstream;
36063  if (vstream==(int)format_ctx->nb_streams) {
36064  cimg::warn("CImgList<%s>::load_ffmpeg() : File '%s', cannot retrieve video stream.\n"
36065  "Trying with external ffmpeg executable.",
36066  pixel_type(),filename);
36067  av_close_input_file(format_ctx); format_ctx = 0;
36068  return load_ffmpeg_external(filename);
36069  }
36070  codec_ctx = format_ctx->streams[vstream]->codec;
36071  codec = avcodec_find_decoder(codec_ctx->codec_id);
36072  if (!codec) {
36073  cimg::warn("CImgList<%s>::load_ffmpeg() : File '%s', cannot find video codec.\n"
36074  "Trying with external ffmpeg executable.",
36075  pixel_type(),filename);
36076  return load_ffmpeg_external(filename);
36077  }
36078  if (avcodec_open(codec_ctx,codec)<0) { // Open codec
36079  cimg::warn("CImgList<%s>::load_ffmpeg() : File '%s', cannot open video codec.\n"
36080  "Trying with external ffmpeg executable.",
36081  pixel_type(),filename);
36082  return load_ffmpeg_external(filename);
36083  }
36084  }
36085 
36086  // Read video frames
36087  const unsigned int numBytes = avpicture_get_size(ffmpeg_pixfmt,codec_ctx->width,codec_ctx->height);
36088  uint8_t *const buffer = new uint8_t[numBytes];
36089  avpicture_fill((AVPicture *)converted_frame,buffer,ffmpeg_pixfmt,codec_ctx->width,codec_ctx->height);
36090  const T foo = (T)0;
36091  AVPacket packet;
36092  for (unsigned int frame = 0, next_frame = nfirst_frame; frame<=nlast_frame && av_read_frame(format_ctx,&packet)>=0; ) {
36093  if (packet.stream_index==(int)vstream) {
36094  int decoded = 0;
36095  avcodec_decode_video(codec_ctx,avframe,&decoded,packet.data,packet.size);
36096  if (decoded) {
36097  if (frame==next_frame) {
36098  SwsContext *c = sws_getContext(codec_ctx->width,codec_ctx->height,codec_ctx->pix_fmt,codec_ctx->width,
36099  codec_ctx->height,ffmpeg_pixfmt,1,0,0,0);
36100  sws_scale(c,avframe->data,avframe->linesize,0,codec_ctx->height,converted_frame->data,converted_frame->linesize);
36101  if (ffmpeg_pixfmt==PIX_FMT_RGB24) {
36102  CImg<ucharT> next_image(*converted_frame->data,3,codec_ctx->width,codec_ctx->height,1,true);
36103  next_image._get_permute_axes("yzvx",foo).transfer_to(*this);
36104  } else {
36105  CImg<ucharT> next_image(*converted_frame->data,1,codec_ctx->width,codec_ctx->height,1,true);
36106  next_image._get_permute_axes("yzvx",foo).transfer_to(*this);
36107  }
36108  next_frame+=nstep_frame;
36109  }
36110  ++frame;
36111  }
36112  av_free_packet(&packet);
36113  if (next_frame>nlast_frame) break;
36114  }
36115  }
36116  delete[] buffer;
36117 #endif
36118  return *this;
36119  }
void warn(const char *format,...)
Display a warning message.
Definition: CImg.h:4470
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
NT & den
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
CImg< T > & vector()
Unroll all images values into a one-column vector.
Definition: CImg.h:13334
CImgList< T > & load_ffmpeg_external(const char *const filename)
Load an image from a video file (MPEG,AVI) using the external tool &#39;ffmpeg&#39;.
Definition: CImg.h:36127

Here is the caller graph for this function:

CImgList<T>& load_ffmpeg_external ( const char *const  filename)
inline

Load an image from a video file (MPEG,AVI) using the external tool 'ffmpeg'.

Definition at line 36127 of file CImg.h.

Referenced by CImgList< uintT >::get_load_ffmpeg_external(), and CImgList< uintT >::load_ffmpeg().

36127  {
36128  if (!filename)
36129  throw CImgArgumentException("CImgList<%s>::load_ffmpeg_external() : Cannot load (null) filename.",
36130  pixel_type());
36131  char command[1024] = { 0 }, filetmp[512] = { 0 }, filetmp2[512] = { 0 };
36132  std::FILE *file = 0;
36133  do {
36134  std::sprintf(filetmp,"%s%c%s",cimg::temporary_path(),cimg_file_separator,cimg::filenamerand());
36135  std::sprintf(filetmp2,"%s_000001.ppm",filetmp);
36136  if ((file=std::fopen(filetmp2,"rb"))!=0) std::fclose(file);
36137  } while (file);
36138  std::sprintf(filetmp2,"%s_%%6d.ppm",filetmp);
36139 #if cimg_OS!=2
36140  std::sprintf(command,"%s -i \"%s\" %s >/dev/null 2>&1",cimg::ffmpeg_path(),filename,filetmp2);
36141 #else
36142  std::sprintf(command,"\"%s -i \"%s\" %s\" >NUL 2>&1",cimg::ffmpeg_path(),filename,filetmp2);
36143 #endif
36144  cimg::system(command,0);
36145  const unsigned int omode = cimg::exception_mode();
36146  cimg::exception_mode() = 0;
36147  assign();
36148  unsigned int i = 1;
36149  for (bool stopflag = false; !stopflag; ++i) {
36150  std::sprintf(filetmp2,"%s_%.6u.ppm",filetmp,i);
36151  CImg<T> img;
36152  try { img.load_pnm(filetmp2); }
36153  catch (CImgException&) { stopflag = true; }
36154  if (img) { img.transfer_to(*this); std::remove(filetmp2); }
36155  }
36156  cimg::exception_mode() = omode;
36157  if (is_empty())
36158  throw CImgIOException("CImgList<%s>::load_ffmpeg_external() : Failed to open image sequence '%s'.\n"
36159  "Check the filename and if the 'ffmpeg' tool is installed on your system.",
36160  pixel_type(),filename);
36161  return *this;
36162  }
#define cimg_file_separator
Definition: CImg.h:144
const char * filenamerand()
Definition: CImg.h:4996
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
int fclose(std::FILE *file)
Close a file, and check for possible errors.
Definition: CImg.h:5507
const char * temporary_path(const char *const user_path=0, const bool reinit_path=false)
Return or set path to store temporary files.
Definition: CImg.h:5017
unsigned int & exception_mode()
Get/set the current CImg exception mode.
Definition: CImg.h:1940
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
blockLoc i
Definition: read.cpp:79
int system(const char *const command, const char *const module_name=0)
Definition: CImg.h:4491
bool is_empty() const
Return true if list is empty.
Definition: CImg.h:34734
const char * ffmpeg_path(const char *const user_path=0, const bool reinit_path=false)
Return or set path to the &#39;ffmpeg&#39; command.
Definition: CImg.h:5346
std::FILE * fopen(const char *const path, const char *const mode)
Open a file, and check for possible errors.
Definition: CImg.h:5494

Here is the caller graph for this function:

CImgList<T>& load_gzip_external ( const char *const  filename)
inline

Load a gzipped list, using external tool 'gunzip'.

Definition at line 36169 of file CImg.h.

Referenced by CImgList< uintT >::get_load_gzip_external(), and CImgList< uintT >::load().

36169  {
36170  if (!filename)
36171  throw CImgIOException("CImg<%s>::load_gzip_external() : Cannot load (null) filename.",
36172  pixel_type());
36173  char command[1024] = { 0 }, filetmp[512] = { 0 }, body[512] = { 0 };
36174  const char
36175  *ext = cimg::split_filename(filename,body),
36176  *ext2 = cimg::split_filename(body,0);
36177  std::FILE *file = 0;
36178  do {
36179  if (!cimg::strcasecmp(ext,"gz")) {
36180  if (*ext2) std::sprintf(filetmp,"%s%c%s.%s",cimg::temporary_path(),cimg_file_separator,cimg::filenamerand(),ext2);
36181  else std::sprintf(filetmp,"%s%c%s",cimg::temporary_path(),cimg_file_separator,cimg::filenamerand());
36182  } else {
36183  if (*ext) std::sprintf(filetmp,"%s%c%s.%s",cimg::temporary_path(),cimg_file_separator,cimg::filenamerand(),ext);
36184  else std::sprintf(filetmp,"%s%c%s",cimg::temporary_path(),cimg_file_separator,cimg::filenamerand());
36185  }
36186  if ((file=std::fopen(filetmp,"rb"))!=0) std::fclose(file);
36187  } while (file);
36188  std::sprintf(command,"%s -c \"%s\" > %s",cimg::gunzip_path(),filename,filetmp);
36189  cimg::system(command);
36190  if (!(file = std::fopen(filetmp,"rb"))) {
36191  cimg::fclose(cimg::fopen(filename,"r"));
36192  throw CImgIOException("CImg<%s>::load_gzip_external() : File '%s' cannot be opened.",
36193  pixel_type(),filename);
36194  } else cimg::fclose(file);
36195  load(filetmp);
36196  std::remove(filetmp);
36197  return *this;
36198  }
#define cimg_file_separator
Definition: CImg.h:144
const char * gunzip_path(const char *const user_path=0, const bool reinit_path=false)
Return or set path to the &#39;gunzip&#39; command.
Definition: CImg.h:5408
const char * filenamerand()
Definition: CImg.h:4996
int fclose(std::FILE *file)
Close a file, and check for possible errors.
Definition: CImg.h:5507
const char * temporary_path(const char *const user_path=0, const bool reinit_path=false)
Return or set path to store temporary files.
Definition: CImg.h:5017
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
int strcasecmp(const char *const s1, const char *const s2)
Compare two C-strings, ignoring the case.
Definition: CImg.h:4928
int system(const char *const command, const char *const module_name=0)
Definition: CImg.h:4491
CImgList< T > & load(const char *const filename)
Load an image list from a file.
Definition: CImg.h:35449
const char * split_filename(const char *const filename, char *const body=0)
Split a filename into two strings &#39;body&#39; and &#39;extension&#39;.
Definition: CImg.h:5470
std::FILE * fopen(const char *const path, const char *const mode)
Open a file, and check for possible errors.
Definition: CImg.h:5494

Here is the caller graph for this function:

CImgList<T>& load_off ( const char *const  filename,
CImgList< tf > &  primitives,
CImgList< tc > &  colors 
)
inline

Load a 3D object from a .OFF file.

Definition at line 36206 of file CImg.h.

Referenced by CImgList< uintT >::get_load_off().

36207  {
36208  return get_load_off(filename,primitives,colors).transfer_to(*this);
36209  }
static CImgList< T > get_load_off(const char *const filename, CImgList< tf > &primitives, CImgList< tc > &colors)
Definition: CImg.h:36212

Here is the caller graph for this function:

CImgList<T>& load_parrec ( const char *const  filename)
inline

Load an image list from a PAR/REC (Philips) file.

Definition at line 35781 of file CImg.h.

Referenced by CImgList< uintT >::get_load_parrec(), CImgList< uintT >::load(), and CImg< uintT >::load_parrec().

35781  {
35782  if (!filename)
35783  throw CImgArgumentException("CImgList<%s>::load_parrec() : Cannot load (null) filename.",
35784  pixel_type());
35785  char body[1024] = { 0 }, filenamepar[1024] = { 0 }, filenamerec[1024] = { 0 };
35786  const char *ext = cimg::split_filename(filename,body);
35787  if (!std::strcmp(ext,"par")) { std::strcpy(filenamepar,filename); std::sprintf(filenamerec,"%s.rec",body); }
35788  if (!std::strcmp(ext,"PAR")) { std::strcpy(filenamepar,filename); std::sprintf(filenamerec,"%s.REC",body); }
35789  if (!std::strcmp(ext,"rec")) { std::strcpy(filenamerec,filename); std::sprintf(filenamepar,"%s.par",body); }
35790  if (!std::strcmp(ext,"REC")) { std::strcpy(filenamerec,filename); std::sprintf(filenamepar,"%s.PAR",body); }
35791  std::FILE *file = cimg::fopen(filenamepar,"r");
35792 
35793  // Parse header file
35794  CImgList<floatT> st_slices;
35795  CImgList<uintT> st_global;
35796  int err;
35797  char line[256] = { 0 };
35798  do { err=std::fscanf(file,"%255[^\n]%*c",line); } while (err!=EOF && (line[0]=='#' || line[0]=='.'));
35799  do {
35800  unsigned int sn,sizex,sizey,pixsize;
35801  float rs,ri,ss;
35802  err = std::fscanf(file,"%u%*u%*u%*u%*u%*u%*u%u%*u%u%u%g%g%g%*[^\n]",&sn,&pixsize,&sizex,&sizey,&ri,&rs,&ss);
35803  if (err==7) {
35804  CImg<floatT>::vector((float)sn,(float)pixsize,(float)sizex,(float)sizey,ri,rs,ss,0).transfer_to(st_slices);
35805  unsigned int i; for (i = 0; i<st_global.width && sn<=st_global[i][2]; ++i) {}
35806  if (i==st_global.width) CImg<uintT>::vector(sizex,sizey,sn).transfer_to(st_global);
35807  else {
35808  CImg<uintT> &vec = st_global[i];
35809  if (sizex>vec[0]) vec[0] = sizex;
35810  if (sizey>vec[1]) vec[1] = sizey;
35811  vec[2] = sn;
35812  }
35813  st_slices[st_slices.width-1][7] = (float)i;
35814  }
35815  } while (err==7);
35816 
35817  // Read data
35818  std::FILE *file2 = cimg::fopen(filenamerec,"rb");
35819  cimglist_for(st_global,l) {
35820  const CImg<uintT>& vec = st_global[l];
35821  CImg<T>(vec[0],vec[1],vec[2]).transfer_to(*this);
35822  }
35823 
35824  cimglist_for(st_slices,l) {
35825  const CImg<floatT>& vec = st_slices[l];
35826  const unsigned int
35827  sn = (unsigned int)vec[0]-1,
35828  pixsize = (unsigned int)vec[1],
35829  sizex = (unsigned int)vec[2],
35830  sizey = (unsigned int)vec[3],
35831  imn = (unsigned int)vec[7];
35832  const float ri = vec[4], rs = vec[5], ss = vec[6];
35833  switch (pixsize) {
35834  case 8 : {
35835  CImg<ucharT> buf(sizex,sizey);
35836  cimg::fread(buf.data,sizex*sizey,file2);
35837  if (cimg::endianness()) cimg::invert_endianness(buf.data,sizex*sizey);
35838  CImg<T>& img = (*this)[imn];
35839  cimg_forXY(img,x,y) img(x,y,sn) = (T)(( buf(x,y)*rs + ri )/(rs*ss));
35840  } break;
35841  case 16 : {
35842  CImg<ushortT> buf(sizex,sizey);
35843  cimg::fread(buf.data,sizex*sizey,file2);
35844  if (cimg::endianness()) cimg::invert_endianness(buf.data,sizex*sizey);
35845  CImg<T>& img = (*this)[imn];
35846  cimg_forXY(img,x,y) img(x,y,sn) = (T)(( buf(x,y)*rs + ri )/(rs*ss));
35847  } break;
35848  case 32 : {
35849  CImg<uintT> buf(sizex,sizey);
35850  cimg::fread(buf.data,sizex*sizey,file2);
35851  if (cimg::endianness()) cimg::invert_endianness(buf.data,sizex*sizey);
35852  CImg<T>& img = (*this)[imn];
35853  cimg_forXY(img,x,y) img(x,y,sn) = (T)(( buf(x,y)*rs + ri )/(rs*ss));
35854  } break;
35855  default :
35856  cimg::fclose(file);
35857  cimg::fclose(file2);
35858  throw CImgIOException("CImg<%s>::load_parrec() : File '%s', cannot handle image with pixsize = %d bits.",
35859  pixel_type(),filename,pixsize);
35860  }
35861  }
35862  cimg::fclose(file);
35863  cimg::fclose(file2);
35864  if (!width)
35865  throw CImgIOException("CImg<%s>::load_parrec() : File '%s' does not appear to be a valid PAR-REC file.",
35866  pixel_type(),filename);
35867  return *this;
35868  }
if(dy > dx)
int fread(T *const ptr, const unsigned int nmemb, std::FILE *stream)
Read file data, and check for possible errors.
Definition: CImg.h:5569
subroutine rs(nm, n, a, w, matz, z, fv1, fv2, ierr)
const NT & d
CImgList< T > & load_parrec(const char *const filename)
Load an image list from a PAR/REC (Philips) file.
Definition: CImg.h:35781
void int int REAL REAL * y
Definition: read.cpp:74
double s
Definition: blastest.C:80
bool endianness()
Return the current endianness of the CPU.
Definition: CImg.h:4572
int fclose(std::FILE *file)
Close a file, and check for possible errors.
Definition: CImg.h:5507
void invert_endianness(T *const buffer, const unsigned int size)
Invert endianness of a memory buffer.
Definition: CImg.h:4579
systems whose!Fortran compilers support!instead of just C or *for comments can!globally replace a C in the first column with
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
CImg< T > & vector()
Unroll all images values into a one-column vector.
Definition: CImg.h:13334
blockLoc i
Definition: read.cpp:79
void int int REAL * x
Definition: read.cpp:74
#define cimg_forXY(img, x, y)
Definition: CImg.h:597
#define cimglist_for(list, l)
Definition: CImg.h:1877
const char * split_filename(const char *const filename, char *const body=0)
Split a filename into two strings &#39;body&#39; and &#39;extension&#39;.
Definition: CImg.h:5470
CImgList< T > & transfer_to(CImgList< t > &list)
Transfer the content of the instance image list into another one.
Definition: CImg.h:34302
std::FILE * fopen(const char *const path, const char *const mode)
Open a file, and check for possible errors.
Definition: CImg.h:5494

Here is the caller graph for this function:

CImgList<T>& load_tiff ( const char *const  filename,
const unsigned int  first_frame = 0,
const unsigned int  last_frame = ~0U,
const unsigned int  step_frame = 1 
)
inline

Load a TIFF file.

Definition at line 36218 of file CImg.h.

Referenced by CImgList< uintT >::get_load_tiff(), and CImgList< uintT >::load().

36220  {
36221  const unsigned int
36222  nfirst_frame = first_frame<last_frame?first_frame:last_frame,
36223  nstep_frame = step_frame?step_frame:1;
36224  unsigned int nlast_frame = first_frame<last_frame?last_frame:first_frame;
36225 #ifndef cimg_use_tiff
36226  if (nfirst_frame || nlast_frame!=~0U || nstep_frame!=1)
36227  throw CImgArgumentException("CImgList<%s>::load_tiff() : File '%s', reading sub-images from a tiff file requires the use of libtiff.\n"
36228  "('cimg_use_tiff' must be defined).",
36229  pixel_type(),filename);
36230  return assign(CImg<T>::get_load_tiff(filename));
36231 #else
36232  TIFF *tif = TIFFOpen(filename,"r");
36233  if (tif) {
36234  unsigned int nb_images = 0;
36235  do ++nb_images; while (TIFFReadDirectory(tif));
36236  if (nfirst_frame>=nb_images || (nlast_frame!=~0U && nlast_frame>=nb_images))
36237  cimg::warn("CImgList<%s>::load_tiff() : File '%s' contains %u image(s), specified frame range is [%u,%u] (step %u).",
36238  pixel_type(),filename,nb_images,nfirst_frame,nlast_frame,nstep_frame);
36239  if (nfirst_frame>=nb_images) return assign();
36240  if (nlast_frame>=nb_images) nlast_frame = nb_images-1;
36241  assign(1+(nlast_frame-nfirst_frame)/nstep_frame);
36242  TIFFSetDirectory(tif,0);
36243 #if cimg_debug>=3
36244  TIFFSetWarningHandler(0);
36245  TIFFSetErrorHandler(0);
36246 #endif
36247  cimglist_for(*this,l) data[l]._load_tiff(tif,nfirst_frame + l*nstep_frame);
36248  TIFFClose(tif);
36249  } else throw CImgException("CImgList<%s>::load_tiff() : File '%s' cannot be opened.",
36250  pixel_type(),filename);
36251  return *this;
36252 #endif
36253  }
void warn(const char *format,...)
Display a warning message.
Definition: CImg.h:4470
CImgList()
Default constructor.
Definition: CImg.h:33971
double s
Definition: blastest.C:80
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
#define cimglist_for(list, l)
Definition: CImg.h:1877
CImgList< T > & load_tiff(const char *const filename, const unsigned int first_frame=0, const unsigned int last_frame=~0U, const unsigned int step_frame=1)
Load a TIFF file.
Definition: CImg.h:36218

Here is the caller graph for this function:

CImgList<T>& load_yuv ( const char *const  filename,
const unsigned int  sizex,
const unsigned int  sizey,
const unsigned int  first_frame = 0,
const unsigned int  last_frame = ~0U,
const unsigned int  step_frame = 1,
const bool  yuv2rgb = true 
)
inline

Load an image sequence from a YUV file.

Definition at line 35875 of file CImg.h.

Referenced by CImgList< uintT >::get_load_yuv().

35878  {
35879  return _load_yuv(0,filename,sizex,sizey,first_frame,last_frame,step_frame,yuv2rgb);
35880  }
CImgList< T > & _load_yuv(std::FILE *const file, const char *const filename, const unsigned int sizex, const unsigned int sizey, const unsigned int first_frame, const unsigned int last_frame, const unsigned int step_frame, const bool yuv2rgb)
Definition: CImg.h:35904

Here is the caller graph for this function:

CImgList<T>& load_yuv ( std::FILE *const  file,
const unsigned int  sizex,
const unsigned int  sizey,
const unsigned int  first_frame = 0,
const unsigned int  last_frame = ~0U,
const unsigned int  step_frame = 1,
const bool  yuv2rgb = true 
)
inline

Load an image sequence from a YUV file.

Definition at line 35890 of file CImg.h.

35893  {
35894  return _load_yuv(file,0,sizex,sizey,first_frame,last_frame,step_frame,yuv2rgb);
35895  }
CImgList< T > & _load_yuv(std::FILE *const file, const char *const filename, const unsigned int sizex, const unsigned int sizey, const unsigned int first_frame, const unsigned int last_frame, const unsigned int step_frame, const bool yuv2rgb)
Definition: CImg.h:35904
T& max ( void  )
inline

Return a reference to the maximum pixel value of the instance list.

Definition at line 34928 of file CImg.h.

34928  {
34929  if (is_empty())
34930  throw CImgInstanceException("CImgList<%s>::max() : Instance image list is empty.",
34931  pixel_type());
34932  T *ptrmax = data->data;
34933  T max_value = *ptrmax;
34934  cimglist_for(*this,l) {
34935  const CImg<T>& img = data[l];
34936  cimg_for(img,ptr,T) if ((*ptr)>max_value) max_value = *(ptrmax=ptr);
34937  }
34938  return *ptrmax;
34939  }
if(dy > dx)
CImg< T > * ptr()
Return a pointer to the image buffer.
Definition: CImg.h:34475
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
#define cimglist_for(list, l)
Definition: CImg.h:1877
#define cimg_for(img, ptr, T_ptr)
Definition: CImg.h:589
bool is_empty() const
Return true if list is empty.
Definition: CImg.h:34734
const T& max ( void  ) const
inline

Definition at line 34941 of file CImg.h.

34941  {
34942  if (is_empty())
34943  throw CImgInstanceException("CImgList<%s>::max() : Instance image list is empty.",
34944  pixel_type());
34945  const T *ptrmax = data->data;
34946  T max_value = *ptrmax;
34947  cimglist_for(*this,l) {
34948  const CImg<T>& img = data[l];
34949  cimg_for(img,ptr,T) if ((*ptr)>max_value) max_value = *(ptrmax=ptr);
34950  }
34951  return *ptrmax;
34952  }
if(dy > dx)
CImg< T > * ptr()
Return a pointer to the image buffer.
Definition: CImg.h:34475
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
#define cimglist_for(list, l)
Definition: CImg.h:1877
#define cimg_for(img, ptr, T_ptr)
Definition: CImg.h:589
bool is_empty() const
Return true if list is empty.
Definition: CImg.h:34734
T& maxmin ( t &  min_val)
inline

Return a reference to the minimum pixel value of the instance list.

Definition at line 34995 of file CImg.h.

34995  {
34996  if (is_empty())
34997  throw CImgInstanceException("CImgList<%s>::maxmin() : Instance image list is empty.",
34998  pixel_type());
34999  T *ptrmax = data->data;
35000  T min_value = *ptrmax, max_value = min_value;
35001  cimglist_for(*this,l) {
35002  const CImg<T>& img = data[l];
35003  cimg_for(img,ptr,T) {
35004  const T val = *ptr;
35005  if (val>max_value) { max_value = val; ptrmax = ptr; }
35006  if (val<min_value) min_value = val;
35007  }
35008  }
35009  min_val = (t)min_value;
35010  return *ptrmax;
35011  }
CImg< T > * ptr()
Return a pointer to the image buffer.
Definition: CImg.h:34475
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
#define cimglist_for(list, l)
Definition: CImg.h:1877
#define cimg_for(img, ptr, T_ptr)
Definition: CImg.h:589
bool is_empty() const
Return true if list is empty.
Definition: CImg.h:34734
const T& maxmin ( t &  min_val) const
inline

Definition at line 35014 of file CImg.h.

35014  {
35015  if (is_empty())
35016  throw CImgInstanceException("CImgList<%s>::maxmin() : Instance image list is empty.",
35017  pixel_type());
35018  const T *ptrmax = data->data;
35019  T min_value = *ptrmax, max_value = min_value;
35020  cimglist_for(*this,l) {
35021  const CImg<T>& img = data[l];
35022  cimg_for(img,ptr,T) {
35023  const T val = *ptr;
35024  if (val>max_value) { max_value = val; ptrmax = ptr; }
35025  if (val<min_value) min_value = val;
35026  }
35027  }
35028  min_val = (t)min_value;
35029  return *ptrmax;
35030  }
CImg< T > * ptr()
Return a pointer to the image buffer.
Definition: CImg.h:34475
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
#define cimglist_for(list, l)
Definition: CImg.h:1877
#define cimg_for(img, ptr, T_ptr)
Definition: CImg.h:589
bool is_empty() const
Return true if list is empty.
Definition: CImg.h:34734
T& min ( )
inline

Return a reference to the minimum pixel value of the instance list.

Definition at line 34901 of file CImg.h.

34901  {
34902  if (is_empty())
34903  throw CImgInstanceException("CImgList<%s>::min() : Instance image list is empty.",
34904  pixel_type());
34905  T *ptrmin = data->data;
34906  T min_value = *ptrmin;
34907  cimglist_for(*this,l) {
34908  const CImg<T>& img = data[l];
34909  cimg_for(img,ptr,T) if ((*ptr)<min_value) min_value = *(ptrmin=ptr);
34910  }
34911  return *ptrmin;
34912  }
if(dy > dx)
CImg< T > * ptr()
Return a pointer to the image buffer.
Definition: CImg.h:34475
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
#define cimglist_for(list, l)
Definition: CImg.h:1877
#define cimg_for(img, ptr, T_ptr)
Definition: CImg.h:589
bool is_empty() const
Return true if list is empty.
Definition: CImg.h:34734
const T& min ( ) const
inline

Definition at line 34914 of file CImg.h.

34914  {
34915  if (is_empty())
34916  throw CImgInstanceException("CImgList<%s>::min() : Instance image list is empty.",
34917  pixel_type());
34918  const T *ptrmin = data->data;
34919  T min_value = *ptrmin;
34920  cimglist_for(*this,l) {
34921  const CImg<T>& img = data[l];
34922  cimg_for(img,ptr,T) if ((*ptr)<min_value) min_value = *(ptrmin=ptr);
34923  }
34924  return *ptrmin;
34925  }
if(dy > dx)
CImg< T > * ptr()
Return a pointer to the image buffer.
Definition: CImg.h:34475
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
#define cimglist_for(list, l)
Definition: CImg.h:1877
#define cimg_for(img, ptr, T_ptr)
Definition: CImg.h:589
bool is_empty() const
Return true if list is empty.
Definition: CImg.h:34734
T& minmax ( t &  max_val)
inline

Return a reference to the minimum pixel value of the instance list.

Definition at line 34956 of file CImg.h.

Referenced by CImg< uintT >::_display_object3d().

34956  {
34957  if (is_empty())
34958  throw CImgInstanceException("CImgList<%s>::minmax() : Instance image list is empty.",
34959  pixel_type());
34960  T *ptrmin = data->data;
34961  T min_value = *ptrmin, max_value = min_value;
34962  cimglist_for(*this,l) {
34963  const CImg<T>& img = data[l];
34964  cimg_for(img,ptr,T) {
34965  const T val = *ptr;
34966  if (val<min_value) { min_value = val; ptrmin = ptr; }
34967  if (val>max_value) max_value = val;
34968  }
34969  }
34970  max_val = (t)max_value;
34971  return *ptrmin;
34972  }
CImg< T > * ptr()
Return a pointer to the image buffer.
Definition: CImg.h:34475
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
#define cimglist_for(list, l)
Definition: CImg.h:1877
#define cimg_for(img, ptr, T_ptr)
Definition: CImg.h:589
bool is_empty() const
Return true if list is empty.
Definition: CImg.h:34734

Here is the caller graph for this function:

const T& minmax ( t &  max_val) const
inline

Definition at line 34975 of file CImg.h.

34975  {
34976  if (is_empty())
34977  throw CImgInstanceException("CImgList<%s>::minmax() : Instance image list is empty.",
34978  pixel_type());
34979  const T *ptrmin = data->data;
34980  T min_value = *ptrmin, max_value = min_value;
34981  cimglist_for(*this,l) {
34982  const CImg<T>& img = data[l];
34983  cimg_for(img,ptr,T) {
34984  const T val = *ptr;
34985  if (val<min_value) { min_value = val; ptrmin = ptr; }
34986  if (val>max_value) max_value = val;
34987  }
34988  }
34989  max_val = (t)max_value;
34990  return *ptrmin;
34991  }
CImg< T > * ptr()
Return a pointer to the image buffer.
Definition: CImg.h:34475
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
#define cimglist_for(list, l)
Definition: CImg.h:1877
#define cimg_for(img, ptr, T_ptr)
Definition: CImg.h:589
bool is_empty() const
Return true if list is empty.
Definition: CImg.h:34734
operator bool ( ) const
inline

Return true if list is not empty.

Definition at line 34388 of file CImg.h.

34388  {
34389  return !is_empty();
34390  }
bool is_empty() const
Return true if list is empty.
Definition: CImg.h:34734
CImg<T>& operator() ( const unsigned int  pos)
inline

Equivalent to CImgList<T>::operator[].

Definition at line 34369 of file CImg.h.

34369  {
34370  return (*this)[pos];
34371  }
const CImg<T>& operator() ( const unsigned int  pos) const
inline

Definition at line 34373 of file CImg.h.

34373  {
34374  return (*this)[pos];
34375  }
T& operator() ( const unsigned int  pos,
const unsigned int  x,
const unsigned int  y = 0,
const unsigned int  z = 0,
const unsigned int  v = 0 
)
inline

Return a reference to (x,y,z,v) pixel of the pos-th image of the list.

Definition at line 34378 of file CImg.h.

34379  {
34380  return (*this)[pos](x,y,z,v);
34381  }
void int int REAL REAL * y
Definition: read.cpp:74
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
void int int int REAL REAL REAL * z
Definition: write.cpp:76
void int int REAL * x
Definition: read.cpp:74
const T& operator() ( const unsigned int  pos,
const unsigned int  x,
const unsigned int  y = 0,
const unsigned int  z = 0,
const unsigned int  v = 0 
) const
inline

Definition at line 34382 of file CImg.h.

34383  {
34384  return (*this)[pos](x,y,z,v);
34385  }
void int int REAL REAL * y
Definition: read.cpp:74
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
void int int int REAL REAL REAL * z
Definition: write.cpp:76
void int int REAL * x
Definition: read.cpp:74
CImgList<T> operator+ ( ) const
inline

Operator+() (unary).

Writting '+list' is a convenient shortcut to 'CImgList<T>(list,false)' (forces a copy with non-shared elements).

Definition at line 34423 of file CImg.h.

34423  {
34424  return CImgList<T>(*this,false);
34425  }
CImgList<T>& operator, ( const CImg< t > &  img)
inline

Operator,().

Definition at line 34429 of file CImg.h.

34429  {
34430  return insert(img);
34431  }
CImgList< T > & insert(const CImg< t > &img, const unsigned int pos=~0U, const bool shared=false)
Insert a copy of the image img into the current image list, at position pos.
Definition: CImg.h:35041
CImgList<T>& operator, ( const CImgList< t > &  list)
inline

Operator,().

Definition at line 34435 of file CImg.h.

34435  {
34436  return insert(list);
34437  }
CImgList< T > & insert(const CImg< t > &img, const unsigned int pos=~0U, const bool shared=false)
Insert a copy of the image img into the current image list, at position pos.
Definition: CImg.h:35041
CImgList<T> operator< ( const char  axis) const
inline

Operator<().

Definition at line 34445 of file CImg.h.

34445  {
34446  return get_split(axis);
34447  }
CImgList< T > get_split(const char axis, const int nb=0) const
Definition: CImg.h:35396
CImgList<T>& operator= ( const CImg< t > &  img)
inline

Operator=().

Definition at line 34394 of file CImg.h.

34394  {
34395  return assign(img);
34396  }
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
CImgList<T>& operator= ( const CImgDisplay disp)
inline

Operator=().

Definition at line 34399 of file CImg.h.

34399  {
34400  return assign(disp);
34401  }
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
CImgList<T>& operator= ( const CImgList< t > &  list)
inline

Operator=().

Definition at line 34405 of file CImg.h.

34405  {
34406  return assign(list);
34407  }
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
CImgList<T>& operator= ( const CImgList< T > &  list)
inline

Definition at line 34409 of file CImg.h.

34409  {
34410  return assign(list);
34411  }
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
CImgList<T>& operator= ( const char *const  filename)
inline

Operator=().

Definition at line 34414 of file CImg.h.

34414  {
34415  return assign(filename);
34416  }
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
CImg<T> operator> ( const char  axis) const
inline

Operator>().

Definition at line 34440 of file CImg.h.

34440  {
34441  return get_append(axis,'p');
34442  }
CImg< T > get_append(const char axis, const char align='p') const
Return a single image which is the concatenation of all images of the current CImgList instance...
Definition: CImg.h:35280
CImg<T>& operator[] ( const unsigned int  pos)
inline

Return a reference to the i-th element of the image list.

Definition at line 34346 of file CImg.h.

34346  {
34347 #if cimg_debug>=3
34348  if (pos>=width) {
34349  cimg::warn("CImgList<%s>::operator[] : bad list position %u, in a list of %u images",
34350  pixel_type(),pos,width);
34351  return *data;
34352  }
34353 #endif
34354  return data[pos];
34355  }
void warn(const char *format,...)
Display a warning message.
Definition: CImg.h:4470
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
const CImg<T>& operator[] ( const unsigned int  pos) const
inline

Definition at line 34357 of file CImg.h.

34357  {
34358 #if cimg_debug>=3
34359  if (pos>=width) {
34360  cimg::warn("CImgList<%s>::operator[] : bad list position %u, in a list of %u images",
34361  pixel_type(),pos,width);
34362  return *data;
34363  }
34364 #endif
34365  return data[pos];
34366  }
void warn(const char *format,...)
Display a warning message.
Definition: CImg.h:4470
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
CImgList<T>& pop_back ( )
inline

Remove last element of the list (STL-compliant name).

Definition at line 35427 of file CImg.h.

35427  {
35428  return remove(width-1);
35429  }
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
CImgList<T>& pop_front ( )
inline

Remove first element of the list (STL-compliant name).

Definition at line 35432 of file CImg.h.

35432  {
35433  return remove(0);
35434  }
const CImgList<T>& print ( const char *  title = 0,
const bool  display_stats = true 
) const
inline

Print informations about the list on the standard output.

Definition at line 36269 of file CImg.h.

Referenced by CImgList< uintT >::display().

36269  {
36270  unsigned int msiz = 0;
36271  cimglist_for(*this,l) msiz += data[l].size();
36272  msiz*=sizeof(T);
36273  const unsigned int mdisp = msiz<8*1024?0:(msiz<8*1024*1024?1:2);
36274  char ntitle[64] = { 0 };
36275  if (!title) std::sprintf(ntitle,"CImgList<%s>",pixel_type());
36276  std::fprintf(cimg_stdout,"%s: this = %p, size = %u [%u %s], data = (CImg<%s>*)%p..%p.\n",
36277  title?title:ntitle,(void*)this,width,
36278  mdisp==0?msiz:(mdisp==1?(msiz>>10):(msiz>>20)),
36279  mdisp==0?"b":(mdisp==1?"Kb":"Mb"),
36280  pixel_type(),(void*)begin(),(void*)((char*)end()-1));
36281  char tmp[16] = { 0 };
36282  cimglist_for(*this,ll) {
36283  std::sprintf(tmp,"[%d]",ll);
36284  std::fprintf(cimg_stdout," ");
36285  data[ll].print(tmp,display_stats);
36286  if (ll==3 && width>8) { ll = width-5; std::fprintf(cimg_stdout," ...\n"); }
36287  }
36288  return *this;
36289  }
iterator begin()
Returns an iterator to the beginning of the vector (STL-compliant name).
Definition: CImg.h:34508
unsigned int size() const
Return the size of the list.
Definition: CImg.h:34470
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
#define cimglist_for(list, l)
Definition: CImg.h:1877
#define cimg_stdout
Definition: CImg.h:136
iterator end()
Returns an iterator just past the last element (STL-compliant name).
Definition: CImg.h:34517

Here is the caller graph for this function:

CImg<T>* ptr ( )
inline

Return a pointer to the image buffer.

Definition at line 34475 of file CImg.h.

Referenced by CImgList< uintT >::max(), CImgList< uintT >::maxmin(), CImgList< uintT >::min(), and CImgList< uintT >::minmax().

34475  {
34476  return data;
34477  }
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889

Here is the caller graph for this function:

const CImg<T>* ptr ( ) const
inline

Definition at line 34479 of file CImg.h.

34479  {
34480  return data;
34481  }
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
CImg<T>* ptr ( const unsigned int  l)
inline

Return a pointer to the image buffer.

Definition at line 34498 of file CImg.h.

34498  {
34499  return data + l;
34500  }
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
const CImg<T>* ptr ( const unsigned int  l) const
inline

Definition at line 34502 of file CImg.h.

34502  {
34503  return data + l;
34504  }
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
CImgList<T>& push_back ( const CImg< t > &  img)
inline

Insert image img at the end of the list (STL-compliant name).

Definition at line 35404 of file CImg.h.

35404  {
35405  return insert(img);
35406  }
CImgList< T > & insert(const CImg< t > &img, const unsigned int pos=~0U, const bool shared=false)
Insert a copy of the image img into the current image list, at position pos.
Definition: CImg.h:35041
CImgList<T>& push_back ( const CImgList< t > &  list)
inline

Insert list list at the end of the current list (STL-compliant name).

Definition at line 35416 of file CImg.h.

35416  {
35417  return insert(list);
35418  }
CImgList< T > & insert(const CImg< t > &img, const unsigned int pos=~0U, const bool shared=false)
Insert a copy of the image img into the current image list, at position pos.
Definition: CImg.h:35041
CImgList<T>& push_front ( const CImg< t > &  img)
inline

Insert image img at the front of the list (STL-compliant name).

Definition at line 35410 of file CImg.h.

35410  {
35411  return insert(img,0);
35412  }
CImgList< T > & insert(const CImg< t > &img, const unsigned int pos=~0U, const bool shared=false)
Insert a copy of the image img into the current image list, at position pos.
Definition: CImg.h:35041
CImgList<T>& push_front ( const CImgList< t > &  list)
inline

Insert list list at the front of the current list (STL-compliant name).

Definition at line 35422 of file CImg.h.

35422  {
35423  return insert(list,0);
35424  }
CImgList< T > & insert(const CImg< t > &img, const unsigned int pos=~0U, const bool shared=false)
Insert a copy of the image img into the current image list, at position pos.
Definition: CImg.h:35041
CImgList<T>& remove ( const unsigned int  pos1,
const unsigned int  pos2 
)
inline

Remove the images from positions pos1 to pos2.

Definition at line 35173 of file CImg.h.

Referenced by CImgList< uintT >::get_remove(), and CImg< uintT >::sphere3d().

35173  {
35174  const unsigned int
35175  npos1 = pos1<pos2?pos1:pos2,
35176  tpos2 = pos1<pos2?pos2:pos1,
35177  npos2 = tpos2<width?tpos2:width-1;
35178  if (npos1>=width)
35179  cimg::warn("CImgList<%s>::remove() : Cannot remove images from a list (%p,%u), at positions %u->%u.",
35180  pixel_type(),data,width,npos1,tpos2);
35181  else {
35182  if (tpos2>=width)
35183  cimg::warn("CImgList<%s>::remove() : Cannot remove all images from a list (%p,%u), at positions %u->%u.",
35184  pixel_type(),data,width,npos1,tpos2);
35185  for (unsigned int k = npos1; k<=npos2; ++k) data[k].assign();
35186  const unsigned int nb = 1 + npos2 - npos1;
35187  if (!(width-=nb)) return assign();
35188  if (width>(allocated_width>>2) || allocated_width<=8) { // Removing items without reallocation.
35189  if (npos1!=width) std::memmove(data+npos1,data+npos2+1,sizeof(CImg<T>)*(width - npos1));
35190  std::memset(data + width,0,sizeof(CImg<T>)*nb);
35191  } else { // Removing items with reallocation.
35192  allocated_width>>=2;
35193  while (allocated_width>8 && width<(allocated_width>>1)) allocated_width>>=1;
35194  CImg<T> *new_data = new CImg<T>[allocated_width];
35195  if (npos1) std::memcpy(new_data,data,sizeof(CImg<T>)*npos1);
35196  if (npos1!=width) std::memcpy(new_data+npos1,data+npos2+1,sizeof(CImg<T>)*(width-npos1));
35197  if (width!=allocated_width) std::memset(new_data+width,0,sizeof(allocated_width - width));
35198  std::memset(data,0,sizeof(CImg<T>)*(width+nb));
35199  delete[] data;
35200  data = new_data;
35201  }
35202  }
35203  return *this;
35204  }
void warn(const char *format,...)
Display a warning message.
Definition: CImg.h:4470
j indices k indices k
Definition: Indexing.h:6
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
unsigned int allocated_width
Allocation size of the list.
Definition: CImg.h:33886

Here is the caller graph for this function:

CImgList<T>& remove ( const unsigned int  pos)
inline

Remove the image at position pos from the image list.

Definition at line 35211 of file CImg.h.

35211  {
35212  return remove(pos,pos);
35213  }
CImgList<T>& remove ( )
inline

Remove the last image from the image list.

Definition at line 35220 of file CImg.h.

35220  {
35221  if (width) return remove(width-1);
35222  else cimg::warn("CImgList<%s>::remove() : List is empty",
35223  pixel_type());
35224  return *this;
35225  }
void warn(const char *format,...)
Display a warning message.
Definition: CImg.h:4470
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
CImgList<T>& reverse ( )
inline

Reverse list order.

Definition at line 35232 of file CImg.h.

Referenced by CImgList< uintT >::get_reverse().

35232  {
35233  for (unsigned int l = 0; l<width/2; ++l) (*this)[l].swap((*this)[width-1-l]);
35234  return *this;
35235  }
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883

Here is the caller graph for this function:

CImgList<T>& reverse_object3d ( )
inline

Invert primitives orientation of a 3D object.

Definition at line 37144 of file CImg.h.

Referenced by CImgList< uintT >::get_reverse_object3d().

37144  {
37145  cimglist_for(*this,l) {
37146  CImg<T>& p = data[l];
37147  const unsigned int siz = p.size();
37148  if (siz==2 || siz==3 || siz==6 || siz==9) cimg::swap(p[0],p[1]);
37149  else if (siz==4 || siz==12) cimg::swap(p[0],p[3],p[1],p[2]);
37150  }
37151  return *this;
37152  }
void swap(T &a, T &b)
Exchange values of variables a and b.
Definition: CImg.h:4522
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
#define cimglist_for(list, l)
Definition: CImg.h:1877

Here is the caller graph for this function:

const CImgList<T>& save ( const char *const  filename,
const int  number = -1 
) const
inline

Save an image list into a file.

Depending on the extension of the given filename, a file format is chosen for the output file.

Definition at line 36342 of file CImg.h.

Referenced by CImgList< uintT >::save_gzip_external().

36342  {
36343  if (is_empty())
36344  throw CImgInstanceException("CImgList<%s>::save() : File '%s, instance list (%u,%p) is empty.",
36345  pixel_type(),filename?filename:"(null)",width,data);
36346  if (!filename)
36347  throw CImgArgumentException("CImg<%s>::save() : Instance list (%u,%p), specified filename is (null).",
36348  pixel_type(),width,data);
36349  const char *ext = cimg::split_filename(filename);
36350  char nfilename[1024] = { 0 };
36351  const char *const fn = (number>=0)?cimg::number_filename(filename,number,6,nfilename):filename;
36352 #ifdef cimglist_save_plugin
36353  cimglist_save_plugin(fn);
36354 #endif
36355 #ifdef cimglist_save_plugin1
36356  cimglist_save_plugin1(fn);
36357 #endif
36358 #ifdef cimglist_save_plugin2
36359  cimglist_save_plugin2(fn);
36360 #endif
36361 #ifdef cimglist_save_plugin3
36362  cimglist_save_plugin3(fn);
36363 #endif
36364 #ifdef cimglist_save_plugin4
36365  cimglist_save_plugin4(fn);
36366 #endif
36367 #ifdef cimglist_save_plugin5
36368  cimglist_save_plugin5(fn);
36369 #endif
36370 #ifdef cimglist_save_plugin6
36371  cimglist_save_plugin6(fn);
36372 #endif
36373 #ifdef cimglist_save_plugin7
36374  cimglist_save_plugin7(fn);
36375 #endif
36376 #ifdef cimglist_save_plugin8
36377  cimglist_save_plugin8(fn);
36378 #endif
36379 #ifdef cimg_use_tiff
36380  if (!cimg::strcasecmp(ext,"tif") ||
36381  !cimg::strcasecmp(ext,"tiff")) return save_tiff(fn);
36382 #endif
36383  if (!cimg::strcasecmp(ext,"cimgz")) return save_cimg(fn,true);
36384  if (!cimg::strcasecmp(ext,"cimg") || !ext[0]) return save_cimg(fn,false);
36385  if (!cimg::strcasecmp(ext,"yuv")) return save_yuv(fn,true);
36386  if (!cimg::strcasecmp(ext,"avi") ||
36387  !cimg::strcasecmp(ext,"mov") ||
36388  !cimg::strcasecmp(ext,"asf") ||
36389  !cimg::strcasecmp(ext,"divx") ||
36390  !cimg::strcasecmp(ext,"flv") ||
36391  !cimg::strcasecmp(ext,"mpg") ||
36392  !cimg::strcasecmp(ext,"m1v") ||
36393  !cimg::strcasecmp(ext,"m2v") ||
36394  !cimg::strcasecmp(ext,"m4v") ||
36395  !cimg::strcasecmp(ext,"mjp") ||
36396  !cimg::strcasecmp(ext,"mkv") ||
36397  !cimg::strcasecmp(ext,"mpe") ||
36398  !cimg::strcasecmp(ext,"movie") ||
36399  !cimg::strcasecmp(ext,"ogm") ||
36400  !cimg::strcasecmp(ext,"qt") ||
36401  !cimg::strcasecmp(ext,"rm") ||
36402  !cimg::strcasecmp(ext,"vob") ||
36403  !cimg::strcasecmp(ext,"wmv") ||
36404  !cimg::strcasecmp(ext,"xvid") ||
36405  !cimg::strcasecmp(ext,"mpeg")) return save_ffmpeg(fn);
36406  if (!cimg::strcasecmp(ext,"gz")) return save_gzip_external(fn);
36407  if (width==1) data[0].save(fn,-1); else cimglist_for(*this,l) data[l].save(fn,l);
36408  return *this;
36409  }
const CImgList< T > & save_yuv(const char *const filename=0, const bool rgb2yuv=true) const
Save an image sequence into a YUV file.
Definition: CImg.h:36685
const CImgList< T > & save_ffmpeg(const char *const filename, const unsigned int first_frame=0, const unsigned int last_frame=~0U, const unsigned int fps=25) const
Save an image sequence, using FFMPEG library.
Definition: CImg.h:36413
const CImgList< T > & save(const char *const filename, const int number=-1) const
Save an image list into a file.
Definition: CImg.h:36342
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
int strcasecmp(const char *const s1, const char *const s2)
Compare two C-strings, ignoring the case.
Definition: CImg.h:4928
char * number_filename(const char *const filename, const int number, const unsigned int n, char *const string)
Create a numbered version of a filename.
Definition: CImg.h:5483
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
const CImgList< T > & save_gzip_external(const char *const filename) const
Save a file in TIFF format.
Definition: CImg.h:36943
const CImgList< T > & save_cimg(std::FILE *file, const bool compress=false) const
Save an image list into a CImg file (RAW binary file + simple header)
Definition: CImg.h:36752
#define cimglist_for(list, l)
Definition: CImg.h:1877
const char * split_filename(const char *const filename, char *const body=0)
Split a filename into two strings &#39;body&#39; and &#39;extension&#39;.
Definition: CImg.h:5470
bool is_empty() const
Return true if list is empty.
Definition: CImg.h:34734

Here is the caller graph for this function:

const CImgList<T>& save_cimg ( std::FILE *  file,
const bool  compress = false 
) const
inline

Save an image list into a CImg file (RAW binary file + simple header)

Definition at line 36752 of file CImg.h.

Referenced by CImgList< uintT >::save().

36752  {
36753  return _save_cimg(file,0,compress);
36754  }
const CImgList< T > & _save_cimg(std::FILE *const file, const char *const filename, const bool compression) const
Save an image list into a .cimg file.
Definition: CImg.h:36700

Here is the caller graph for this function:

const CImgList<T>& save_cimg ( const char *const  filename,
const bool  compress = false 
) const
inline

Save an image list into a CImg file (RAW binary file + simple header)

Definition at line 36757 of file CImg.h.

36757  {
36758  return _save_cimg(0,filename,compress);
36759  }
const CImgList< T > & _save_cimg(std::FILE *const file, const char *const filename, const bool compression) const
Save an image list into a .cimg file.
Definition: CImg.h:36700
const CImgList<T>& save_cimg ( const char *const  filename,
const unsigned int  n0,
const unsigned int  x0,
const unsigned int  y0,
const unsigned int  z0,
const unsigned int  v0 
) const
inline

Insert the instance image into into an existing .cimg file, at specified coordinates.

Definition at line 36870 of file CImg.h.

36873  {
36874  return _save_cimg(0,filename,n0,x0,y0,z0,v0);
36875  }
const CImgList< T > & _save_cimg(std::FILE *const file, const char *const filename, const bool compression) const
Save an image list into a .cimg file.
Definition: CImg.h:36700
const CImgList<T>& save_cimg ( std::FILE *const  file,
const unsigned int  n0,
const unsigned int  x0,
const unsigned int  y0,
const unsigned int  z0,
const unsigned int  v0 
) const
inline

Insert the instance image into into an existing .cimg file, at specified coordinates.

Definition at line 36878 of file CImg.h.

36881  {
36882  return _save_cimg(file,0,n0,x0,y0,z0,v0);
36883  }
const CImgList< T > & _save_cimg(std::FILE *const file, const char *const filename, const bool compression) const
Save an image list into a .cimg file.
Definition: CImg.h:36700
static void save_empty_cimg ( const char *const  filename,
const unsigned int  nb,
const unsigned int  dx,
const unsigned int  dy = 1,
const unsigned int  dz = 1,
const unsigned int  dv = 1 
)
inlinestatic

Create an empty .cimg file with specified dimensions.

Definition at line 36901 of file CImg.h.

Referenced by CImg< uintT >::save_empty_cimg().

36904  {
36905  return _save_empty_cimg(0,filename,nb,dx,dy,dz,dv);
36906  }
NT dx
NT dy
static void _save_empty_cimg(std::FILE *const file, const char *const filename, const unsigned int nb, const unsigned int dx, const unsigned int dy, const unsigned int dz, const unsigned int dv)
Definition: CImg.h:36886

Here is the caller graph for this function:

static void save_empty_cimg ( std::FILE *const  file,
const unsigned int  nb,
const unsigned int  dx,
const unsigned int  dy = 1,
const unsigned int  dz = 1,
const unsigned int  dv = 1 
)
inlinestatic

Create an empty .cimg file with specified dimensions.

Definition at line 36909 of file CImg.h.

36912  {
36913  return _save_empty_cimg(file,0,nb,dx,dy,dz,dv);
36914  }
NT dx
NT dy
static void _save_empty_cimg(std::FILE *const file, const char *const filename, const unsigned int nb, const unsigned int dx, const unsigned int dy, const unsigned int dz, const unsigned int dv)
Definition: CImg.h:36886
const CImgList<T>& save_ffmpeg ( const char *const  filename,
const unsigned int  first_frame = 0,
const unsigned int  last_frame = ~0U,
const unsigned int  fps = 25 
) const
inline

Save an image sequence, using FFMPEG library.

Definition at line 36413 of file CImg.h.

Referenced by CImgList< uintT >::save().

36414  {
36415  if (is_empty())
36416  throw CImgInstanceException("CImgList<%s>::save_ffmpeg() : File '%s', instance list (%u,%p) is empty.",
36417  pixel_type(),filename?filename:"(null)",width,data);
36418  if (!filename)
36419  throw CImgArgumentException("CImgList<%s>::save_ffmpeg() : Instance list (%u,%p), specified filename is (null).",
36420  pixel_type(),width,data);
36421  if (!fps)
36422  throw CImgArgumentException("CImgList<%s>::save_ffmpeg() : File '%s', specified framerate is 0.",
36423  pixel_type(),filename);
36424  const unsigned int nlast_frame = last_frame==~0U?width-1:last_frame;
36425  if (first_frame>=width || nlast_frame>=width)
36426  throw CImgArgumentException("CImgList<%s>::save_ffmpeg() : File '%s', specified frames [%u,%u] are out of list range (%u elements).",
36427  pixel_type(),filename,first_frame,last_frame,width);
36428  for (unsigned int ll = first_frame; ll<=nlast_frame; ++ll) if (!data[ll].is_sameXYZ(data[0]))
36429  throw CImgInstanceException("CImgList<%s>::save_ffmpeg() : File '%s', images of the sequence have different dimensions.",
36430  pixel_type(),filename);
36431 
36432 #ifndef cimg_use_ffmpeg
36433  return save_ffmpeg_external(filename,first_frame,last_frame);
36434 #else
36435  avcodec_register_all();
36436  av_register_all();
36437  const int
36438  frame_dimx = data[first_frame].dimx(),
36439  frame_dimy = data[first_frame].dimy(),
36440  frame_dimv = data[first_frame].dimv();
36441  if (frame_dimv!=1 && frame_dimv!=3)
36442  throw CImgInstanceException("CImgList<%s>::save_ffmpeg() : File '%s', image[0] (%u,%u,%u,%u,%p) has not 1 or 3 channels.",
36443  pixel_type(),filename,data[0].width,data[0].height,data[0].depth,data[0].dim,data);
36444 
36445  PixelFormat dest_pxl_fmt = PIX_FMT_YUV420P;
36446  PixelFormat src_pxl_fmt = (frame_dimv == 3)?PIX_FMT_RGB24:PIX_FMT_GRAY8;
36447 
36448  int sws_flags = SWS_FAST_BILINEAR; // Interpolation method (keeping same size images for now).
36449  AVOutputFormat *fmt = 0;
36450  fmt = guess_format(0,filename,0);
36451  if (!fmt) fmt = guess_format("mpeg",0,0); // Default format "mpeg".
36452  if (!fmt)
36453  throw CImgArgumentException("CImgList<%s>::save_ffmpeg() : File '%s', could not determine file format from filename.",
36454  pixel_type(),filename);
36455 
36456  AVFormatContext *oc = 0;
36457  oc = av_alloc_format_context();
36458  if (!oc) // Failed to allocate format context.
36459  throw CImgIOException("CImgList<%s>::save_ffmpeg() : File '%s', failed to allocate structure for format context.",
36460  pixel_type(),filename);
36461 
36462  AVCodec *codec = 0;
36463  AVFrame *picture = 0;
36464  AVFrame *tmp_pict = 0;
36465  oc->oformat = fmt;
36466  std::sprintf(oc->filename,"%s",filename);
36467 
36468  // Add video stream.
36469  int stream_index = 0;
36470  AVStream *video_str = 0;
36471  if (fmt->video_codec!=CODEC_ID_NONE) {
36472  video_str = av_new_stream(oc,stream_index);
36473  if (!video_str) { // Failed to allocate stream.
36474  av_free(oc);
36475  throw CImgIOException("CImgList<%s>::save_ffmpeg() : File '%s', failed to allocate video stream structure.",
36476  pixel_type(),filename);
36477  }
36478  } else { // No codec identified.
36479  av_free(oc);
36480  throw CImgIOException("CImgList<%s>::save_ffmpeg() : File '%s', no proper codec identified.",
36481  pixel_type(),filename);
36482  }
36483 
36484  AVCodecContext *c = video_str->codec;
36485  c->codec_id = fmt->video_codec;
36486  c->codec_type = CODEC_TYPE_VIDEO;
36487  c->bit_rate = 400000;
36488  c->width = frame_dimx;
36489  c->height = frame_dimy;
36490  c->time_base.num = 1;
36491  c->time_base.den = fps;
36492  c->gop_size = 12;
36493  c->pix_fmt = dest_pxl_fmt;
36494  if (c->codec_id == CODEC_ID_MPEG2VIDEO) c->max_b_frames = 2;
36495  if (c->codec_id == CODEC_ID_MPEG1VIDEO) c->mb_decision = 2;
36496 
36497  if (av_set_parameters(oc,0)<0) { // Parameters not properly set.
36498  av_free(oc);
36499  throw CImgIOException("CImgList<%s>::save_ffmpeg() : File '%s', parameters for avcodec not properly set.",
36500  pixel_type(),filename);
36501  }
36502 
36503  // Open codecs and alloc buffers.
36504  codec = avcodec_find_encoder(c->codec_id);
36505  if (!codec) { // Failed to find codec.
36506  av_free(oc);
36507  throw CImgIOException("CImgList<%s>::save_ffmpeg() : File '%s', no codec found.",
36508  pixel_type(),filename);
36509  }
36510  if (avcodec_open(c,codec)<0) // Failed to open codec.
36511  throw CImgIOException("CImgList<%s>::save_ffmpeg() : File '%s', failed to open codec.",
36512  pixel_type(),filename);
36513  tmp_pict = avcodec_alloc_frame();
36514  if (!tmp_pict) { // Failed to allocate memory for tmp_pict frame.
36515  avcodec_close(video_str->codec);
36516  av_free(oc);
36517  throw CImgIOException("CImgList<%s>::save_ffmpeg() : File '%s', failed to allocate memory for data buffer.",
36518  pixel_type(),filename);
36519  }
36520  tmp_pict->linesize[0] = (src_pxl_fmt==PIX_FMT_RGB24)?3*frame_dimx:frame_dimx;
36521  tmp_pict->type = FF_BUFFER_TYPE_USER;
36522  int tmp_size = avpicture_get_size(src_pxl_fmt,frame_dimx,frame_dimy);
36523  uint8_t *tmp_buffer = (uint8_t*)av_malloc(tmp_size);
36524  if (!tmp_buffer) { // Failed to allocate memory for tmp buffer.
36525  av_free(tmp_pict);
36526  avcodec_close(video_str->codec);
36527  av_free(oc);
36528  throw CImgIOException("CImgList<%s>::save_ffmpeg() : File '%s', failed to allocate memory for data buffer.",
36529  pixel_type(),filename);
36530  }
36531 
36532  // Associate buffer with tmp_pict.
36533  avpicture_fill((AVPicture*)tmp_pict,tmp_buffer,src_pxl_fmt,frame_dimx,frame_dimy);
36534  picture = avcodec_alloc_frame();
36535  if (!picture) { // Failed to allocate picture frame.
36536  av_free(tmp_pict->data[0]);
36537  av_free(tmp_pict);
36538  avcodec_close(video_str->codec);
36539  av_free(oc);
36540  throw CImgIOException("CImgList<%s>::save_ffmpeg() : File '%s', failed to allocate memory for picture frame.",
36541  pixel_type(),filename);
36542  }
36543 
36544  int size = avpicture_get_size(c->pix_fmt,frame_dimx,frame_dimy);
36545  uint8_t *buffer = (uint8_t*)av_malloc(size);
36546  if (!buffer) { // Failed to allocate picture frame buffer.
36547  av_free(picture);
36548  av_free(tmp_pict->data[0]);
36549  av_free(tmp_pict);
36550  avcodec_close(video_str->codec);
36551  av_free(oc);
36552  throw CImgIOException("CImgList<%s>::save_ffmpeg() : File '%s', failed to allocate memory for picture frame buffer.",
36553  pixel_type(),filename);
36554  }
36555 
36556  // Associate the buffer with picture.
36557  avpicture_fill((AVPicture*)picture,buffer,c->pix_fmt,frame_dimx,frame_dimy);
36558 
36559  // Open file.
36560  if (!(fmt->flags&AVFMT_NOFILE)) {
36561  if (url_fopen(&oc->pb,filename,URL_WRONLY)<0)
36562  throw CImgIOException("CImgList<%s>::save_ffmpeg() : File '%s' cannot be opened.",
36563  pixel_type(),filename);
36564  }
36565 
36566  if (av_write_header(oc)<0)
36567  throw CImgIOException("CImgList<%s>::save_ffmpeg() : File '%s', could not write header.",
36568  pixel_type(),filename);
36569  double video_pts;
36570  SwsContext *img_convert_context = 0;
36571  img_convert_context = sws_getContext(frame_dimx,frame_dimy,src_pxl_fmt,
36572  c->width,c->height,c->pix_fmt,sws_flags,0,0,0);
36573  if (!img_convert_context) { // Failed to get swscale context.
36574  // if (!(fmt->flags & AVFMT_NOFILE)) url_fclose(&oc->pb);
36575  av_free(picture->data);
36576  av_free(picture);
36577  av_free(tmp_pict->data[0]);
36578  av_free(tmp_pict);
36579  avcodec_close(video_str->codec);
36580  av_free(oc);
36581  throw CImgIOException("CImgList<%s>::save_ffmpeg() : File '%', failed to get conversion context.",
36582  pixel_type(),filename);
36583  }
36584  int ret = 0, out_size;
36585  uint8_t *video_outbuf = 0;
36586  int video_outbuf_size = 1000000;
36587  video_outbuf = (uint8_t*)av_malloc(video_outbuf_size);
36588  if (!video_outbuf) {
36589  // if (!(fmt->flags & AVFMT_NOFILE)) url_fclose(&oc->pb);
36590  av_free(picture->data);
36591  av_free(picture);
36592  av_free(tmp_pict->data[0]);
36593  av_free(tmp_pict);
36594  avcodec_close(video_str->codec);
36595  av_free(oc);
36596  throw CImgIOException("CImgList<%s>::save_ffmpeg() : File '%s', memory allocation error.",
36597  pixel_type(),filename);
36598  }
36599 
36600  // Loop through each desired image in list.
36601  for (unsigned int i = first_frame; i<=nlast_frame; ++i) {
36602  CImg<uint8_t> currentIm = data[i], red, green, blue, gray;
36603  if (src_pxl_fmt == PIX_FMT_RGB24) {
36604  red = currentIm.get_shared_channel(0);
36605  green = currentIm.get_shared_channel(1);
36606  blue = currentIm.get_shared_channel(2);
36607  cimg_forXY(currentIm,X,Y) { // Assign pizel values to data buffer in interlaced RGBRGB ... format.
36608  tmp_pict->data[0][Y*tmp_pict->linesize[0] + 3*X] = red(X,Y);
36609  tmp_pict->data[0][Y*tmp_pict->linesize[0] + 3*X + 1] = green(X,Y);
36610  tmp_pict->data[0][Y*tmp_pict->linesize[0] + 3*X + 2] = blue(X,Y);
36611  }
36612  } else {
36613  gray = currentIm.get_shared_channel(0);
36614  cimg_forXY(currentIm,X,Y) tmp_pict->data[0][Y*tmp_pict->linesize[0] + X] = gray(X,Y);
36615  }
36616 
36617  if (video_str) video_pts = (video_str->pts.val * video_str->time_base.num)/(video_str->time_base.den);
36618  else video_pts = 0.0;
36619  if (!video_str) break;
36620  if (sws_scale(img_convert_context,tmp_pict->data,tmp_pict->linesize,0,c->height,picture->data,picture->linesize)<0) break;
36621  out_size = avcodec_encode_video(c,video_outbuf,video_outbuf_size,picture);
36622  if (out_size>0) {
36623  AVPacket pkt;
36624  av_init_packet(&pkt);
36625  pkt.pts = av_rescale_q(c->coded_frame->pts,c->time_base,video_str->time_base);
36626  if (c->coded_frame->key_frame) pkt.flags|=PKT_FLAG_KEY;
36627  pkt.stream_index = video_str->index;
36628  pkt.data = video_outbuf;
36629  pkt.size = out_size;
36630  ret = av_write_frame(oc,&pkt);
36631  } else if (out_size<0) break;
36632  if (ret) break; // Error occured in writing frame.
36633  }
36634 
36635  // Close codec.
36636  if (video_str) {
36637  avcodec_close(video_str->codec);
36638  av_free(picture->data[0]);
36639  av_free(picture);
36640  av_free(tmp_pict->data[0]);
36641  av_free(tmp_pict);
36642  }
36643  if (av_write_trailer(oc)<0)
36644  throw CImgIOException("CImgList<%s>::save_ffmpeg() : File '%s', failed to write trailer.",
36645  pixel_type(),filename);
36646  av_freep(&oc->streams[stream_index]->codec);
36647  av_freep(&oc->streams[stream_index]);
36648  if (!(fmt->flags&AVFMT_NOFILE)) {
36649  /*if (url_fclose(oc->pb)<0)
36650  throw CImgIOException("CImgList<%s>::save_ffmpeg() : File '%s', failed to close file.",
36651  pixel_type(),filename);
36652  */
36653  }
36654  av_free(oc);
36655  av_free(video_outbuf);
36656 #endif
36657  return *this;
36658  }
if(dy > dx)
NT & den
unsigned int size() const
Return the size of the list.
Definition: CImg.h:34470
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
blockLoc i
Definition: read.cpp:79
#define cimg_forXY(img, x, y)
Definition: CImg.h:597
bool is_empty() const
Return true if list is empty.
Definition: CImg.h:34734
const CImgList< T > & save_ffmpeg_external(const char *const filename, const unsigned int first_frame=0, const unsigned int last_frame=~0U, const char *const codec="mpeg2video") const
Save an image sequence using the external tool &#39;ffmpeg&#39;.
Definition: CImg.h:36975

Here is the caller graph for this function:

const CImgList<T>& save_ffmpeg_external ( const char *const  filename,
const unsigned int  first_frame = 0,
const unsigned int  last_frame = ~0U,
const char *const  codec = "mpeg2video" 
) const
inline

Save an image sequence using the external tool 'ffmpeg'.

Definition at line 36975 of file CImg.h.

Referenced by CImgList< uintT >::save_ffmpeg().

36976  {
36977  if (is_empty())
36978  throw CImgInstanceException("CImgList<%s>::save_ffmpeg_external() : File '%s', instance list (%u,%p) is empty.",
36979  pixel_type(),filename?filename:"(null)",width,data);
36980  if (!filename)
36981  throw CImgArgumentException("CImgList<%s>::save_ffmpeg_external() : Instance list (%u,%p), specified filename is (null).",
36982  pixel_type(),width,data);
36983  char command[1024] = { 0 }, filetmp[512] = { 0 }, filetmp2[512] = { 0 };
36984  std::FILE *file = 0;
36985  const unsigned int nlast_frame = last_frame==~0U?width-1:last_frame;
36986  if (first_frame>=width || nlast_frame>=width)
36987  throw CImgArgumentException("CImgList<%s>::save_ffmpeg_external() : File '%s', specified frames [%u,%u] are out of list range (%u elements).",
36988  pixel_type(),filename,first_frame,last_frame,width);
36989  for (unsigned int ll = first_frame; ll<=nlast_frame; ++ll) if (!data[ll].is_sameXYZ(data[0]))
36990  throw CImgInstanceException("CImgList<%s>::save_ffmpeg_external() : File '%s', all images of the sequence must be of the same dimension.",
36991  pixel_type(),filename);
36992  do {
36993  std::sprintf(filetmp,"%s%c%s",cimg::temporary_path(),cimg_file_separator,cimg::filenamerand());
36994  std::sprintf(filetmp2,"%s_000001.ppm",filetmp);
36995  if ((file=std::fopen(filetmp2,"rb"))!=0) std::fclose(file);
36996  } while (file);
36997  for (unsigned int l = first_frame; l<=nlast_frame; ++l) {
36998  std::sprintf(filetmp2,"%s_%.6u.ppm",filetmp,l+1);
36999  if (data[l].depth>1 || data[l].dim!=3) data[l].get_resize(-100,-100,1,3).save_pnm(filetmp2);
37000  else data[l].save_pnm(filetmp2);
37001  }
37002 #if cimg_OS!=2
37003  std::sprintf(command,"ffmpeg -i %s_%%6d.ppm -vcodec %s -sameq -y \"%s\" >/dev/null 2>&1",filetmp,codec,filename);
37004 #else
37005  std::sprintf(command,"\"ffmpeg -i %s_%%6d.ppm -vcodec %s -sameq -y \"%s\"\" >NUL 2>&1",filetmp,codec,filename);
37006 #endif
37007  cimg::system(command);
37008  file = std::fopen(filename,"rb");
37009  if (!file)
37010  throw CImgIOException("CImg<%s>::save_ffmpeg_external() : Failed to save image sequence '%s'.\n\n",
37011  pixel_type(),filename);
37012  else cimg::fclose(file);
37013  cimglist_for(*this,lll) { std::sprintf(filetmp2,"%s_%.6u.ppm",filetmp,lll+1); std::remove(filetmp2); }
37014  return *this;
37015  }
#define cimg_file_separator
Definition: CImg.h:144
const char * filenamerand()
Definition: CImg.h:4996
int fclose(std::FILE *file)
Close a file, and check for possible errors.
Definition: CImg.h:5507
const char * temporary_path(const char *const user_path=0, const bool reinit_path=false)
Return or set path to store temporary files.
Definition: CImg.h:5017
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
#define cimglist_for(list, l)
Definition: CImg.h:1877
int system(const char *const command, const char *const module_name=0)
Definition: CImg.h:4491
bool is_empty() const
Return true if list is empty.
Definition: CImg.h:34734
std::FILE * fopen(const char *const path, const char *const mode)
Open a file, and check for possible errors.
Definition: CImg.h:5494

Here is the caller graph for this function:

const CImgList<T>& save_gzip_external ( const char *const  filename) const
inline

Save a file in TIFF format.

Save an image list as a gzipped file, using external tool 'gzip'.

Definition at line 36943 of file CImg.h.

Referenced by CImgList< uintT >::save().

36943  {
36944  if (!filename)
36945  throw CImgIOException("CImg<%s>::save_gzip_external() : Cannot save (null) filename.",
36946  pixel_type());
36947  char command[1024] = { 0 }, filetmp[512] = { 0 }, body[512] = { 0 };
36948  const char
36949  *ext = cimg::split_filename(filename,body),
36950  *ext2 = cimg::split_filename(body,0);
36951  std::FILE *file;
36952  do {
36953  if (!cimg::strcasecmp(ext,"gz")) {
36954  if (*ext2) std::sprintf(filetmp,"%s%c%s.%s",cimg::temporary_path(),cimg_file_separator,cimg::filenamerand(),ext2);
36955  else std::sprintf(filetmp,"%s%c%s.cimg",cimg::temporary_path(),cimg_file_separator,cimg::filenamerand());
36956  } else {
36957  if (*ext) std::sprintf(filetmp,"%s%c%s.%s",cimg::temporary_path(),cimg_file_separator,cimg::filenamerand(),ext);
36958  else std::sprintf(filetmp,"%s%c%s.cimg",cimg::temporary_path(),cimg_file_separator,cimg::filenamerand());
36959  }
36960  if ((file=std::fopen(filetmp,"rb"))!=0) std::fclose(file);
36961  } while (file);
36962  save(filetmp);
36963  std::sprintf(command,"%s -c %s > \"%s\"",cimg::gzip_path(),filetmp,filename);
36964  cimg::system(command);
36965  file = std::fopen(filename,"rb");
36966  if (!file)
36967  throw CImgIOException("CImgList<%s>::save_gzip_external() : File '%s' cannot be saved.",
36968  pixel_type(),filename);
36969  else cimg::fclose(file);
36970  std::remove(filetmp);
36971  return *this;
36972  }
#define cimg_file_separator
Definition: CImg.h:144
const char * gzip_path(const char *const user_path=0, const bool reinit_path=false)
Return or set path to the &#39;gzip&#39; command.
Definition: CImg.h:5377
const char * filenamerand()
Definition: CImg.h:4996
int fclose(std::FILE *file)
Close a file, and check for possible errors.
Definition: CImg.h:5507
const char * temporary_path(const char *const user_path=0, const bool reinit_path=false)
Return or set path to store temporary files.
Definition: CImg.h:5017
const CImgList< T > & save(const char *const filename, const int number=-1) const
Save an image list into a file.
Definition: CImg.h:36342
static const char * pixel_type()
Return a string describing the type of the image pixels in the list (template parameter T)...
Definition: CImg.h:34460
int strcasecmp(const char *const s1, const char *const s2)
Compare two C-strings, ignoring the case.
Definition: CImg.h:4928
int system(const char *const command, const char *const module_name=0)
Definition: CImg.h:4491
const char * split_filename(const char *const filename, char *const body=0)
Split a filename into two strings &#39;body&#39; and &#39;extension&#39;.
Definition: CImg.h:5470
std::FILE * fopen(const char *const path, const char *const mode)
Open a file, and check for possible errors.
Definition: CImg.h:5494

Here is the caller graph for this function:

const CImgList<T>& save_yuv ( const char *const  filename = 0,
const bool  rgb2yuv = true 
) const
inline

Save an image sequence into a YUV file.

Definition at line 36685 of file CImg.h.

Referenced by CImgList< uintT >::save().

36685  {
36686  return _save_yuv(0,filename,rgb2yuv);
36687  }
const CImgList< T > & _save_yuv(std::FILE *const file, const char *const filename, const bool rgb2yuv) const
Definition: CImg.h:36661

Here is the caller graph for this function:

const CImgList<T>& save_yuv ( std::FILE *const  file,
const bool  rgb2yuv = true 
) const
inline

Save an image sequence into a YUV file.

Definition at line 36690 of file CImg.h.

36690  {
36691  return _save_yuv(file,0,rgb2yuv);
36692  }
const CImgList< T > & _save_yuv(std::FILE *const file, const char *const filename, const bool rgb2yuv) const
Definition: CImg.h:36661
unsigned int size ( ) const
inline

Return the size of the list.

Definition at line 34470 of file CImg.h.

Referenced by CImg< uintT >::_display_object3d(), CImg< uintT >::_save_off(), CImg< uintT >::draw_spline(), CImgList< uintT >::save_ffmpeg(), and CImgList< uintT >::transfer_to().

34470  {
34471  return width;
34472  }
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883

Here is the caller graph for this function:

CImgList<T>& split ( const char  axis,
const int  nb = 0 
)
inline

Return a list where each image has been split along the specified axis.

Definition at line 35392 of file CImg.h.

35392  {
35393  return get_split(axis,nb).transfer_to(*this);
35394  }
CImgList< T > get_split(const char axis, const int nb=0) const
Definition: CImg.h:35396
CImgList<T>& swap ( CImgList< T > &  list)
inline

Swap all fields of two CImgList instances (use with care !)

Definition at line 34325 of file CImg.h.

Referenced by CImgList< uintT >::reverse(), and CImgList< uintT >::transfer_to().

34325  {
34326  cimg::swap(width,list.width);
34327  cimg::swap(allocated_width,list.allocated_width);
34328  cimg::swap(data,list.data);
34329  return list;
34330  }
void swap(T &a, T &b)
Exchange values of variables a and b.
Definition: CImg.h:4522
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
unsigned int allocated_width
Allocation size of the list.
Definition: CImg.h:33886

Here is the caller graph for this function:

CImgList<T>& transfer_to ( CImgList< t > &  list)
inline

Transfer the content of the instance image list into another one.

Definition at line 34302 of file CImg.h.

Referenced by cimg_library::cimg::dialog(), CImgList< uintT >::get_crop_font(), CImg< uintT >::load_cimg(), CImg< uintT >::load_parrec(), CImgList< uintT >::load_parrec(), and CImgList< uintT >::value_string().

34302  {
34303  list.assign(size());
34304  cimglist_for(*this,l) data[l].transfer_to(list[l]);
34305  assign();
34306  return list;
34307  }
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
unsigned int size() const
Return the size of the list.
Definition: CImg.h:34470
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
#define cimglist_for(list, l)
Definition: CImg.h:1877
CImgList< T > & transfer_to(CImgList< t > &list)
Transfer the content of the instance image list into another one.
Definition: CImg.h:34302

Here is the caller graph for this function:

CImgList<T>& transfer_to ( CImgList< T > &  list)
inline

Definition at line 34309 of file CImg.h.

34309  {
34310  list.assign();
34311  return swap(list);
34312  }
CImgList< T > & swap(CImgList< T > &list)
Swap all fields of two CImgList instances (use with care !)
Definition: CImg.h:34325
CImgList<t>& transfer_to ( CImgList< t > &  list,
const unsigned int  pos 
)
inline

Definition at line 34315 of file CImg.h.

34315  {
34316  if (is_empty()) return list;
34317  const unsigned int npos = pos>list.width?list.width:pos;
34318  list.insert(width,npos);
34319  cimglist_for(*this,l) (*this)[l].transfer_to(list.at(npos+l));
34320  assign();
34321  return list;
34322  }
CImgList< T > & assign()
In-place version of the default constructor and default destructor.
Definition: CImg.h:34151
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
#define cimglist_for(list, l)
Definition: CImg.h:1877
bool is_empty() const
Return true if list is empty.
Definition: CImg.h:34734
CImg<charT> value_string ( const char  separator = ',',
const unsigned int  max_size = 0 
) const
inline

Return a C-string containing the values of all images in the instance list.

Definition at line 34712 of file CImg.h.

34712  {
34713  if (is_empty()) return CImg<ucharT>(1,1,1,1,0);
34714  CImgList<charT> items;
34715  for (unsigned int l = 0; l<width-1; ++l) {
34716  CImg<charT> item = data[l].value_string(separator,0);
34717  item.back() = separator;
34718  item.transfer_to(items);
34719  }
34720  data[width-1].value_string(separator,0).transfer_to(items);
34721  CImg<charT> res; (items>'x').transfer_to(res);
34722  if (max_size) { res.crop(0,max_size); res(max_size) = 0; }
34723  return res;
34724  }
unsigned int width
Size of the list (number of images).
Definition: CImg.h:33883
CImg< T > * data
Pointer to the first list element.
Definition: CImg.h:33889
CImgList< T > & transfer_to(CImgList< t > &list)
Transfer the content of the instance image list into another one.
Definition: CImg.h:34302
bool is_empty() const
Return true if list is empty.
Definition: CImg.h:34734

Member Data Documentation

unsigned int allocated_width
CImg<T>* data

Pointer to the first list element.

Definition at line 33889 of file CImg.h.

Referenced by CImgList< uintT >::_atN(), CImgList< uintT >::_atNX(), CImgList< uintT >::_atNXY(), CImgList< uintT >::_atNXYZ(), CImgList< uintT >::_atNXYZV(), CImg< uintT >::_draw_text(), CImgList< uintT >::_save_cimg(), CImgList< uintT >::_save_yuv(), CImgList< uintT >::assign(), CImgList< uintT >::at(), CImgList< uintT >::atNX(), CImgList< uintT >::atNXY(), CImgList< uintT >::atNXYZ(), CImgList< uintT >::atNXYZV(), CImgList< uintT >::back(), CImgList< uintT >::begin(), CImgList< uintT >::CImgList(), CImgList< uintT >::contains(), CImgList< uintT >::containsNXYZV(), CImgList< uintT >::display(), CImgList< uintT >::end(), CImgList< uintT >::erase(), CImgList< uintT >::FFT(), CImgList< uintT >::front(), CImgList< uintT >::get_images(), CImgList< uintT >::get_shared(), CImgList< uintT >::get_shared_images(), CImgList< uintT >::get_split(), CImgList< uintT >::insert(), CImgList< uintT >::is_empty(), CImgList< uintT >::is_sameXYZV(), CImgList< uintT >::load(), CImgList< uintT >::load_tiff(), CImgList< uintT >::max(), CImgList< uintT >::maxmin(), CImgList< uintT >::min(), CImgList< uintT >::minmax(), CImgList< uintT >::operator[](), CImgList< uintT >::print(), CImgList< uintT >::ptr(), CImgList< uintT >::remove(), CImgList< uintT >::reverse_object3d(), CImgList< uintT >::save(), CImgList< uintT >::save_ffmpeg(), CImgList< uintT >::save_ffmpeg_external(), CImgList< uintT >::swap(), CImgList< uintT >::transfer_to(), CImgList< uintT >::value_string(), and CImgList< uintT >::~CImgList().


The documentation for this struct was generated from the following file: