floatimage
This commit is contained in:
@ -160,6 +160,53 @@ namespace ams
|
||||
amsbitplane rescale(int _Nx, int _Ny); //todo
|
||||
};
|
||||
|
||||
class amsfloatimage
|
||||
{
|
||||
public:
|
||||
int Nx,Ny; //image extent
|
||||
//int Nc; //number of color-planes (1,3,4)
|
||||
//Assume we're talking about an RGBA image internally, greyscale is what bitplane is for
|
||||
float *data; //[(x + width*y)*4]
|
||||
|
||||
int& width; //aliases to Nx,Ny
|
||||
int& height;
|
||||
|
||||
amsfloatimage();
|
||||
~amsfloatimage();
|
||||
amsfloatimage(const amsfloatimage& other);
|
||||
amsfloatimage(amsfloatimage&& other) noexcept;
|
||||
amsfloatimage& operator=(const amsfloatimage& other);
|
||||
amsfloatimage& operator=(amsfloatimage&& other) noexcept;
|
||||
|
||||
int resize(int _Nx, int _Ny);
|
||||
|
||||
amsfloatimage subimage(int I0, int J0, int I1, int J1) const;
|
||||
amsfloatimage transpose() const;
|
||||
amsfloatimage rotcw() const;
|
||||
amsfloatimage rotccw() const;
|
||||
amsfloatimage flipx() const;
|
||||
amsfloatimage flipy() const;
|
||||
|
||||
amsfloatpixel get_pixel(int I,int J) const;
|
||||
int set_pixel(int I,int J,const amsfloatpixel pix);
|
||||
int set_pixel(int I,int J,float R, float G, float B, float A);
|
||||
float& operator[](int ind);
|
||||
const float& operator[](int ind) const;
|
||||
float& operator()(int Nc, int I, int J);
|
||||
const float& operator()(int Nc, int I, int J) const;
|
||||
|
||||
int apply_image(int x0, int y0, const amsfloatimage *img);
|
||||
|
||||
void clear();
|
||||
void setall(amsfloatpixel color);
|
||||
|
||||
//don't implement this yet
|
||||
amsfloatpixel interpolate(float x, float y) const;
|
||||
|
||||
// //rescales the image with linear interpolation
|
||||
amsfloatimage rescale(int nnx, int nny);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -109,6 +109,50 @@ float mod(float x, float n);
|
||||
int32_t mod(int32_t x, int32_t n);
|
||||
int64_t mod(int64_t x, int64_t n);
|
||||
|
||||
|
||||
void amsfloatimage_region_set(
|
||||
float *data,
|
||||
int Nx, int Ny,
|
||||
int x0, int y0,
|
||||
int x1, int y1,
|
||||
amsfloatpixel val
|
||||
);
|
||||
|
||||
void amsfloatimage_region_copy(
|
||||
float *datato,
|
||||
int Nxto,
|
||||
int Nyto,
|
||||
const float *datafrom,
|
||||
int Nxfrom,
|
||||
int Nyfrom,
|
||||
int offsetx,
|
||||
int offsety
|
||||
);
|
||||
|
||||
void amsfloatimage_region_castcopy(
|
||||
uint8_t *datato,
|
||||
int Nxto,
|
||||
int Nyto,
|
||||
const float *datafrom,
|
||||
int Nxfrom,
|
||||
int Nyfrom,
|
||||
int offsetx,
|
||||
int offsety
|
||||
);
|
||||
|
||||
void amsfloatimage_region_castcopy(
|
||||
float *datato,
|
||||
int Nxto,
|
||||
int Nyto,
|
||||
const uint8_t *datafrom,
|
||||
int Nxfrom,
|
||||
int Nyfrom,
|
||||
int offsetx,
|
||||
int offsety
|
||||
);
|
||||
|
||||
|
||||
|
||||
}; //end namespace imglib4
|
||||
}; //end namespace ams
|
||||
|
||||
|
Reference in New Issue
Block a user