这篇教程C++ GetGWorldPixMap函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetGWorldPixMap函数的典型用法代码示例。如果您正苦于以下问题:C++ GetGWorldPixMap函数的具体用法?C++ GetGWorldPixMap怎么用?C++ GetGWorldPixMap使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetGWorldPixMap函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: UnlockPixelsvoid wxMemoryDC::SelectObject( const wxBitmap& bitmap ){ if ( m_selected.Ok() ) { UnlockPixels( GetGWorldPixMap(MAC_WXHBITMAP(m_selected.GetHBITMAP())) ); } m_selected = bitmap; if (m_selected.Ok()) { if ( m_selected.GetHBITMAP() ) { m_macPort = (GrafPtr) m_selected.GetHBITMAP() ; LockPixels( GetGWorldPixMap( (CGrafPtr) m_macPort ) ) ; wxMask * mask = bitmap.GetMask() ; if ( mask ) { m_macMask = mask->GetMaskBitmap() ; } SetRectRgn( (RgnHandle) m_macBoundaryClipRgn , 0 , 0 , m_selected.GetWidth() , m_selected.GetHeight() ) ; CopyRgn( (RgnHandle) m_macBoundaryClipRgn ,(RgnHandle) m_macCurrentClipRgn ) ; m_ok = TRUE ; } else { m_ok = FALSE; } } else { m_ok = FALSE; }}
开发者ID:gitrider,项目名称:wxsj2,代码行数:32,
示例2: GetPixBaseAddr//--------------------------------------------------------void ofQtVideoSaver::setGworldPixel( GWorldPtr gwPtr, int r, int g, int b, short x, short y){ Ptr gwAddress, gwAddressBase; long gwWidth; char red, blue, green; gwAddressBase = GetPixBaseAddr( GetGWorldPixMap( gwPtr ) ); /* Get head address of offscreen */ gwWidth = ( **GetGWorldPixMap( gwPtr ) ).rowBytes & 0x3fff; /* Get with of offscreen */ gwAddress = gwAddressBase + ( x * 3 ) + ( y * gwWidth ); /* Get adress for current pixel */ *gwAddress = (unsigned char)r; /* Put red and move address forward */ *(gwAddress+1) = (unsigned char)g; /* Put green and move address forward */ *(gwAddress+2) = (unsigned char)b; /* Put blue */}
开发者ID:jphutson,项目名称:dynamic-images-and-eye-movements,代码行数:12,
示例3: QTNewGWorldFromPtr// Create the offscreen GWorld (using Image as target memory)void QuicktimeLiveImageStream::createGWorld(){ Rect destinationBounds; OSStatus err; GDHandle origDevice; CGrafPtr origPort; destinationBounds.left = 0; destinationBounds.top = 0; destinationBounds.right = m_videoRectWidth; destinationBounds.bottom = m_videoRectHeight; err = QTNewGWorldFromPtr(&m_gw, k32ARGBPixelFormat, &destinationBounds, NULL, NULL, 0, (Ptr)data(), 4*m_videoRectWidth); if (err !=0 ) { OSG_DEBUG << "Could not create gWorld" << std::endl; } else { // Query GetGWorld (&origPort, &origDevice); SetGWorld (m_gw, NULL); // set current graphics port to offscreen m_pixmap = GetGWorldPixMap(m_gw); if (m_pixmap) { if (!LockPixels (m_pixmap)) // lock offscreen pixel map { OSG_FATAL << "Could not lock PixMap" << std::endl; } } // Set back SetGWorld(origPort, origDevice); }}
开发者ID:aalex,项目名称:osg,代码行数:34,
示例4: definedvoid ofQuickTimePlayer::createImgMemAndGWorld(){ Rect movieRect; movieRect.top = 0; movieRect.left = 0; movieRect.bottom = height; movieRect.right = width; if (pixelFormat == OF_PIXELS_RGBA) { pixels.allocate(width, height, OF_IMAGE_COLOR_ALPHA); } else { pixels.allocate(width, height, OF_IMAGE_COLOR); } #if defined(TARGET_OSX) && defined(__BIG_ENDIAN__) offscreenGWorldPixels = new unsigned char[4 * width * height + 32]; QTNewGWorldFromPtr (&(offscreenGWorld), k32ARGBPixelFormat, &(movieRect), NULL, NULL, 0, (offscreenGWorldPixels), 4 * width); #else if (pixelFormat == OF_PIXELS_RGBA) { QTNewGWorldFromPtr (&(offscreenGWorld), k32RGBAPixelFormat, &(movieRect), NULL, NULL, 0, (pixels.getPixels()), 4 * width); } else { QTNewGWorldFromPtr (&(offscreenGWorld), k24RGBPixelFormat, &(movieRect), NULL, NULL, 0, (pixels.getPixels()), 3 * width); } #endif LockPixels(GetGWorldPixMap(offscreenGWorld)); SetGWorld (offscreenGWorld, NULL); SetMovieGWorld (moviePtr, offscreenGWorld, nil);}
开发者ID:ColoursAndNumbers,项目名称:openFrameworks,代码行数:30,
示例5: UnlockPixelsvoid _HYPlatformGraphicPane::_EndDraw (void){ UnlockPixels (GetGWorldPixMap(thePane)); SetGWorld (savedPort,savedDevice); RGBForeColor (&saveFG); RGBBackColor (&saveBG);}
开发者ID:mdsmith,项目名称:OCLHYPHY,代码行数:7,
示例6: definedvoid ofxAlphaVideoPlayer::createImgMemAndGWorld(){ Rect movieRect; movieRect.top = 0; movieRect.left = 0; movieRect.bottom = height; movieRect.right = width; offscreenGWorldPixels = new unsigned char[4 * width * height + 32]; pixels = new unsigned char[width*height*4]; // 4 =>rgba #if defined(TARGET_OSX) && defined(__BIG_ENDIAN__) //cout << "with Big Endian"<<endl; QTNewGWorldFromPtr (&(offscreenGWorld), k32ARGBPixelFormat, &(movieRect), NULL, NULL, 0, (offscreenGWorldPixels), 4 * width); #else //cout << "no Big Endian"<<endl; QTNewGWorldFromPtr (&(offscreenGWorld), k32RGBAPixelFormat, &(movieRect), NULL, NULL, 0, (pixels), 4 * width); #endif /** POSSIBLE PIXEL FORMATS k32BGRAPixelFormat = 'BGRA', // 32 bit bgra (Matrox) k32ABGRPixelFormat = 'ABGR', // 32 bit abgr k32RGBAPixelFormat = 'RGBA', // 32 bit rgba ***********/ LockPixels(GetGWorldPixMap(offscreenGWorld)); SetGWorld (offscreenGWorld, NULL); SetMovieGWorld (moviePtr, offscreenGWorld, nil); //------------------------------------ texture stuff: if (bUseTexture){ // create the texture, set the pixels to black and // upload them to the texture (so at least we see nothing black the callback) tex.allocate(width,height,GL_RGBA); memset(pixels, 0, width*height*4); tex.loadData(pixels, width, height, GL_RGBA); allocated = true; }}
开发者ID:runemadsen,项目名称:Ohland-Balloons-P3,代码行数:34,
示例7: definedvoid ofQuickTimePlayer::createImgMemAndGWorld() { Rect movieRect; movieRect.top = 0; movieRect.left = 0; movieRect.bottom = height; movieRect.right = width; offscreenGWorldPixels = new unsigned char[4 * width * height + 32]; pixels.allocate(width,height,OF_IMAGE_COLOR);#if defined(TARGET_OSX) && defined(__BIG_ENDIAN__) QTNewGWorldFromPtr (&(offscreenGWorld), k32ARGBPixelFormat, &(movieRect), NULL, NULL, 0, (offscreenGWorldPixels), 4 * width);#else QTNewGWorldFromPtr (&(offscreenGWorld), k24RGBPixelFormat, &(movieRect), NULL, NULL, 0, (pixels.getPixels()), 3 * width);#endif LockPixels(GetGWorldPixMap(offscreenGWorld)); // from : https://github.com/openframeworks/openFrameworks/issues/244 // SetGWorld do not seems to be necessary for offscreen rendering of the movie // only SetMovieGWorld should be called // if both are called, the app will crash after a few ofVideoPlayer object have been deleted#ifndef TARGET_WIN32 SetGWorld (offscreenGWorld, NULL);#endif SetMovieGWorld (moviePtr, offscreenGWorld, nil);}
开发者ID:qingchen1984,项目名称:3DPhotography,代码行数:28,
示例8: MacSetRectvoid pxBuffer::blit(pxSurfaceNative s, int dstLeft, int dstTop, int dstWidth, int dstHeight, int srcLeft, int srcTop){ Rect pr; MacSetRect(&pr, 0, 0, width(), height()); GWorldPtr gworld; NewGWorldFromPtr (&gworld, 32, &pr, NULL, NULL, 0, (char*)base(), 4*width()); Rect dr, sr; MacSetRect(&dr, dstLeft, dstTop, dstLeft + dstWidth, dstTop + dstHeight); MacSetRect(&sr, srcLeft, srcTop, srcLeft + dstWidth, srcTop + dstHeight); CopyBits((BitMapPtr)*GetGWorldPixMap(gworld),(BitMapPtr)*GetGWorldPixMap(s),&sr,&dr,srcCopy,NULL); DisposeGWorld(gworld);}
开发者ID:codemodo,项目名称:pxCore,代码行数:16,
示例9: QutTexture_CreateCompressedTextureObjectFromFile//=============================================================================// QutTexture_CreateCompressedTextureObjectFromFile : Create a QD3D // compressed texture.//-----------------------------------------------------------------------------TQ3TextureObject QutTexture_CreateCompressedTextureObjectFromFile( const FSSpec * theFSSpec, TQ3PixelType pixelType, TQ3Boolean wantMipMaps){ TQ3TextureObject theTexture = NULL; GWorldPtr theGWorld = NULL; PixMapHandle thePixmap = NULL; // Load the image, then create a texture from it theGWorld = QutTexture_CreateGWorldFromFile(theFSSpec, pixelType); if (theGWorld != NULL) { thePixmap = GetGWorldPixMap(theGWorld); if( thePixmap != NULL) { theTexture = QutTexture_CreateCompressedTextureObjectFromPixmap(thePixmap, pixelType, wantMipMaps); DisposeGWorld(theGWorld); } } return(theTexture);}
开发者ID:refnum,项目名称:quesa,代码行数:31,
示例10: pict_from_gworldPRIVATE PicHandlepict_from_gworld (GWorldPtr gp, int *lenp){ PicHandle retval; if (!gp) retval = NULL; else { Rect pict_frame; PixMapHandle pm; pm = GetGWorldPixMap (gp); pict_frame = PIXMAP_BOUNDS (pm); retval = OpenPicture (&pict_frame); if (retval) { ClipRect (&pict_frame); HLock ((Handle) pm); CopyBits ((BitMap *) STARH (pm), PORT_BITS_FOR_COPY (thePort), &pict_frame, &pict_frame, srcCopy, NULL); HUnlock ((Handle) pm); ClosePicture (); } } return retval;}
开发者ID:LarBob,项目名称:executor,代码行数:27,
示例11: EraseRectAndAlphavoid EraseRectAndAlpha(GWorldPtr gWorld, Rect *pRect){ PixMapHandle pixMap = GetGWorldPixMap(gWorld); long rows; Ptr rowBaseAddr; LockPixels(pixMap); rows = pRect->bottom - pRect->top; rowBaseAddr = GetPixBaseAddr(pixMap) + (GetPixRowBytes(pixMap) & 0x3fff) * pRect->top + pRect->left * GetPixDepth(pixMap) / 8; do { long cols; UInt32 *baseAddr; cols = pRect->right - pRect->left; baseAddr = (UInt32*)rowBaseAddr; rowBaseAddr += (**pixMap).rowBytes & 0x3fff; do { *baseAddr++ = 0; } while (--cols); } while (--rows); UnlockPixels(pixMap);} // EraseRectAndAlpha
开发者ID:fruitsamples,项目名称:VideoProcessing,代码行数:28,
示例12: CreateDecompSeqForGWorldDataOSErr CreateDecompSeqForGWorldData(GWorldPtr srcGWorld, Rect *srcBounds, MatrixRecordPtr mr, GWorldPtr imageDestination, ImageSequence *imageSeqID){ OSErr err; ImageDescriptionHandle imageDesc = (ImageDescriptionHandle)NewHandle(sizeof(ImageDescription)); if (imageDesc) { err = MakeImageDescriptionForPixMap (GetGWorldPixMap(srcGWorld), &imageDesc); err = DecompressSequenceBegin( imageSeqID, imageDesc, imageDestination, 0, srcBounds, mr, srcCopy, nil, 0, codecNormalQuality, bestSpeedCodec); DisposeHandle((Handle)imageDesc); } else { err = MemError(); } return err;}
开发者ID:fruitsamples,项目名称:VideoProcessing,代码行数:28,
示例13: RGB2IndexGW// Same as above except that it quickly uses a gworld to allow the systems excellent routines to do// the business instead.short RGB2IndexGW(CTabHandle theTable,RGBColor *theCol){ Boolean openWorld=false; short index=-1; if (gBL_TintWorld==0L) { openWorld=true; OpenTintWorld(theTable); } if (gBL_TintWorld) { CGrafPtr origPort; GDHandle origGD; GetGWorld(&origPort,&origGD); SetGWorld(gBL_TintWorld,0L); SetCPixel(0,0,theCol); index=GPixelColour(GetGWorldPixMap(gBL_TintWorld),0,0); SetGWorld(origPort,origGD); } else return -1; if (openWorld) CloseTintWorld(); return index;}
开发者ID:MaddTheSane,项目名称:tntbasic,代码行数:32,
示例14: ROM_UnsetVideoModestatic void ROM_UnsetVideoMode(_THIS, SDL_Surface *current){ /* Free the current window, if any */ if ( SDL_Window != nil ) { GWorldPtr memworld; /* Handle OpenGL support */ Mac_GL_Quit(this); memworld = (GWorldPtr)GetWRefCon(SDL_Window); if ( memworld != nil ) { UnlockPixels(GetGWorldPixMap(memworld)); DisposeGWorld(memworld); } if ( (current->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {#if USE_QUICKTIME EndFullScreen(fullscreen_ctx, nil); SDL_Window = nil;#else ROM_ShowMenuBar(this);#endif } } current->pixels = NULL; current->flags &= ~(SDL_HWSURFACE|SDL_FULLSCREEN);}
开发者ID:3bu1,项目名称:crossbridge,代码行数:26,
示例15: definedvoid ofVideoPlayer::createImgMemAndGWorld(){ Rect movieRect; movieRect.top = 0; movieRect.left = 0; movieRect.bottom = height; movieRect.right = width; offscreenGWorldPixels = new unsigned char[4 * width * height + 32]; pixels = new unsigned char[width*height*3]; #if defined(TARGET_OSX) && defined(__BIG_ENDIAN__) QTNewGWorldFromPtr (&(offscreenGWorld), k32ARGBPixelFormat, &(movieRect), NULL, NULL, 0, (offscreenGWorldPixels), 4 * width); #else QTNewGWorldFromPtr (&(offscreenGWorld), k24RGBPixelFormat, &(movieRect), NULL, NULL, 0, (pixels), 3 * width); #endif LockPixels(GetGWorldPixMap(offscreenGWorld)); SetGWorld (offscreenGWorld, NULL); SetMovieGWorld (moviePtr, offscreenGWorld, nil); //------------------------------------ texture stuff: if (bUseTexture){ // create the texture, set the pixels to black and // upload them to the texture (so at least we see nothing black the callback) tex.allocate(width,height,GL_RGB); memset(pixels, 0, width*height*3); tex.loadData(pixels, width, height, GL_RGB); allocated = true; }}
开发者ID:alejandroflores,项目名称:openFrameworks,代码行数:28,
示例16: GetGWorldPixMap //------------------------------------------------------------------------ unsigned pixel_map::width() const { if(m_pmap == nil) return 0; PixMapHandle pm = GetGWorldPixMap (m_pmap); Rect bounds; GetPixBounds (pm, &bounds); return bounds.right - bounds.left; }
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:9,
示例17: gr_palette_step_upvoid gr_palette_step_up( int r, int g, int b ){ int i; ubyte *p; int temp; ColorSpec colors[256]; GDHandle old_device;// PaletteHandle palette;// RGBColor color;// CTabHandle ctab; if (gr_palette_faded_out) return; if ( (r==last_r) && (g==last_g) && (b==last_b) ) return; last_r = r; last_g = g; last_b = b; p=gr_palette;// palette = GetPalette(GameWindow); for (i=0; i<256; i++ ) { colors[i].value = i;// temp = (int)(*p++) + r + gr_palette_gamma; temp = (int)(*p++) + r; if (temp<0) temp=0; else if (temp>63) temp=63; colors[i].rgb.red = gr_mac_gamma[temp];// temp = (int)(*p++) + g + gr_palette_gamma; temp = (int)(*p++) + g; if (temp<0) temp=0; else if (temp>63) temp=63; colors[i].rgb.green = gr_mac_gamma[temp];// temp = (int)(*p++) + b + gr_palette_gamma; temp = (int)(*p++) + b; if (temp<0) temp=0; else if (temp>63) temp=63; colors[i].rgb.blue = gr_mac_gamma[temp];// SetEntryColor(palette, i, &color); } old_device = GetGDevice(); SetGDevice(GameMonitor); SetEntries(0, 255, colors); SetGDevice(old_device);#if 0 ctab = (CTabHandle)NewHandle(sizeof(ColorTable)); Palette2CTab(palette, ctab); AnimatePalette(GameWindow, ctab, 0, 0, 256); ActivatePalette(GameWindow); DisposeHandle((Handle)ctab); if (GameGWorld != NULL) { ctab = (**GetGWorldPixMap(GameGWorld)).pmTable; // get the color table for the gWorld. CTabChanged(ctab); (**ctab).ctSeed = (**(**(*(CGrafPtr)GameWindow).portPixMap).pmTable).ctSeed; }#endif}
开发者ID:osgcc,项目名称:descent-mac,代码行数:58,
示例18: bmp// Operations:bool wxTaskBarIcon::SetIcon(const wxIcon& icon, const wxString& tooltip){ wxBitmap bmp( icon ) ; OSStatus err = noErr ; CGImageRef pImage; #if 0 // is always available under OSX now -- crashes on 10.2 in CFRetain() - RN pImage = (CGImageRef) bmp.CGImageCreate() ;#else WXHBITMAP iconport ; WXHBITMAP maskport ; iconport = bmp.GetHBITMAP( &maskport ) ; if (!maskport) { // Make a mask with no transparent pixels wxBitmap mbmp(icon.GetWidth(), icon.GetHeight()); wxMemoryDC dc; dc.SelectObject(mbmp); dc.SetBackground(*wxBLACK_BRUSH); dc.Clear(); dc.SelectObject(wxNullBitmap); bmp.SetMask( new wxMask(mbmp, *wxWHITE) ) ; iconport = bmp.GetHBITMAP( &maskport ) ; } //create the icon from the bitmap and mask bitmap contained within err = CreateCGImageFromPixMaps( GetGWorldPixMap(MAC_WXHBITMAP(iconport)), GetGWorldPixMap(MAC_WXHBITMAP(maskport)), &pImage ); wxASSERT(err == 0);#endif wxASSERT(pImage != NULL ); err = SetApplicationDockTileImage(pImage); wxASSERT(err == 0); if (pImage != NULL) CGImageRelease(pImage); return m_iconAdded = err == noErr;}
开发者ID:gitrider,项目名称:wxsj2,代码行数:46,
示例19: DrawCompleteProcstatic pascal OSErr DrawCompleteProc (Movie theMovie, long refCon) { long int h; long int w; int y, x; GWorldPtr offWorld = (GWorldPtr) refCon; Rect bounds; Ptr baseAddr; long rowBytes; uint8_t* imbuf; mwSize dims[3]; GetPixBounds(GetGWorldPixMap(offWorld), &bounds); baseAddr = GetPixBaseAddr(GetGWorldPixMap(offWorld)); rowBytes = GetPixRowBytes(GetGWorldPixMap(offWorld)); h = rint(bounds.bottom - bounds.top); w = rint(bounds.right - bounds.left); dims[0] = h; dims[1] = w; dims[2] = 3; framedata = mxCreateNumericArray(3, dims, mxUINT8_CLASS, mxREAL); imbuf = (uint8_t*) mxGetData(framedata); // Retrieve the pixel data, unpack the RGB values and copy for (y = 0; y < h; ++y) { long *p; p = (long *) (baseAddr + rowBytes * (long) y); for (x = 0; x < w; ++x) { UInt32 color = *(long *)((long) p + 4 * (long) x);; long B = (color & 0xFF000000) >> 24; long G = (color & 0x00FF0000) >> 16; long R = (color & 0x0000FF00) >> 8; imbuf[y + x * h + 0 * (h * w)] = R; imbuf[y + x * h + 1 * (h * w)] = G; imbuf[y + x * h + 2 * (h * w)] = B; } } return noErr;}
开发者ID:cabeen,项目名称:mat-qt,代码行数:44,
示例20: ClearCurrentScrapvoid _HYPlatformGraphicPane::_CopyToClipboard (void){ _HYGraphicPane* parent = (_HYGraphicPane*)this; #ifdef TARGET_API_MAC_CARBON ClearCurrentScrap(); #else ZeroScrap(); #endif Rect bRect; bRect.left = bRect.top = 0; bRect.right = parent->w; bRect.bottom = parent->h; PicHandle pic = OpenPicture (&bRect); GrafPtr topPort; GetPort (&topPort); LockPixels (GetGWorldPixMap(thePane)); #ifdef OPAQUE_TOOLBOX_STRUCTS CopyBits (GetPortBitMapForCopyBits(thePane),GetPortBitMapForCopyBits(topPort), &bRect,&bRect,srcCopy,(RgnHandle)nil); #else CopyBits ((BitMap*)*GetGWorldPixMap(thePane), (BitMap*)&(topPort->portBits),&bRect,&bRect, srcCopy,(RgnHandle)nil); #endif UnlockPixels (GetGWorldPixMap(thePane)); ClosePicture (); HLock ((Handle)pic); #ifdef TARGET_API_MAC_CARBON ScrapRef theScrapRef; GetCurrentScrap(&theScrapRef); PutScrapFlavor(theScrapRef, 'PICT', kScrapFlavorMaskNone,GetHandleSize((Handle)pic),*pic); #else PutScrap (GetHandleSize((Handle)pic),'PICT',*pic); #endif KillPicture (pic); }
开发者ID:mdsmith,项目名称:OCLHYPHY,代码行数:42,
示例21: GetGWorldPixMap////////////////////////////////////////////////////////////////////////////////// virtualunsigned char* LLMediaImplQuickTime::getMediaData(){ unsigned char* ptr = NULL; if ( mGWorldHandle ) { PixMapHandle pix_map_handle = GetGWorldPixMap( mGWorldHandle ); ptr = ( unsigned char* )GetPixBaseAddr( pix_map_handle ); }; return ptr;}
开发者ID:AlexRa,项目名称:Kirstens-clone,代码行数:15,
示例22: decode// decode a framestatic mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){ OSErr result = 1; CodecFlags ignore; if(len<=0) return NULL; // skipped frame#if defined(WIN32_LOADER) && !defined(CONFIG_QUICKTIME) Setup_FS_Segment();#endif result = DecompressSequenceFrameS(imageSeq, data, len, 0, &ignore, NULL); if(result) { mp_msg(MSGT_DECVIDEO,MSGL_ERR,"DecompressSequenceFrameS result=0x%d/n",result); return NULL; }if((int)sh->context==0x73797639){ // Sorenson 16-bit YUV -> std YVU9 int i; PixMap dstPixMap = **GetGWorldPixMap(OutBufferGWorld); short *src0=(short *)((char*)dstPixMap.baseAddr+0x20); for(i=0;i<mpi->h;i++){ int x; unsigned char* dst=mpi->planes[0]+i*mpi->stride[0]; unsigned short* src=src0+i*((mpi->w+15)&(~15)); for(x=0;x<mpi->w;x++) dst[x]=src[x]; } src0+=((mpi->w+15)&(~15))*((mpi->h+15)&(~15)); for(i=0;i<mpi->h/4;i++){ int x; unsigned char* dst=mpi->planes[1]+i*mpi->stride[1]; unsigned short* src=src0+i*(((mpi->w+63)&(~63))/4); for(x=0;x<mpi->w/4;x++) dst[x]=src[x]; src+=((mpi->w+63)&(~63))/4; } src0+=(((mpi->w+63)&(~63))/4)*(((mpi->h+63)&(~63))/4); for(i=0;i<mpi->h/4;i++){ int x; unsigned char* dst=mpi->planes[2]+i*mpi->stride[2]; unsigned short* src=src0+i*(((mpi->w+63)&(~63))/4); for(x=0;x<mpi->w/4;x++) dst[x]=src[x]; src+=((mpi->w+63)&(~63))/4; }} return mpi;}
开发者ID:azuwis,项目名称:mplayer,代码行数:51,
示例23: gr_palette_loadvoid gr_palette_load( ubyte *pal ) { int i, j; GDHandle old_device; ColorSpec colors[256];// PaletteHandle palette;// RGBColor color;// CTabHandle ctable; for (i=0; i<768; i++ ) {// gr_current_pal[i] = pal[i] + gr_palette_gamma; gr_current_pal[i] = pal[i]; if (gr_current_pal[i] > 63) gr_current_pal[i] = 63; } for (i = 0, j = 0; j < 256; j++) { colors[j].value = j; colors[j].rgb.red = gr_mac_gamma[gr_current_pal[i++]]; colors[j].rgb.green = gr_mac_gamma[gr_current_pal[i++]]; colors[j].rgb.blue = gr_mac_gamma[gr_current_pal[i++]]; } old_device = GetGDevice(); SetGDevice(GameMonitor); SetEntries(0, 255, colors); SetGDevice(old_device);#if 0 palette = GetPalette(GameWindow); for (i = 0; i < 768; i += 3) { color.red = gr_current_pal[i] << 9; color.green = gr_current_pal[i+1] << 9; color.blue = gr_current_pal[i+2] << 9; SetEntryColor(palette, i / 3, &color); } ctable = (CTabHandle)NewHandle(sizeof(ColorTable)); Palette2CTab(palette, ctable); AnimatePalette(GameWindow, ctable, 0, 0, 256); ActivatePalette(GameWindow); DisposeHandle((Handle)ctable); if (GameGWorld != NULL) { ctable = (**GetGWorldPixMap(GameGWorld)).pmTable; // get the color table for the gWorld. CTabChanged(ctable); (**ctable).ctSeed = (**(**(*(CGrafPtr)GameWindow).portPixMap).pmTable).ctSeed; }#endif gr_palette_faded_out = 0; init_computed_colors();}
开发者ID:osgcc,项目名称:descent-mac,代码行数:50,
示例24: wxMacGetGenericRGBColorSpacevoid wxMemoryDC::DoSelect( const wxBitmap& bitmap ){ if ( m_selected.Ok() ) {#if wxMAC_USE_CORE_GRAPHICS m_selected.EndRawAccess() ; delete m_graphicContext ; m_graphicContext = NULL ;#else// TODO: UnlockPixels( GetGWorldPixMap(MAC_WXHBITMAP(m_selected.GetHBITMAP())) );#endif } m_selected = bitmap; if (m_selected.Ok()) { #if wxMAC_USE_CORE_GRAPHICS if ( m_selected.GetDepth() != 1 ) m_selected.UseAlpha() ; m_selected.BeginRawAccess() ; m_width = bitmap.GetWidth(); m_height = bitmap.GetHeight(); CGColorSpaceRef genericColorSpace = wxMacGetGenericRGBColorSpace(); CGContextRef bmCtx = (CGContextRef) m_selected.GetHBITMAP(); if ( bmCtx ) { CGContextSetFillColorSpace( bmCtx, genericColorSpace ); CGContextSetStrokeColorSpace( bmCtx, genericColorSpace ); SetGraphicsContext( wxGraphicsContext::CreateFromNative( bmCtx ) ); } m_ok = (m_graphicContext != NULL) ;#else m_macPort = m_selected.GetHBITMAP( &m_macMask ) ; m_ok = (m_macPort != NULL) ; if (m_ok) { LockPixels( GetGWorldPixMap( (CGrafPtr) m_macPort ) ) ; SetRectRgn( (RgnHandle) m_macBoundaryClipRgn , 0 , 0 , m_selected.GetWidth() , m_selected.GetHeight() ) ; CopyRgn( (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) m_macCurrentClipRgn ) ; }#endif } else { m_ok = false; }}
开发者ID:Bluehorn,项目名称:wxPython,代码行数:49,
示例25: ZeroMemoryvoid *fontmng_create(int size, UINT type, const TCHAR *fontface) { void *ret; _FNTMNG fnt; int fontalign; int allocsize; ZeroMemory(&fnt, sizeof(fnt)); if (size < 0) { size *= -1; } if (size < 6) { size = 6; } else if (size > 128) { size = 128; } fnt.fontsize = size; fnt.fonttype = type; fnt.fontwidth = size + 1; fnt.fontheight = size + 1; fontalign = sizeof(_FNTDAT) + (fnt.fontwidth * fnt.fontheight); allocsize = sizeof(fnt); allocsize += fontalign; SetRect(&fnt.rect, 0, 0, fnt.fontwidth, fnt.fontheight); if (NewGWorld(&fnt.gw, 32, &fnt.rect, NULL, NULL, useTempMem) != noErr) { return(NULL); } fnt.pm = GetGWorldPixMap(fnt.gw); GetFNum("/pOsaka C++ GetGalCanvas函数代码示例 C++ GetGValue函数代码示例
|