added: a new winix function: imgcrop
for cropping images (and thumbnails) www.domain.com/dir/file.jpg/imgcrop -- crop an image www.domain.com/dir/file.jpg/imgcrop/thumb -- crop an image's thumbnail www.domain.com/dir/file.jpg/imgcrop/newthumb -- crop and create a new thumbnail (from an original image) www.domain.com/dir/imgcrop -- show images' list with above options added: to Image class: some methods for cropping git-svn-id: svn://ttmath.org/publicrep/winix/trunk@919 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
16
core/misc.h
16
core/misc.h
@@ -38,6 +38,11 @@ long Tol(const std::wstring & str, int base = 10);
|
||||
long Tol(const char * str, int base = 10);
|
||||
long Tol(const wchar_t * str, int base = 10);
|
||||
|
||||
double Tod(const std::string & str);
|
||||
double Tod(const std::wstring & str);
|
||||
double Tod(const char * str);
|
||||
double Tod(const wchar_t * str);
|
||||
|
||||
|
||||
// if the buffer is too small it will be terminated at the beginning (empty string)
|
||||
// and the function returns false
|
||||
@@ -996,6 +1001,17 @@ size_t i1, i2;
|
||||
|
||||
|
||||
|
||||
template<typename IntType>
|
||||
void SetMinMax(IntType & val, IntType min_val, IntType max_val)
|
||||
{
|
||||
if( val < min_val )
|
||||
val = min_val;
|
||||
|
||||
if( val > max_val )
|
||||
val = max_val;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user