Blender  V3.3
Public Member Functions | Protected Attributes | List of all members
Freestyle::FrsImage Class Referenceabstract

#include <Image.h>

Inheritance diagram for Freestyle::FrsImage:
Freestyle::GrayImage Freestyle::RGBImage

Public Member Functions

 FrsImage ()
 
 FrsImage (const FrsImage &brother)
 
 FrsImage (unsigned w, unsigned h)
 
 FrsImage (unsigned w, unsigned h, unsigned sw, unsigned sh, unsigned ox, unsigned oy)
 
FrsImageoperator= (const FrsImage &brother)
 
virtual ~FrsImage ()
 
unsigned width () const
 
unsigned height () const
 
virtual float pixel (unsigned x, unsigned y) const =0
 
virtual void setArray (float *array, unsigned width, unsigned height, unsigned sw, unsigned sh, unsigned x, unsigned y, bool copy=true)=0
 
virtual floatgetArray ()=0
 

Protected Attributes

unsigned _width
 
unsigned _height
 
unsigned _storedWidth
 
unsigned _storedHeight
 
unsigned _Ox
 
unsigned _Oy
 

Detailed Description

This class allows the storing of part of an image, while allowing a normal access to its pixel values. You can for example only a rectangle of sw*sh, whose lower-left corner is at (ox, oy), of an image of size w*h, and access these pixels using x,y coordinates specified in the whole image coordinate system.

Definition at line 28 of file freestyle/intern/image/Image.h.

Constructor & Destructor Documentation

◆ FrsImage() [1/4]

Freestyle::FrsImage::FrsImage ( )
inline

Default constructor

Definition at line 31 of file freestyle/intern/image/Image.h.

References _height, _Ox, _Oy, _storedHeight, _storedWidth, and _width.

◆ FrsImage() [2/4]

Freestyle::FrsImage::FrsImage ( const FrsImage brother)
inline

Copy constructor

Definition at line 42 of file freestyle/intern/image/Image.h.

References _height, _Ox, _Oy, _storedHeight, _storedWidth, and _width.

◆ FrsImage() [3/4]

Freestyle::FrsImage::FrsImage ( unsigned  w,
unsigned  h 
)
inline

Builds an FrsImage from its width and height. The memory is allocated consequently.

Definition at line 55 of file freestyle/intern/image/Image.h.

References _height, _Ox, _Oy, _storedHeight, _storedWidth, _width, and w().

◆ FrsImage() [4/4]

Freestyle::FrsImage::FrsImage ( unsigned  w,
unsigned  h,
unsigned  sw,
unsigned  sh,
unsigned  ox,
unsigned  oy 
)
inline

Builds a partial-storing image.

Parameters
wThe width of the complete image
hThe height of the complete image
swThe width of the rectangle that will actually be stored.
shThe height of the rectangle that will actually be stored.
oxThe x-abscissa of the origin of the rectangle that will actually be stored.
oyThe x-abscissa of the origin of the rectangle that will actually be stored.

Definition at line 79 of file freestyle/intern/image/Image.h.

References _height, _Ox, _Oy, _storedHeight, _storedWidth, _width, sh, sw, and w().

◆ ~FrsImage()

virtual Freestyle::FrsImage::~FrsImage ( )
inlinevirtual

Destructor

Definition at line 102 of file freestyle/intern/image/Image.h.

Member Function Documentation

◆ getArray()

virtual float* Freestyle::FrsImage::getArray ( )
pure virtual

Returns the array containing the pixels values. Its size is sw*sh, i.e. potentially a smaller rectangular part of the complete image.

Implemented in Freestyle::GrayImage, and Freestyle::RGBImage.

◆ height()

unsigned Freestyle::FrsImage::height ( void  ) const
inline

◆ operator=()

FrsImage& Freestyle::FrsImage::operator= ( const FrsImage brother)
inline

Operator=

Definition at line 90 of file freestyle/intern/image/Image.h.

References _height, _Ox, _Oy, _storedHeight, _storedWidth, and _width.

◆ pixel()

virtual float Freestyle::FrsImage::pixel ( unsigned  x,
unsigned  y 
) const
pure virtual

Returns the gray value for pixel x,y

Implemented in Freestyle::GrayImage, and Freestyle::RGBImage.

◆ setArray()

virtual void Freestyle::FrsImage::setArray ( float array,
unsigned  width,
unsigned  height,
unsigned  sw,
unsigned  sh,
unsigned  x,
unsigned  y,
bool  copy = true 
)
pure virtual

Sets the array.

Parameters
arrayThe array containing the values we wish to store. Its size is sw*sh.
widthThe width of the complete image
heightThe height of the complete image
swThe width of the rectangle that will actually be stored.
shThe height of the rectangle that will actually be stored.
oxThe x-abscissa of the origin of the rectangle that will actually be stored.
oyThe x-abscissa of the origin of the rectangle that will actually be stored.
copyIf true, the array is copied, otherwise the pointer is copied

Implemented in Freestyle::RGBImage, and Freestyle::GrayImage.

◆ width()

unsigned Freestyle::FrsImage::width ( void  ) const
inline

Member Data Documentation

◆ _height

unsigned Freestyle::FrsImage::_height
protected

◆ _Ox

unsigned Freestyle::FrsImage::_Ox
protected

◆ _Oy

unsigned Freestyle::FrsImage::_Oy
protected

◆ _storedHeight

unsigned Freestyle::FrsImage::_storedHeight
protected

◆ _storedWidth

unsigned Freestyle::FrsImage::_storedWidth
protected

◆ _width

unsigned Freestyle::FrsImage::_width
protected

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