123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682 |
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Copyright 2016 RWS Inc, All Rights Reserved
- //
- // This program is free software; you can redistribute it and/or modify
- // it under the terms of version 2 of the GNU General Public License as published by
- // the Free Software Foundation
- //
- // This program is distributed in the hope that it will be useful,
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- // GNU General Public License for more details.
- //
- // You should have received a copy of the GNU General Public License along
- // with this program; if not, write to the Free Software Foundation, Inc.,
- // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- //
- // This is the scaling module for uncompressed 8-bit images
- // It will hopefully be a strong candidate forthe RSPiX inliner.
- //
- // Anticipating this, it will do ROW blitting as separate inline
- // functions. Whatcha gonna do, man?
- //
- #ifdef PATHS_IN_INCLUDES
- #include "GREEN/BLiT/BLIT.H"
- #include "GREEN/BLiT/_BlitInt.H"
- // #include "GREEN/BLiT/_ic.h"
- #else
- #include "BLIT.H"
- #include "_BlitInt.H"
- // #include "_ic.h"
- #endif
- // For now, do the shrink case only...
- // This algorithm is based entirely on 15-bit unsigned fractions, allowing
- // scaling by 30,000 times without overflow! A bit of overkil, but hey.
- // I am leaving in the possibility of mirroring...
- //-------- These macros could by inlined once the inliner is on line:
- //=========================================== SHRINK, DEST BASED....
- // This is pixel size independent:
- // pSrc always increments rightwards...
- //
- #define INC_FRAC_H(pSrc,sDel,sInc,sNum,sDen) \
- pSrc+=sDel; sNum+=sInc; if (sNum >= sDen) { sNum -= sDen; pSrc++; }
- #define INC_FRAC_V(pSrc,sDel,sInc,sNum,lSrcP,sDen) \
- pSrc+=sDel; sNum+=sInc; if (sNum >= sDen) { sNum -= sDen; pSrc+=lSrcP; }
- #define SET_PIX_OPAQUE(pSrc,pDst) \
- *pDst = *pSrc;
- #define SET_PIX_CLEAR(pSrc,pDst,chroma,tempPix) \
- if ( (tempPix = *pSrc) != chroma) *pDst = *pSrc;
- // sSmall is the denominator..
- #define INIT_IMPROPER_FRACTION_H(sSmall,sLarge,sDel,sInc,sNumi) \
- sDel = sLarge / sSmall; sInc = sLarge - sSmall * sDel; sNumi = (sSmall>>1);
- // sSmall is the denominator..
- #define INIT_IMPROPER_FRACTION_V(sSmall,sLarge,lDel,sInc,sNumi,lSrcP) \
- lDel = (sLarge / sSmall); sInc = sLarge - sSmall * lDel; sNumi = (sSmall>>1); lDel *= lSrcP;
- // The left show value is the # of pixels from sCount to show right...
- // It may only be followed with a single command!
- // It assumes sCound has ALREADY been decremented!
- //
- #define LCLIP_PIX(sCount,sShow) \
- if (sCount < sShow)
- //=========================================== MAGNIFY, DEST BASED....=================
- // (Source based magnify is faster, but also harder...)
- //
- // In this rare configuration, there is no del!
- //
- // sLarge is the denominator.... DO NOT USE FOR 1 to 1!
- // sSmall is the incrementor (sInc!)
- //
- #define INIT_PROPER_FRACTION(sLarge,sNumi) \
- sNumi = (sLarge >> 1);
- // sLarge = denominator, sSmall = sInc
- #define INC_PFRAC_H(pSrc,sInc,sNum,sDen) \
- sNum += sInc; if (sNum >= sDen) { sNum -= sDen; pSrc++; }
- // sLarge = denominator, sSmall = sInc
- #define INC_PFRAC_V(pSrc,sInc,sNum,sDen,lSrcP) \
- sNum += sInc; if (sNum >= sDen) { sNum -= sDen; pSrc+=lSrcP; }
- //====================================================================================
- // If we break out a million little blit's, than we can combine all the if's into one
- // bit switch statement.
- // I believe the memptrs are to the UNCLIPPED rects...
- //
- inline void _Blit_HS_VS_C(
- UCHAR* pSrc,long lSrcP,short sSrcW,short sSrcH,
- UCHAR* pDst,long lDstP,short sDstW,short sDstH,
- short sClipL,short sClipT,short sClipR,short sClipB,
- short sMirrorH,short sMirrorV)
- {
- //-------------------------------------------------------------------------
- // Set up vertical variables:
- //
- UCHAR* pSrcLine = pSrc,*pDstLine = pDst;
- long lDelMemY;
- short sIncY,sNumY,sClipH;
- if (sMirrorV == -1) lDstP = -lDstP; // make sure pDst is correctly positioned
-
- // ASSUME SHRINKING FOR NOW:
- //************ THIS CHANGES FOR MAGNIFY!
- INIT_IMPROPER_FRACTION_V(sDstH,sSrcH,lDelMemY,sIncY,sNumY,lSrcP) // sDstH is the numerator
- sClipH = sDstH - sClipB - sClipT; // Fully clipped...
- //-------------------------------------------------------------------------
- // Set up horizontal variables:
- //
- short sDelX,sIncX,sNumX,sClipW,sShowW;
- // ASSUME SHRINKING FOR NOW:
- INIT_IMPROPER_FRACTION_H(sDstW,sSrcW,sDelX,sIncX,sNumX) // sDstW is the numerator
- sClipW = sDstW - sClipR; // right clip...
- sShowW = sClipW - sClipL;
- short i;
- //-------------------------------------------------------------------------
- // Do vertical clipping:
- if (sClipT)
- while (sClipT--)
- {
- // Do a vertical move:
- INC_FRAC_V(pSrcLine,lDelMemY,sIncY,sNumY,lSrcP,sDstH)
- pDstLine += lDstP; // allow for vertical mirroring..
- }
- //-------------------------------------------------------------------------
- // Do horizontal clipping...
- if (sClipL)
- {
- while (sClipH--)
- {
- pSrc = pSrcLine; pDst = pDstLine; // synch position:
- sNumX = (sDstW>>1);
- UCHAR ucPix;
- i = sClipW;
- while (i--)
- {
- if (i < sShowW)
- SET_PIX_CLEAR(pSrc,pDst,UCHAR(0),ucPix)
- INC_FRAC_H(pSrc,sDelX,sIncX,sNumX,sDstW)
- pDst += sMirrorH;
- }
- INC_FRAC_V(pSrcLine,lDelMemY,sIncY,sNumY,lSrcP,sDstH)
- pDstLine += lDstP; // allow for vertical mirroring..
- }
- }
- else // no horizontal clipping:
- {
- while (sClipH--)
- {
- pSrc = pSrcLine; pDst = pDstLine; // synch position:
- sNumX = (sDstW>>1);
- i = sClipW;
- UCHAR ucPix;
- while (i--)
- {
- SET_PIX_CLEAR(pSrc,pDst,UCHAR(0),ucPix)
- INC_FRAC_H(pSrc,sDelX,sIncX,sNumX,sDstW)
- pDst += sMirrorH;
- }
- INC_FRAC_V(pSrcLine,lDelMemY,sIncY,sNumY,lSrcP,sDstH)
- pDstLine += lDstP; // allow for vertical mirroring..
- }
- }
- }
- //====================================================================================
- // If we break out a million little blit's, than we can combine all the if's into one
- // bit switch statement.
- // I believe the memptrs are to the UNCLIPPED rects...
- //
- inline void _Blit_HM_VM_C(
- UCHAR* pSrc,long lSrcP,short sSrcW,short sSrcH,
- UCHAR* pDst,long lDstP,short sDstW,short sDstH,
- short sClipL,short sClipT,short sClipR,short sClipB,
- short sMirrorH,short sMirrorV)
- {
- //-------------------------------------------------------------------------
- // Set up vertical variables:
- //
- UCHAR* pSrcLine = pSrc,*pDstLine = pDst;
- short sNumY,sClipH;
- if (sMirrorV == -1) lDstP = -lDstP; // make sure pDst is correctly positioned
-
- // ASSUME ENLARGING FOR NOW:
- //************ THIS CHANGES FOR SHRINK!
- INIT_PROPER_FRACTION(sDstH,sNumY) // sDstH is the denominator
- sClipH = sDstH - sClipB - sClipT; // Fully clipped...
- //-------------------------------------------------------------------------
- // Set up horizontal variables:
- //
- short sNumX,sClipW,sShowW;
- // ASSUME ENLARGING FOR NOW:
- INIT_PROPER_FRACTION(sDstW,sNumX) // sDstW is the denominator
- sClipW = sDstW - sClipR; // right clip...
- sShowW = sClipW - sClipL;
- short i;
- //-------------------------------------------------------------------------
- // Do vertical clipping:
- if (sClipT)
- while (sClipT--)
- {
- // Do a vertical move:
- // sIncY = sSrcH, sDstY = denominator
- INC_PFRAC_V(pSrcLine,sSrcH,sNumY,sDstH,lSrcP)
- pDstLine += lDstP; // allow for vertical mirroring..
- }
- //-------------------------------------------------------------------------
- // Do horizontal clipping...
- if (sClipL)
- {
- while (sClipH--)
- {
- pSrc = pSrcLine; pDst = pDstLine; // synch position:
- sNumX = (sDstW>>1);
- UCHAR ucPix;
- i = sClipW;
- while (i--)
- {
- if (i < sShowW)
- SET_PIX_CLEAR(pSrc,pDst,UCHAR(0),ucPix)
- INC_PFRAC_H(pSrc,sSrcW,sNumX,sDstW)
- pDst += sMirrorH;
- }
- INC_PFRAC_V(pSrcLine,sSrcH,sNumY,sDstH,lSrcP)
- pDstLine += lDstP; // allow for vertical mirroring..
- }
- }
- else // no horizontal clipping:
- {
- while (sClipH--)
- {
- pSrc = pSrcLine; pDst = pDstLine; // synch position:
- sNumX = (sDstW>>1);
- i = sClipW;
- UCHAR ucPix;
- while (i--)
- {
- SET_PIX_CLEAR(pSrc,pDst,UCHAR(0),ucPix)
- INC_PFRAC_H(pSrc,sSrcW,sNumX,sDstW)
- pDst += sMirrorH;
- }
- INC_PFRAC_V(pSrcLine,sSrcH,sNumY,sDstH,lSrcP)
- pDstLine += lDstP; // allow for vertical mirroring..
- }
- }
- }
- //====================================================================================
- // If we break out a million little blit's, than we can combine all the if's into one
- // bit switch statement.
- // I believe the memptrs are to the UNCLIPPED rects...
- //
- inline void _Blit_HS_VM_C(
- UCHAR* pSrc,long lSrcP,short sSrcW,short sSrcH,
- UCHAR* pDst,long lDstP,short sDstW,short sDstH,
- short sClipL,short sClipT,short sClipR,short sClipB,
- short sMirrorH,short sMirrorV)
- {
- //-------------------------------------------------------------------------
- // Set up vertical variables:
- //
- UCHAR* pSrcLine = pSrc,*pDstLine = pDst;
- short sNumY,sClipH;
- if (sMirrorV == -1) lDstP = -lDstP; // make sure pDst is correctly positioned
-
- // ASSUME ENLARGING FOR NOW:
- //************ THIS CHANGES FOR SHRINK!
- INIT_PROPER_FRACTION(sDstH,sNumY) // sDstH is the denominator
- sClipH = sDstH - sClipB - sClipT; // Fully clipped...
- //-------------------------------------------------------------------------
- // Set up horizontal variables:
- //
- short sDelX,sIncX,sNumX,sClipW,sShowW;
- // ASSUME SHRINKING FOR NOW:
- INIT_IMPROPER_FRACTION_H(sDstW,sSrcW,sDelX,sIncX,sNumX) // sDstW is the numerator
- sClipW = sDstW - sClipR; // right clip...
- sShowW = sClipW - sClipL;
- short i;
- //-------------------------------------------------------------------------
- // Do vertical clipping:
- if (sClipT)
- while (sClipT--)
- {
- // Do a vertical move:
- // sIncY = sSrcH, sDstY = denominator
- INC_PFRAC_V(pSrcLine,sSrcH,sNumY,sDstH,lSrcP)
- pDstLine += lDstP; // allow for vertical mirroring..
- }
- //-------------------------------------------------------------------------
- // Do horizontal clipping...
- if (sClipL)
- {
- while (sClipH--)
- {
- pSrc = pSrcLine; pDst = pDstLine; // synch position:
- sNumX = (sDstW>>1);
- UCHAR ucPix;
- i = sClipW;
- while (i--)
- {
- if (i < sShowW)
- SET_PIX_CLEAR(pSrc,pDst,UCHAR(0),ucPix)
- INC_FRAC_H(pSrc,sDelX,sIncX,sNumX,sDstW)
- pDst += sMirrorH;
- }
- INC_PFRAC_V(pSrcLine,sSrcH,sNumY,sDstH,lSrcP)
- pDstLine += lDstP; // allow for vertical mirroring..
- }
- }
- else // no horizontal clipping:
- {
- while (sClipH--)
- {
- pSrc = pSrcLine; pDst = pDstLine; // synch position:
- sNumX = (sDstW>>1);
- i = sClipW;
- UCHAR ucPix;
- while (i--)
- {
- SET_PIX_CLEAR(pSrc,pDst,UCHAR(0),ucPix)
- INC_FRAC_H(pSrc,sDelX,sIncX,sNumX,sDstW)
- pDst += sMirrorH;
- }
- INC_PFRAC_V(pSrcLine,sSrcH,sNumY,sDstH,lSrcP)
- pDstLine += lDstP; // allow for vertical mirroring..
- }
- }
- }
- //====================================================================================
- // If we break out a million little blit's, than we can combine all the if's into one
- // bit switch statement.
- // I believe the memptrs are to the UNCLIPPED rects...
- //
- inline void _Blit_HM_VS_C(
- UCHAR* pSrc,long lSrcP,short sSrcW,short sSrcH,
- UCHAR* pDst,long lDstP,short sDstW,short sDstH,
- short sClipL,short sClipT,short sClipR,short sClipB,
- short sMirrorH,short sMirrorV)
- {
- //-------------------------------------------------------------------------
- // Set up vertical variables:
- //
- UCHAR* pSrcLine = pSrc,*pDstLine = pDst;
- long lDelMemY;
- short sIncY,sNumY,sClipH;
- if (sMirrorV == -1) lDstP = -lDstP; // make sure pDst is correctly positioned
-
- // ASSUME SHRINKING FOR NOW:
- //************ THIS CHANGES FOR MAGNIFY!
- INIT_IMPROPER_FRACTION_V(sDstH,sSrcH,lDelMemY,sIncY,sNumY,lSrcP) // sDstH is the numerator
- sClipH = sDstH - sClipB - sClipT; // Fully clipped...
- //-------------------------------------------------------------------------
- // Set up horizontal variables:
- //
- short sNumX,sClipW,sShowW;
- // ASSUME ENLARGING FOR NOW:
- INIT_PROPER_FRACTION(sDstW,sNumX) // sDstW is the denominator
- sClipW = sDstW - sClipR; // right clip...
- sShowW = sClipW - sClipL;
- short i;
- //-------------------------------------------------------------------------
- // Do vertical clipping:
- if (sClipT)
- while (sClipT--)
- {
- // Do a vertical move:
- INC_FRAC_V(pSrcLine,lDelMemY,sIncY,sNumY,lSrcP,sDstH)
- pDstLine += lDstP; // allow for vertical mirroring..
- }
- //-------------------------------------------------------------------------
- // Do horizontal clipping...
- if (sClipL)
- {
- while (sClipH--)
- {
- pSrc = pSrcLine; pDst = pDstLine; // synch position:
- sNumX = (sDstW>>1);
- UCHAR ucPix;
- i = sClipW;
- while (i--)
- {
- if (i < sShowW)
- SET_PIX_CLEAR(pSrc,pDst,UCHAR(0),ucPix)
- INC_PFRAC_H(pSrc,sSrcW,sNumX,sDstW)
- pDst += sMirrorH;
- }
- INC_FRAC_V(pSrcLine,lDelMemY,sIncY,sNumY,lSrcP,sDstH)
- pDstLine += lDstP; // allow for vertical mirroring..
- }
- }
- else // no horizontal clipping:
- {
- while (sClipH--)
- {
- pSrc = pSrcLine; pDst = pDstLine; // synch position:
- sNumX = (sDstW>>1);
- i = sClipW;
- UCHAR ucPix;
- while (i--)
- {
- SET_PIX_CLEAR(pSrc,pDst,UCHAR(0),ucPix)
- INC_PFRAC_H(pSrc,sSrcW,sNumX,sDstW)
- pDst += sMirrorH;
- }
- INC_FRAC_V(pSrcLine,lDelMemY,sIncY,sNumY,lSrcP,sDstH)
- pDstLine += lDstP; // allow for vertical mirroring..
- }
- }
- }
- //-----------------------------------------------------------------------------------
- // templated overloads for selecting different inlines...
- typedef U32 CHOOSE_MAGNIFY;
- typedef S32 CHOOSE_SHRINK;
- typedef U32 CHOOSE_HCLIP;
- typedef S32 CHOOSE_NO_HCLIP;
- typedef U32 CHOOSE_OPAQUE;
- typedef S32 CHOOSE_TRANSPARENT;
- //-----------------------------------------------------------------------------------
- // at the internal level, assume all values have been verified..
- //
- inline short _rspBlit(UCHAR* pSrc,long lSrcP,short sSrcW,short sSrcH,
- UCHAR* pDst,long lDstP,short sDstW,short sDstH)
- {
- return 0;
- }
- // do the full transparent case with clipping:
- // (long version... overload shorter version...)
- // FOR THE DEMO, do ONLY shrinking, and do clipping AFTER shrinking.....
- //
- short rspBlitT(RImage* pimSrc,RImage* pimDst,RRect* prSrc,const RRect* prDst,
- const RRect* prDstClip,const RRect* prSrcClip)
- {
- #ifdef _DEBUG
- if (!pimSrc || !pimDst)
- {
- TRACE("rspBlitT: NULL images passed!\n");
- return -1;
- }
- // do type checking....
- //------------------------------------------------------------------------------
- if (!ImageIsUncompressed(pimSrc->m_type))
- {
- TRACE("rspBlitT: Only use this function with uncompressed Images.\n");
- return -1;
- }
- if (!ImageIsUncompressed(pimDst->m_type))
- {
- TRACE("rspBlitT: Only use this function with uncompressed Images.\n");
- return -1;
- }
- //------------------------------------------------------------------------------
- // do depth checking...
- //------------------------------------------------------------------------------
- if ((pimSrc->m_sDepth != 8) || (pimDst->m_sDepth != 8))
- {
- TRACE("rspBlitT: Currently, only 8-bit Images are fully supported.\n");
- return -1;
- }
- #endif
- //------------------------------------------------------------------------------
- // do optional source clipping
- //------------------------------------------------------------------------------
- // NOTE THAT THESE ARE THE WIDTH AND HEIGHT WHICH ARE ACTUALLY SCALED
- //
- short sSrcX = prSrc->sX, sSrcY = prSrc->sY, sSrcW = prSrc->sW, sSrcH = prSrc->sH;
- // TOO complex for now as it drastically alters the scaling...
- if (prSrcClip)
- {
- TRACE("rspBlitT: Source clipping not yet available...\n");
- return -1;
- }
- //------------------------------------------------------------------------------
- // do optional destination clipping
- //------------------------------------------------------------------------------
- // Destination clippiong rectangle:
- // NOTE: effective destination clipping done at a lower level.
- // Only source clipping would effect this...
- //
- short sDstClipX = 0, sDstClipY = 0;
- short sDstClipW = pimDst->m_sWidth, sDstClipH = pimDst->m_sHeight;
- // NOT FOR CLIPPING PURPOSES -> FIXED UINPUT VALUES!
- short sDstX = prDst->sX, sDstY = prDst->sY, sDstW = prDst->sW, sDstH = prDst->sH;
- if (prDstClip)
- {
- sDstClipX = prDstClip->sX;
- sDstClipY = prDstClip->sY;
- sDstClipW = prDstClip->sW;
- sDstClipH = prDstClip->sH;
- }
- //********************* MIRROR PART I => PRE CLIP:
- short sMirrorH = 1,sMirrorV = 1;
- if (sDstW < 0)
- {
- sMirrorH = -1; // flip the destination square's edges...
- sDstW = -sDstW;
- sDstX -= (sDstW - 1);
- }
- if (sDstH < 0)
- {
- sMirrorV = -1; // flip the destination square's edges...
- sDstH = -sDstH;
- sDstY -= (sDstH - 1);
- }
- //*********************
- //-------- Do the clipping:
- short sClipL,sClipR,sClipT,sClipB; // positive = clipped
- sClipL = sDstClipX - sDstX; if (sClipL < 0) sClipL = 0;
- sClipT = sDstClipY - sDstY; if (sClipT < 0) sClipT = 0;
- sClipR = (sDstX + sDstW - sDstClipX - sDstClipW); if (sClipR < 0) sClipR = 0;
- sClipB = (sDstY + sDstH - sDstClipY - sDstClipH); if (sClipB < 0) sClipB = 0;
- if ( ((sClipL + sClipR) >= sDstW) || ((sClipT + sClipB) >= sDstH) )
- {
- return 0; // fully clipped out
- }
- //********************* MIRROR PART II => POST CLIP, flip back...
- if (sMirrorH == -1)
- {
- sDstX += (sDstW - 1);
- SWAP(sClipL,sClipR); // the drawing order is reversed...
- }
- if (sMirrorV == -1)
- {
- sDstY += (sDstH - 1);
- SWAP(sClipT,sClipB); // the drawing order is reversed...
- }
- //*********************
- //------------------------------------------------------------------------------
- // set up IC
- //------------------------------------------------------------------------------
- UCHAR* pDst = pimDst->m_pData + pimDst->m_lPitch * sDstY + sDstX;
- UCHAR* pSrc = pimSrc->m_pData + pimSrc->m_lPitch * sSrcY + sSrcX;
- if ((sDstW <= sSrcW) && (sDstH <= sSrcH))
- _Blit_HS_VS_C(pSrc,pimSrc->m_lPitch,sSrcW,sSrcH,
- pDst,pimDst->m_lPitch,sDstW,sDstH,
- sClipL,sClipT,sClipR,sClipB,sMirrorH,sMirrorV);
- else if ((sDstW > sSrcW) && (sDstH > sSrcH))
- _Blit_HM_VM_C(pSrc,pimSrc->m_lPitch,sSrcW,sSrcH,
- pDst,pimDst->m_lPitch,sDstW,sDstH,
- sClipL,sClipT,sClipR,sClipB,sMirrorH,sMirrorV);
- else if ((sDstW <= sSrcW) && (sDstH > sSrcH))
- _Blit_HS_VM_C(pSrc,pimSrc->m_lPitch,sSrcW,sSrcH,
- pDst,pimDst->m_lPitch,sDstW,sDstH,
- sClipL,sClipT,sClipR,sClipB,sMirrorH,sMirrorV);
- else
- _Blit_HM_VS_C(pSrc,pimSrc->m_lPitch,sSrcW,sSrcH,
- pDst,pimDst->m_lPitch,sDstW,sDstH,
- sClipL,sClipT,sClipR,sClipB,sMirrorH,sMirrorV);
- return 0;
- }
- // easy call overloads:
- //
- #if WIN32
- inline
- #else
- extern
- #endif
- short rspBlitT(RImage* pimSrc,RImage* pimDst,short sDstX,short sDstY,
- short sDstW,short sDstH,const RRect* prDstClip)
- {
- RRect rSrc,rDst;
- #ifdef _DEBUG
- if (!pimSrc || !pimDst)
- {
- TRACE("rspBlitT: NULL images passed!\n");
- return -1;
- }
- #endif
- rSrc.sX = rSrc.sY = 0;
- rSrc.sW = pimSrc->m_sWidth;
- rSrc.sH = pimSrc->m_sHeight;
- rDst.sX = sDstX;
- rDst.sY = sDstY;
- rDst.sW = sDstW;
- rDst.sH = sDstH;
- return rspBlitT(pimSrc,pimDst,&rSrc,&rDst,prDstClip);
- }
- // easy call overloads:
- //
- #if WIN32
- inline
- #else
- extern
- #endif
- short rspBlitT(RImage* pimSrc,RImage* pimDst,short sDstX,short sDstY,
- double dRatW,double dRatH,const RRect* prDstClip)
- {
- #ifdef _DEBUG
- if (!pimSrc || !pimDst)
- {
- TRACE("rspBlitT: NULL images passed!\n");
- return -1;
- }
- #endif
- return rspBlitT(pimSrc,pimDst,sDstX,sDstY,(short)(dRatW * pimSrc->m_sWidth),
- (short)(dRatH * pimSrc->m_sHeight),prDstClip);
- }
|