Exemplo n.º 1
0
OSErr 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;
}
Exemplo n.º 2
0
    //------------------------------------------------------------------------
    void pixel_map::draw(WindowRef window, const Rect *device_rect, const Rect *pmap_rect) const
    {
        if(m_pmap == nil || m_buf == NULL) return;

		PixMapHandle	pm = GetGWorldPixMap (m_pmap);
		CGrafPtr		port = GetWindowPort (window);
		Rect			dest_rect;

		// Again, I used the Quicktime version.
		// Good old 'CopyBits' does better interpolation when scaling
		// but does not support all pixel depths.
		MacSetRect (&dest_rect, 0, 0, this->width(), this->height());
		ImageDescriptionHandle		image_description;
		MakeImageDescriptionForPixMap (pm, &image_description);	   
		if (image_description != nil)
		{
			DecompressImage (GetPixBaseAddr (pm), image_description, GetPortPixMap (port), nil, &dest_rect, ditherCopy, nil);	   
			DisposeHandle ((Handle) image_description);
		}
	}