git-svn-id: https://svn.code.sf.net/p/q3cellshading/code/trunk@22 db09e94b-7117-0410-a7e6-85ae5ff6e0e9
This commit is contained in:
parent
63c4ad4d41
commit
0109c81576
1 changed files with 34 additions and 0 deletions
|
@ -1133,8 +1133,13 @@ void kuwahara(int columns, int rows, byte *targa_rgba)
|
|||
byte getImageR(byte *targa_rgba, int x, int y, int columns, int rows)
|
||||
{
|
||||
byte *pixbuf;
|
||||
|
||||
x*=((x<0)?-1:1);
|
||||
y*=((y<0)?-1:1);
|
||||
|
||||
pixbuf = targa_rgba + y*columns*4;
|
||||
|
||||
|
||||
if(columns<x)
|
||||
x=x%columns;
|
||||
|
||||
|
@ -1149,8 +1154,13 @@ byte getImageR(byte *targa_rgba, int x, int y, int columns, int rows)
|
|||
void setImageR(byte *targa_rgba, int x, int y, int columns, int rows, byte value)
|
||||
{
|
||||
byte *pixbuf;
|
||||
|
||||
x*=((x<0)?-1:1);
|
||||
y*=((y<0)?-1:1);
|
||||
|
||||
pixbuf = targa_rgba + y*columns*4;
|
||||
|
||||
|
||||
pixbuf+=(x*4);
|
||||
|
||||
*pixbuf=value;
|
||||
|
@ -1159,6 +1169,10 @@ void setImageR(byte *targa_rgba, int x, int y, int columns, int rows, byte value
|
|||
byte getImageG(byte *targa_rgba, int x, int y, int columns, int rows)
|
||||
{
|
||||
byte *pixbuf;
|
||||
|
||||
x*=((x<0)?-1:1);
|
||||
y*=((y<0)?-1:1);
|
||||
|
||||
pixbuf = targa_rgba + y*columns*4;
|
||||
|
||||
if(columns<x)
|
||||
|
@ -1176,6 +1190,10 @@ byte getImageG(byte *targa_rgba, int x, int y, int columns, int rows)
|
|||
void setImageG(byte *targa_rgba, int x, int y, int columns, int rows, byte value)
|
||||
{
|
||||
byte *pixbuf;
|
||||
|
||||
x*=((x<0)?-1:1);
|
||||
y*=((y<0)?-1:1);
|
||||
|
||||
pixbuf = targa_rgba + y*columns*4;
|
||||
|
||||
pixbuf+=(x*4);
|
||||
|
@ -1186,6 +1204,10 @@ void setImageG(byte *targa_rgba, int x, int y, int columns, int rows, byte value
|
|||
byte getImageB(byte *targa_rgba, int x, int y, int columns, int rows)
|
||||
{
|
||||
byte *pixbuf;
|
||||
|
||||
x*=((x<0)?-1:1);
|
||||
y*=((y<0)?-1:1);
|
||||
|
||||
pixbuf = targa_rgba + y*columns*4;
|
||||
|
||||
if(columns<x)
|
||||
|
@ -1202,6 +1224,10 @@ byte getImageB(byte *targa_rgba, int x, int y, int columns, int rows)
|
|||
void setImageB(byte *targa_rgba, int x, int y, int columns, int rows, byte value)
|
||||
{
|
||||
byte *pixbuf;
|
||||
|
||||
x*=((x<0)?-1:1);
|
||||
y*=((y<0)?-1:1);
|
||||
|
||||
pixbuf = targa_rgba + y*columns*4;
|
||||
|
||||
pixbuf+=(x*4);
|
||||
|
@ -1212,6 +1238,10 @@ void setImageB(byte *targa_rgba, int x, int y, int columns, int rows, byte value
|
|||
byte getImageA(byte *targa_rgba, int x, int y, int columns, int rows)
|
||||
{
|
||||
byte *pixbuf;
|
||||
|
||||
x*=((x<0)?-1:1);
|
||||
y*=((y<0)?-1:1);
|
||||
|
||||
pixbuf = targa_rgba + y*columns*4;
|
||||
|
||||
pixbuf+=(x*4);
|
||||
|
@ -1222,6 +1252,10 @@ byte getImageA(byte *targa_rgba, int x, int y, int columns, int rows)
|
|||
void setImageA(byte *targa_rgba, int x, int y, int columns, int rows, byte value)
|
||||
{
|
||||
byte *pixbuf;
|
||||
|
||||
x*=((x<0)?-1:1);
|
||||
y*=((y<0)?-1:1);
|
||||
|
||||
pixbuf = targa_rgba + y*columns*4;
|
||||
|
||||
pixbuf+=(x*4);
|
||||
|
|
Loading…
Reference in a new issue