[futurebasic] re:[FBII] C Me Field Me (QT)

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : March 2000 : Group Archive : Group : All Groups

From: Robert Covington <t88@...>
Date: Sun, 12 Mar 2000 02:29:01 -0500
Chris, I appreciate your looking at that. The problem arises I think in
that there is a handle, ImageDescH&, being created as required for the
parameter, and the structure, ImageDesc is supposed to contain the info
somehow (for the datasize info). When the CompressImage FN loads the
handle/resizes it, or whatnot, nothing is getting put into ImageDesc
because things aren't set up like the C stuff. I do not know how to move a
handle to a record, assuming the handle data lines up correctly with the
fields in the record, if that is what is supposed to be going on. Would it
require a blockmove or something?

In the C Struct, there are a number or dereferenced pointers and handles
being set up that handle this I think (yea, pun) and that is the part I was
wondering how to do in FB.

From further below:
>>> typedef struct SampleDescription SampleDescription,
>>*SampleDescriptionPtr,**SampleDescriptionHandle;<----!!!?
>>> typedef struct ImageDescription ImageDescription, *ImageDescriptionPtr,
>>>**ImageDescriptionHandle;  <----!!!?

Thanks for any help anyone.

Robert



>Robert,
>
>The FIXED data type is a long, not a short int. Off the top of my head,
>not tested. Also, in your call to FN ADDMEDIASAMPLE, you had
>ImageDesc.datasize&, think this should be ImageDescH&..datasize&. See
>below for changes ('=====).
>
>hth
>
>Chris Young

>> 'FB II records, that need to be referenced and loaded properly.
>>
>> DIM RECORD SampleDescriptionRec
>>   DIM SDzdescSize&                    ' LONGINT
>>   DIM SDzdataFormat&                  ' LONGINT
>>   DIM SDzresvd1&                      ' LONGINT
>>   DIM SDzresvd2%                      ' INTEGER
>>   DIM SDzdataRefIndex%                ' INTEGER
>> DIM END RECORD _SDzSize  'yes-more proper?
>>
>> DIM RECORD ImageDescriptionRec
>>   DIM idSize&                         'total size of this structure
>>   DIM cType%                          'compressor creator type
>>   DIM resvd1&                         'reserved--must be set to 0
>>   DIM resvd2&                         'reserved--must be set to 0
>>   DIM dataRefIndex%                   'reserved--must be set to 0
>>   DIM cVersion%                       'version of compressed data
>>   DIM revisionLevel%                  'compressor that created data
>>   DIM vendor&                         'compressor developer that
>created data
>>   DIM temporalQuality%                'degree of temporal compression
>>   DIM spatialQuality%                 'degree of spatial compression
>>   DIM frmWidth%                       'width of source image in pixels
>>   DIM frmHeight%                      'height of source image in
>pixels
>'==============================================
>     DIM shRes&                          'horizontal resolution of
>source
>> image; C said "Fixed" Correct?
>'==============================================
>     DIM svRes&                          'vertical resolution of source
>image
>> ; C said "Fixed"
>'==============================================
>>   DIM dataSize&                       'size in bytes of compressed
>data
>>   DIM frameCount%                     'number of frames in image data
>>   DIM 31 cname$                       'name of compression algorithm
>>   DIM sdepth%                         'pixel depth of source image
>>   DIM clutID%                         'ID number of the color table
>for image
>> DIM END RECORD _ImageDescription ' yes - more proper?

>GETMAXCOMPRESSIONSIZE(MovieWorld&.portPixMap&,gRect.top%,_kMgrChoose,_co
>decNorma
>> lQuality, _"rle ", _anyCodec, maxCompressedSize&)
>>
>>       IF err<>0 THEN END
>>
>>       compressedHnd& =FN NEWHANDLE(maxCompressedSize&)
>>       err=FN MOVEHHI(compressedHnd&)
>>       err=FN HLOCK(compressedHnd&)
>>       compressedDataPtr& =FN STRIPADDRESS([compressedHnd&])
>>       ImageDescH& = FN NEWHANDLE _clear(4)
>>
>>       CALL GETGWORLD(oldPort&, oldGDeviceH&)
>>       CALL SETGWORLD(MovieWorld&, 0)
>>
>>       CurrentSample%=1
>>       FOR CurrentSample%=1 TO 1   'make frames loop set to one for
>testing.
>>         CALL ERASERECT(gRect)
>>
>>         FN MakeAFrame(CurrentSample%)
>>
>>         err =FN COMPRESSIMAGE(MovieWorld&.portpixmap&,gRect.top%,
>> _codecNormalQuality,_"rle ",ImageDescH&, compressedDataPtr&)
>>         result%=FN CheckError(err%,"COMPRESSIMAGE")
>>         LONG IF err<>0
>>           CALL SETGWORLD(oldPort&, oldGDeviceH&)
>>           END
>>         END IF
>>
>>         NumSamples&=1
>>
>>         err = FN ADDMEDIASAMPLE(theMedia&, compressedHnd&,
>'==============================================
>
> 0,ImageDescH&..datasize&, 60,ImageDescH&, NumSamples&,0,0)
>'==============================================

>> 'In the C headers:
>>
>> struct SampleDescription {
>>  long descSize;
>>  long dataFormat;
>>  long resvd1;
>>  short resvd2;
>>  short dataRefIndex;
>> };
>> typedef struct SampleDescription SampleDescription,
>*SampleDescriptionPtr,
>> **SampleDescriptionHandle;<----!!!
>>
>> Zounds!  How to reference the above????!
>>
>> struct ImageDescription {
>> <Big Snip>
>>
>> };
>> typedef struct ImageDescription ImageDescription,
>*ImageDescriptionPtr,
>> **ImageDescriptionHandle;  <----!!!