Native bitmap: image stored in graphics card format, fast to display.
More...
#include "Imagine/Graphics.h"
|
|
| NativeBitmap () |
| | Empty constructor.
|
| |
| | NativeBitmap (int w, int h) |
| | Constructor with dimensions. More...
|
| |
|
| NativeBitmap (const NativeBitmap &I) |
| | Copy constructor.
|
| |
|
| ~NativeBitmap () |
| | Destructor.
|
| |
|
const NativeBitmap & | operator= (const NativeBitmap &I) |
| | Assignment.
|
| |
| void | setColorImage (int x, int y, const octet *r, const octet *g, const octet *b, int w, int h) |
| | Set color image. More...
|
| |
| void | setColorImage (const IntPoint2 &p, const octet *r, const octet *g, const octet *b, int w, int h) |
| | Set color image. More...
|
| |
| void | setColorImage (int x, int y, const Color *cols, int w, int h) |
| | Set color image. More...
|
| |
| void | setColorImage (const IntPoint2 &p, const Color *cols, int w, int h) |
| | Set color image. More...
|
| |
| void | setColorImage (int x, int y, const octet *rgb, int w, int h) |
| | Set color image. More...
|
| |
| void | setColorImage (const IntPoint2 &p, const octet *rgb, int w, int h) |
| | Set color image. More...
|
| |
| void | setGreyImage (int x, int y, const octet *g, int w, int h) |
| | Set grey image. More...
|
| |
| void | setGreyImage (const IntPoint2 &p, const octet *g, int w, int h) |
| | Set grey image. More...
|
| |
| void | setPoint (int x, int y, Color col) |
| | Set point. More...
|
| |
| void | setPoint (const IntPoint2 &p, Color col) |
| | Set point. More...
|
| |
Use it if you want to display the image many times (for example in an animation).
- Examples:
- Graphics/test/example.cpp, and Graphics/test/test.cpp.
| Imagine::NativeBitmap::NativeBitmap |
( |
int |
w, |
|
|
int |
h |
|
) |
| |
Contructs a native bitmap of dimensions (w,h)
- Parameters
-
| void Imagine::NativeBitmap::setColorImage |
( |
int |
x, |
|
|
int |
y, |
|
|
const octet * |
r, |
|
|
const octet * |
g, |
|
|
const octet * |
b, |
|
|
int |
w, |
|
|
int |
h |
|
) |
| |
Fills part of a native bitmap with a bitmap.
- Parameters
-
| x,y | top left position in native bitmap |
| r,g,b | source to be copied into native bitmap |
| w,h | dimensions |
octet r2[sz*sz],g2[sz*sz],b2[sz*sz];
for (int y=0;y<sz;y++) {
for (int x=0;x<sz;x++) {
r2[x+sz*y]=x;
g2[x+sz*y]=y;
b2[x+sz*y]=(x+y);
}
}
bm.setColorImage(0,0,r2,g2,b2,sz,sz);
bm.setColorImage(
IntPoint2(0,0),r2,g2,b2,sz,sz);
| void Imagine::NativeBitmap::setColorImage |
( |
const IntPoint2 & |
p, |
|
|
const octet * |
r, |
|
|
const octet * |
g, |
|
|
const octet * |
b, |
|
|
int |
w, |
|
|
int |
h |
|
) |
| |
|
inline |
Fills part of a native bitmap with a bitmap.
- Parameters
-
| p | top left position in native bitmap |
| r,g,b | source to be copied into native bitmap |
| w,h | dimensions |
octet r2[sz*sz],g2[sz*sz],b2[sz*sz];
for (int y=0;y<sz;y++) {
for (int x=0;x<sz;x++) {
r2[x+sz*y]=x;
g2[x+sz*y]=y;
b2[x+sz*y]=(x+y);
}
}
bm.setColorImage(0,0,r2,g2,b2,sz,sz);
bm.setColorImage(
IntPoint2(0,0),r2,g2,b2,sz,sz);
| void Imagine::NativeBitmap::setColorImage |
( |
int |
x, |
|
|
int |
y, |
|
|
const Color * |
cols, |
|
|
int |
w, |
|
|
int |
h |
|
) |
| |
Fills part of a native bitmap with a bitmap.
- Parameters
-
| x,y | top left position in native bitmap |
| cols | source to be copied into native bitmap |
| w,h | dimensions |
for (int y=0;y<64;y++)
for (int x=0;x<64;x++)
cols2[x+64*y]=
Color((x+y)%256,0,0);
bm.setColorImage(32,32,cols2,64,64);
bm.setColorImage(
IntPoint2(32,32),cols2,64,64);
| void Imagine::NativeBitmap::setColorImage |
( |
const IntPoint2 & |
p, |
|
|
const Color * |
cols, |
|
|
int |
w, |
|
|
int |
h |
|
) |
| |
|
inline |
Fills part of a native bitmap with a bitmap.
- Parameters
-
| p | top left position in native bitmap |
| cols | source to be copied into native bitmap |
| w,h | dimensions |
for (int y=0;y<64;y++)
for (int x=0;x<64;x++)
cols2[x+64*y]=
Color((x+y)%256,0,0);
bm.setColorImage(32,32,cols2,64,64);
bm.setColorImage(
IntPoint2(32,32),cols2,64,64);
| void Imagine::NativeBitmap::setColorImage |
( |
int |
x, |
|
|
int |
y, |
|
|
const octet * |
rgb, |
|
|
int |
w, |
|
|
int |
h |
|
) |
| |
|
inline |
Fills part of a native bitmap with a bitmap.
- Parameters
-
| x,y | top left position in native bitmap |
| rgb | source to be copied into native bitmap |
| w,h | dimensions |
for (int y=0;y<64;y++)
for (int x=0;x<64;x++) {
rgb2[3*(x+64*y)]=x;
rgb2[3*(x+64*y)+1]=y;
rgb2[3*(x+64*y)+2]=x+y;
}
bm.setColorImage(64,0,rgb2,64,64);
bm.setColorImage(
IntPoint2(64,0),rgb2,64,64);
| void Imagine::NativeBitmap::setColorImage |
( |
const IntPoint2 & |
p, |
|
|
const octet * |
rgb, |
|
|
int |
w, |
|
|
int |
h |
|
) |
| |
|
inline |
Fills part of a native bitmap with a bitmap.
- Parameters
-
| p | top left position in native bitmap |
| rgb | source to be copied into native bitmap |
| w,h | dimensions |
for (int y=0;y<64;y++)
for (int x=0;x<64;x++) {
rgb2[3*(x+64*y)]=x;
rgb2[3*(x+64*y)+1]=y;
rgb2[3*(x+64*y)+2]=x+y;
}
bm.setColorImage(64,0,rgb2,64,64);
bm.setColorImage(
IntPoint2(64,0),rgb2,64,64);
| void Imagine::NativeBitmap::setGreyImage |
( |
int |
x, |
|
|
int |
y, |
|
|
const octet * |
g, |
|
|
int |
w, |
|
|
int |
h |
|
) |
| |
Fills part of a native bitmap with a grey bitmap.
- Parameters
-
| x,y | top left position in native bitmap |
| g | source to be copied into native bitmap |
| w,h | dimensions |
for (int y=0;y<64;y++)
for (int x=0;x<64;x++)
grey2[(x+64*y)]=x+2*y;
bm.setGreyImage(0,64,grey2,64,64);
bm.setGreyImage(
IntPoint2(0,64),grey2,64,64);
| void Imagine::NativeBitmap::setGreyImage |
( |
const IntPoint2 & |
p, |
|
|
const octet * |
g, |
|
|
int |
w, |
|
|
int |
h |
|
) |
| |
|
inline |
Fills part of a native bitmap with a grey bitmap.
- Parameters
-
| p | top left position in native bitmap |
| g | source to be copied into native bitmap |
| w,h | dimensions |
for (int y=0;y<64;y++)
for (int x=0;x<64;x++)
grey2[(x+64*y)]=x+2*y;
bm.setGreyImage(0,64,grey2,64,64);
bm.setGreyImage(
IntPoint2(0,64),grey2,64,64);
| void Imagine::NativeBitmap::setPoint |
( |
int |
x, |
|
|
int |
y, |
|
|
Color |
col |
|
) |
| |
Set color of one point in a native bitmap.
- Parameters
-
| x,y | position |
| col | Color to be copied into native bitmap |
for (int x=0;x<sz;x++) {
}
| void Imagine::NativeBitmap::setPoint |
( |
const IntPoint2 & |
p, |
|
|
Color |
col |
|
) |
| |
|
inline |
Set color of one point in a native bitmap.
- Parameters
-
| p | position |
| col | Color to be copied into native bitmap |
for (int x=0;x<sz;x++) {
}
| void putNativeBitmap |
( |
int |
x, |
|
|
int |
y, |
|
|
const NativeBitmap & |
bm, |
|
|
bool |
xorMode, |
|
|
double |
fact |
|
) |
| |
|
friend |
Displays native bitmap into active window
- Parameters
-
| x,y | drawing position (top left in window) |
| bm | the native bitmap to display |
| xorMode | XOR drawing (default=off). Used twice, recovers the original content |
| fact | scaling factor (default=1.) |
for (int i=0;i<1024;i+=8) {
}
| void putNativeBitmap |
( |
const IntPoint2 & |
p, |
|
|
const NativeBitmap & |
bm, |
|
|
bool |
xorMode = false, |
|
|
double |
fact = 1. |
|
) |
| |
|
friend |
Displays native bitmap into active window
- Parameters
-
| p | drawing position (top left in window) |
| bm | the native bitmap to display |
| xorMode | XOR drawing (default=off). Used twice, recovers the original content |
| fact | scaling factor (default=1.) |
for (int i=0;i<1024;i+=8) {
}
The documentation for this class was generated from the following file:
- /Users/pascal/ImagineQt2/Imagine/Graphics/src/Imagine/Graphics/ImageIO.h