Menu

[r1180]: / trunk / matplotlib / src / _image.h  Maximize  Restore  History

Download this file

125 lines (96 with data), 3.3 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
/* image.h
*
*/
#ifndef _IMAGE_H
#define _IMAGE_H
#include "Python.h"
#include "agg_trans_affine.h"
#include "agg_rendering_buffer.h"
#include "agg_color_rgba8.h"
#include "CXX/Extensions.hxx"
class Image : public Py::PythonExtension<Image> {
public:
Image();
virtual ~Image();
static void init_type(void);
int setattr( const char*, const Py::Object & );
Py::Object getattr( const char * name );
Py::Object apply_rotation(const Py::Tuple& args);
Py::Object apply_scaling(const Py::Tuple& args);
Py::Object apply_translation(const Py::Tuple& args);
Py::Object as_str(const Py::Tuple& args);
Py::Object buffer_argb32(const Py::Tuple& args);
Py::Object reset_matrix(const Py::Tuple& args);
Py::Object resize(const Py::Tuple& args);
Py::Object get_aspect(const Py::Tuple& args);
Py::Object get_size(const Py::Tuple& args);
Py::Object get_interpolation(const Py::Tuple& args);
Py::Object set_interpolation(const Py::Tuple& args);
Py::Object set_aspect(const Py::Tuple& args);
Py::Object write_png(const Py::Tuple& args);
Py::Object set_bg(const Py::Tuple& args);
enum { BICUBIC=0, BILINEAR, BLACKMAN100, BLACKMAN256, BLACKMAN64,
NEAREST, SINC144, SINC256, SINC64, SPLINE16, SPLINE36};
enum { ASPECT_PRESERVE=0, ASPECT_FREE};
agg::int8u *bufferIn;
agg::rendering_buffer *rbufIn;
size_t colsIn, rowsIn;
agg::int8u *bufferOut;
agg::rendering_buffer *rbufOut;
size_t colsOut, rowsOut;
unsigned BPP;
unsigned interpolation, aspect;
agg::rgba bg;
private:
Py::Dict __dict__;
agg::trans_affine srcMatrix, imageMatrix;
static char apply_rotation__doc__[];
static char apply_scaling__doc__[];
static char apply_translation__doc__[];
static char as_str__doc__[];
static char buffer_argb32__doc__[];
static char reset_matrix__doc__[];
static char resize__doc__[];
static char get_aspect__doc__[];
static char get_size__doc__[];
static char get_interpolation__doc__[];
static char set_interpolation__doc__[];
static char set_aspect__doc__[];
static char write_png__doc__[];
static char set_bg__doc__[];
};
/*
class ImageComposite : public Py::PythonExtension<ImageComposite> {
}
*/
// the extension module
class _image_module : public Py::ExtensionModule<_image_module>
{
public:
_image_module() : Py::ExtensionModule<_image_module>( "_image" )
{
Image::init_type();
add_varargs_method("fromarray", &_image_module::fromarray,
"fromarray");
add_varargs_method("fromarray2", &_image_module::fromarray2,
"fromarray2");
add_varargs_method("frombuffer", &_image_module::frombuffer,
"frombuffer");
add_varargs_method("readpng", &_image_module::readpng,
"readpng");
add_varargs_method("from_images", &_image_module::from_images,
"from_images");
initialize( "The _image module" );
}
~_image_module() {}
private:
Py::Object frombuffer (const Py::Tuple &args);
Py::Object fromarray (const Py::Tuple &args);
Py::Object fromarray2 (const Py::Tuple &args);
Py::Object readpng (const Py::Tuple &args);
Py::Object from_images (const Py::Tuple &args);
static char _image_module_fromarray__doc__[];
static char _image_module_fromarray2__doc__[];
static char _image_module_frombuffer__doc__[];
};
#endif
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.