quicktime-java

[Prev] Thread [Next]  |  [Prev] Date [Next]

questions for apply contrast filter to videos. Gill Bates Thu Oct 02 02:00:55 2008

Hallo all,
currently I'm programming to apply a contrast filter to my movies in my java GUI. I use the code from Chapter 9.5 from book <Quicktime for Java- A developer's Notebook>


// show list of effects
      // flags are in StdQTConstants.pdOptions...
      Pict[  ] previewPicts = new Pict[1];
      previewPicts[0] = sourceMovie.getPosterPict( );
      // get list of effects
      EffectsList effectsList = new EffectsList (1, 1, 0);
      AtomContainer effect =
          ParameterDialog.showParameterDialog (effectsList,
                                               0, // dialogOptions
                                               null, // parameters
"Pick an effect", // title
                                               previewPicts //pictArray
                                               );
      // find out the effect type by getting the "what" atom,
      // whose data is a FOUR_CHAR_CODE
      Atom what = effect.findChildByIndex_Atom (null,
                                     StdQTConstants.kParameterWhatName,
                                                 1);
      int effectType = effect.getAtomData(what).getInt(0);
      effectType = EndianOrder.flipBigEndianToNative32(effectType);
      System.out.println ("User chose " +
                          QTUtils.fromOSType(effectType) +
                          " effect type");

      // make a sample description for the effect description
ImageDescription imgDesc = ImageDescription.forEffect (effectType);
      imgDesc.setWidth (EFFECT_TRACK_WIDTH);
      imgDesc.setHeight (EFFECT_TRACK_HEIGHT);

      // give the effect description a ref to the source
      effect.insertChild (null,
                          StdQTConstants.kEffectSourceName,
                          1,
                          0,
                          QTUtils.toOSType ("srcA"));

      // add effect to the video media
      effectsMedia.beginEdits( );

      effectsMedia.addSample (effect, // QTHandleRef data,
                            0, // int dataOffset,
                            effect.getSize( ), // int dataSize,
sourceTrack.getDuration( ), //int durPerSample,
                            imgDesc, // SampleDescription sampleDesc,
                            1, // int numberOfSamples,
                            0 // int sampleFlags
                            );
      effectsMedia.setInputMap (inputMap);

      effectsMedia.endEdits( );



The question is everytime it will open a dialog to let the user choose the effect and its parameters. But now I just want increase the contrase by 20% in my code , instead of choosing it again and again.
I wonder anyone knows how could I use any constructors or so?






Regards,
Gill Bates

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-java mailing list      ([EMAIL PROTECTED])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quicktime-java/alexiscircle%40gmail.com

This email sent to [EMAIL PROTECTED]