~impl() { if (image_desc) DisposeHandle((Handle)image_desc); if (handle) DisposeHandle(handle); if (gworld) DisposeGWorld(gworld); if (buffer) delete[] buffer; if (movie) DisposeMovie( movie ); }
void _HYPlatformGraphicPane::_SetPaneSize (int h,int w, int d) { DisposeGWorld (thePane); Rect bRect; bRect.left = bRect.top = 0; bRect.right = w; bRect.bottom = h; short errCode; if (d>1) { errCode = NewGWorld (&thePane,d,&bRect,0,GetMainDevice(),noNewDevice); if (errCode == -108) // no memory errCode = NewGWorld (&thePane,d,&bRect,0,GetMainDevice(),noNewDevice|useTempMem); } else { errCode = NewGWorld (&thePane,d,&bRect,0,nil,0); if (errCode == -108) // no memory errCode = NewGWorld (&thePane,d,&bRect,0,nil,useTempMem); } if (errCode) { _String errMsg ("MacOS Error "); errMsg = errMsg & (long)errCode &" while trying to allocate memory for GraphicPane"; FlagError (errMsg); } }
static gboolean gst_osx_video_src_stop (GstBaseSrc * src) { GstOSXVideoSrc *self; ComponentResult err; self = GST_OSX_VIDEO_SRC (src); GST_DEBUG_OBJECT (src, "stopping"); self->video_chan = NULL; err = CloseComponent (self->seq_grab); if (err != noErr) GST_WARNING_OBJECT (self, "CloseComponent returned %d", (int) err); self->seq_grab = NULL; DisposeGWorld (self->world); self->world = NULL; if (self->buffer != NULL) { gst_buffer_unref (self->buffer); self->buffer = NULL; } return TRUE; }
OSErr LoadBlastText(BTIPtr theInfo,short theFile,short theResId) { GWorldPtr theWorld; OSErr theErr; BTEHandle theBits; theInfo->lCoords=0L; theInfo->textRec.world=0L; theBits=(BTEHandle)BetterGetResource(theFile,kBlastTextExtrasResType,theResId); if (!theBits) return BetterGetResErr(); theInfo->spaceWidth=(**theBits).spaceWidth; theInfo->remapMe=(**theBits).remapCol; theInfo->transp=(**theBits).transpCol; BetterDisposeHandle((Handle)theBits); if (theErr=NewGWorldWithPic(&theWorld,theResId,8)) return theErr; MakeBCRecFromGWorld(theWorld,&theInfo->textRec); theInfo->lCoords=(Rect**)BetterGetResource(theFile,kLetterCoordResType,theResId); if (!theInfo->lCoords) { DisposeGWorld(theWorld); return BetterGetResErr(); } HLock((Handle)theInfo->lCoords); return noErr; }
PUBLIC int get_scrap_helper_dib (void *vh, void *lp) { SDL_Surface *surfp; GWorldPtr gp; PicHandle pich; Handle h; int retval; int len; surfp = surface_from_dib (lp); gp = gworld_from_surface (surfp); SDL_FreeSurface (surfp); pich = pict_from_gworld (gp, &len); DisposeGWorld (gp); h = (Handle) vh; len = GetHandleSize ((Handle) pich); ReallocHandle (h, len); if (MemErr != noErr) retval = -1; else { memcpy (STARH (h), STARH (pich), len); retval = len; } DisposHandle ((Handle) pich); return retval; }
//============================================================================= // 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); }
void createOffscreen(int pictItem) { PicHandle pict; Rect rect; CGrafPtr currentPort; GDHandle currentDevice; if (gGWorld != nil) DisposeGWorld( gGWorld ); pict = (PicHandle)GetResource( 'PICT', pictItem + 127 ); rect = (**pict).picFrame; GetGWorld( ¤tPort, ¤tDevice ); NewGWorld( &gGWorld, 32, &rect, nil, nil, 0 ); LockPixels( GetPortPixMap(gGWorld)); SetGWorld( gGWorld, nil ); DrawPicture( pict, &rect ); SetGWorld( currentPort, currentDevice ); ReleaseResource( (Handle)pict ); }
//////////////////////////////////////////////////////////////////////////////// // private bool LLMediaImplQuickTime::unload() { if ( mMovieHandle ) { StopMovie( mMovieHandle ); if ( mMovieController ) { MCMovieChanged( mMovieController, mMovieHandle ); }; }; if ( mMovieController ) { MCSetActionFilterWithRefCon( mMovieController, NULL, (long)this ); DisposeMovieController( mMovieController ); mMovieController = NULL; }; if ( mMovieHandle ) { SetMovieDrawingCompleteProc( mMovieHandle, movieDrawingCallWhenChanged, nil, ( long )this ); DisposeMovie ( mMovieHandle ); mMovieHandle = NULL; }; if ( mGWorldHandle ) { DisposeGWorld( mGWorldHandle ); mGWorldHandle = NULL; }; return true; }
PUBLIC void put_scrap_helper_dib (void *lp) { PicHandle pich; pich = pict_from_lp (lp); if (pich) { GWorldPtr gp; gp = gworld_from_pict (pich); if (gp) { SDL_Surface *surfp; surfp = surface_from_gworld (gp); if (surfp) { write_surfp_to_clipboard (surfp); SDL_FreeSurface (surfp); } DisposeGWorld (gp); } DisposHandle ((Handle) pich); } }
void MyDisposeEverything (void) { short nIndex; // dispose of each spriteÕs image data for (nIndex = 0; nIndex < kNumSprites; nIndex++) { if (gSprites[nIndex]) DisposeSprite(gSprites[nIndex]); if (gCompressedPictures[nIndex]) DisposeHandle(gCompressedPictures[nIndex]); if (gImageDescriptions[nIndex]) DisposeHandle((Handle)gImageDescriptions[nIndex]); } // dispose of the sprite plane world if (gSpritePlane) DisposeGWorld(gSpritePlane); // dispose of the sprite world and associated graphics world if (gSpriteWorld) DisposeSpriteWorld(gSpriteWorld); }
static 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); }
//--------------------------------------------------------------------------- ofVideoPlayer::~ofVideoPlayer(){ //-------------------------------------- #ifdef OF_VIDEO_PLAYER_QUICKTIME //-------------------------------------- closeMovie(); if(allocated) delete(pixels); if(allocated) delete(offscreenGWorldPixels); if(allocated && (offscreenGWorld)) DisposeGWorld((offscreenGWorld)); //-------------------------------------- #else //-------------------------------------- // [CHECK] anything else necessary for FOBS ? please check if (fobsDecoder != NULL){ delete fobsDecoder; } if (pixels != NULL){ delete pixels; } //-------------------------------------- #endif //-------------------------------------- tex.clear(); }
void MovieMaker::EndCapture() { OSStatus error = noErr; if (movie && movieResRef) { if (media && track) { // Errors adding the frame aren't too important here. (void)addFrame(); error = EndMediaEdits(media); if (error == noErr) { error = SCCompressSequenceEnd(ci); } if (error == noErr) { error = InsertMediaIntoTrack(track, 0, 0, GetMediaDuration(media), fixed1); } media = NULL; track = NULL; } short resId = movieInDataForkResID; error = AddMovieResource(movie, movieResRef, &resId, "\pSecond Life"); CloseMovieFile(movieResRef); movieResRef = 0; movie = NULL; } // NOTE: idh is disposed by SCCompressSequenceEnd. idh = NULL; if(ci) { CloseComponent(ci); ci = NULL; } if(gworld) { DisposeGWorld(gworld); gworld = NULL; } if(buffer) { free(buffer); buffer = NULL; } if(invertedBuffer) { free(invertedBuffer); invertedBuffer = NULL; } }
void QTCode_DoDestroyOffscreen(GWorldPtr offscreen, HBITMAP hBitmap) { BOOL success; /* Destroy the offscreen GWorld and related objects */ DisposeGWorld(offscreen); success = DeleteObject(hBitmap); }
void CloseTintWorld() { if(gBL_TintWorld) { DisposeGWorld(gBL_TintWorld); gBL_TintWorld=0L; } }
void qtCanvas::Impl::finishImage() { if (mGWorld) { DisposeGWorld (mGWorld); } delete[] mImageData; }
TLevelWriter3gp::~TLevelWriter3gp() { #if 0 if (m_pixmap) UnlockPixels(m_pixmap); if (m_compressedData) DisposeHandle(m_compressedData); if (m_gworld) DisposeGWorld(m_gworld); #endif QDErr err; if (m_videoMedia) if ((err = EndMediaEdits(m_videoMedia)) != noErr) { } // throw TImageException(getFilePath(), "can't end edit media"); if (m_videoTrack) if ((err = InsertMediaIntoTrack(m_videoTrack, 0, 0, GetMediaDuration(m_videoMedia), fixed1))) { } // throw TImageException(getFilePath(), "can't insert media into track"); short resId = movieInDataForkResID; if (m_movie) { FSSpec fspec; long myFlags = 0L; OSErr myErr = noErr; //UCHAR myCancelled = FALSE; const char *pStr = toString(m_path.getWideString()).c_str(); getFSSpecFromPosixPath(pStr, &fspec, true); myFlags = createMovieFileDeleteCurFile; // | //movieFileSpecValid | movieToFileOnlyExport; myErr = ConvertMovieToFile( m_movie, // the movie to convert NULL, // all tracks in the movie &fspec, // the output file '3gpp', // the output file type FOUR_CHAR_CODE('TVOD'), // the output file creator smSystemScript, // the script &resId, // no resource ID to be returned myFlags, // export flags m_myExporter); // no specific exp } DisposeHandle(m_hMovieData); DisposeHandle(m_dataRef); if (m_hSoundMovieData) DisposeHandle(m_hSoundMovieData); if (m_refNum) CloseMovieFile(m_refNum); DisposeMovie(m_movie); }
//------------------------------------------------------------------------ void pixel_map::destroy() { delete[] m_buf; m_buf = NULL; if (m_pmap != nil) { DisposeGWorld(m_pmap); m_pmap = nil; } }
MacWidgetPainter::~MacWidgetPainter() { #ifndef SIXTY_FOUR_BIT if(m_offscreen) { DisposeGWorld(m_offscreen); m_offscreen = NULL; } #endif }
void fontmng_destroy(void *hdl) { FNTMNG fhdl; fhdl = (FNTMNG)hdl; if (fhdl) { DisposeGWorld(fhdl->gw); free(fhdl); } }
int ioPagePostProcessing(PrintingLogicPtr printJob) { OSStatus status = noErr; // Close the page. status = PMSessionEndPage(printJob->printSession); if (printJob->aGWorld) { DisposeGWorld(printJob->aGWorld); printJob->aGWorld = NULL; } return status; }
static int v4m_close(V4lState *s) { if(s->seqgrab) CloseComponent(s->seqgrab); s->seqgrab=NULL; if (s->decomseq) CDSequenceEnd(s->decomseq); s->decomseq=NULL; if (s->pgworld!=NULL) DisposeGWorld(s->pgworld); s->pgworld=NULL; return 0; }
//--------------------------------------------------------------------------- ofQuickTimePlayer::~ofQuickTimePlayer(){ closeMovie(); //-------------------------------------- #ifdef OF_VIDEO_PLAYER_QUICKTIME //-------------------------------------- if(allocated) delete[] offscreenGWorldPixels; if ((offscreenGWorld)) DisposeGWorld((offscreenGWorld)); //-------------------------------------- #endif //-------------------------------------- }
void Tk_FreePixmap( Display *display, /* Display. */ Pixmap pixmap) /* Pixmap to destroy */ { MacDrawable *macPix = (MacDrawable *) pixmap; PixMapHandle pixels; display->request++; pixels = GetGWorldPixMap(macPix->portPtr); UnlockPixels(pixels); DisposeGWorld(macPix->portPtr); ckfree((char *) macPix); }
MCScreenDC::~MCScreenDC() { MCNotifyFinalize(); if (opened) close(True); while (pendingevents != NULL) { MCEventnode *tptr =(MCEventnode *)pendingevents->remove(pendingevents); delete tptr; } if (bgw != NULL) DisposeGWorld(bgw); }
static void QT_EndAddVideoSamplesToMedia (void) { SCCompressSequenceEnd(qtdata->theComponent); UnlockPixels(qtexport->thePixMap); if (qtexport->theGWorld) DisposeGWorld (qtexport->theGWorld); if (qtexport->ibuf) IMB_freeImBuf(qtexport->ibuf); if (qtexport->ibuf2) IMB_freeImBuf(qtexport->ibuf2); }
// ###################################################################### QuickTimeGrabber::Impl::~Impl() { const std::string summary = this->getSummary(); if (summary.size() > 0) LINFO("%s", summary.c_str()); if (itsSeqGrab.it != 0) SGStop(itsSeqGrab.it); // clean up the bits if (itsDrawSeq) CDSequenceEnd(itsDrawSeq); DisposeGWorld(itsGWorld); }
// uninit driver static void uninit(sh_video_t *sh){ if(OutBufferGWorld) { DisposeGWorld(OutBufferGWorld); OutBufferGWorld = NULL; } if(framedescHandle) { DisposeHandle((Handle)framedescHandle); framedescHandle = NULL; } if(imageSeq) { CDSequenceEnd(imageSeq); imageSeq = 0; } ExitMovies(); }
void Tk_FreePixmap( Display *display, /* Display. */ Pixmap pixmap) /* Pixmap to destroy */ { MacDrawable *macPix = (MacDrawable *) pixmap; display->request++; if (macPix->grafPtr) { DisposeGWorld(macPix->grafPtr); } if (macPix->context) { TkMacOSXDbgMsg("Cannot free CG backed Pixmap"); } ckfree((char *) macPix); }
void 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); }