예제 #1
0
 ~impl() {
     if (image_desc) DisposeHandle((Handle)image_desc);
     if (handle) DisposeHandle(handle);
     if (gworld) DisposeGWorld(gworld);
     if (buffer) delete[] buffer;
     if (movie) DisposeMovie( movie );
 }
예제 #2
0
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);
	}
}
예제 #3
0
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;
}
예제 #4
0
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;
}
예제 #5
0
파일: scrap.c 프로젝트: LarBob/executor
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;
}
예제 #6
0
파일: QutTexture.c 프로젝트: refnum/quesa
//=============================================================================
//		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);
}
예제 #7
0
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( &currentPort, &currentDevice );
	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;
}
예제 #9
0
파일: scrap.c 프로젝트: LarBob/executor
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);
    }
}
예제 #10
0
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);
}
예제 #11
0
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();

}
예제 #13
0
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;
	}
}
예제 #14
0
void QTCode_DoDestroyOffscreen(GWorldPtr offscreen, HBITMAP	hBitmap)
{
	BOOL success;

		/* Destroy the offscreen GWorld and related objects */
	DisposeGWorld(offscreen);
	success = DeleteObject(hBitmap);
}
예제 #15
0
void CloseTintWorld()
{
	if(gBL_TintWorld)
	{
		DisposeGWorld(gBL_TintWorld);
		gBL_TintWorld=0L;
	}
}
예제 #16
0
void
qtCanvas::Impl::finishImage()
{
    if (mGWorld) {
        DisposeGWorld (mGWorld);
    }

    delete[] mImageData;
}
예제 #17
0
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);
}
예제 #18
0
    //------------------------------------------------------------------------
    void pixel_map::destroy()
    {
		delete[] m_buf;
		m_buf = NULL;
		if (m_pmap != nil)
		{
			DisposeGWorld(m_pmap);
			m_pmap = nil;
		}
    }
예제 #19
0
MacWidgetPainter::~MacWidgetPainter()
{
#ifndef SIXTY_FOUR_BIT
	if(m_offscreen)
	{
		DisposeGWorld(m_offscreen);
		m_offscreen = NULL;
	}
#endif
}
예제 #20
0
void fontmng_destroy(void *hdl) {

	FNTMNG	fhdl;

	fhdl = (FNTMNG)hdl;
	if (fhdl) {
		DisposeGWorld(fhdl->gw);
		free(fhdl);
	}
}
예제 #21
0
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;
}
예제 #22
0
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
	//--------------------------------------

}
예제 #24
0
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);
}
예제 #25
0
파일: osxdc.cpp 프로젝트: n9yty/livecode
MCScreenDC::~MCScreenDC()
{
    MCNotifyFinalize();

    if (opened)
        close(True);
    while (pendingevents != NULL)
    {
        MCEventnode *tptr =(MCEventnode *)pendingevents->remove(pendingevents);
        delete tptr;
    }
    if (bgw != NULL)
        DisposeGWorld(bgw);
}
예제 #26
0
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);
} 
예제 #27
0
// ######################################################################
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);
}
예제 #28
0
파일: vd_qtvideo.c 프로젝트: azuwis/mplayer
// 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();
}
예제 #29
0
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);
}
예제 #30
0
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);
}