Image vs image reference 'value' to

I have a problem (or so I think) with the image of references or pointers as I prefer to call them.

Majority of the functions use the reference and it is very good for efficiency, however...

I have two quick parallel loops is working on an image. One, once it is done with the image, it passes it to the next loop and gets himself another image etc. The problem with this situation that I have is that the second loop Gets the reference and meanwhile one changes the value of the image because he works with the same reference. At least, I guess that's what happens.

The only real solution to this problem would be (IMHO) to transmit a copy of the image (a vale instead of a pointer) to the second loop. In this way each work on its own segment of memory. Using queues seem to me reasonable here. The problem is that I don't see a way clear enough to get the value of what is known of the image instead of a pointer. I was thinking of using "Flatten Image" and move on to the next loop. Is there a better way to give a copy of the 'value' of the image?

Also the architecture of the two loops must be kept like this. Should I have a brighter way to have two loops operate in parallel and then passing image data? Thank you very much.

In similar situations, I have used to create a table of images initialized (I guess how I need based on the frequency of images and processing time) and then scroll the table if each new image will different image ref.  Then I can cross my queue of the current image REF and treat it in subsequent loops.  I treat the array of images as a circular buffer.

Tags: NI Hardware

Similar Questions

  • Extract the MAX image gray value

    I used the measurement and Automation Explorer (MAX) to align an image using a Basler scA640-70fm CCD camera, then save the image in TIFF and PNG. What I needed was the pixels of the image grayscale values. I used another program (ImageJ) to convert the TIFF/PNG files in image text (i.e. the values of grayscale in a .txt file). But when I did I noticed that the TIFF and PNG files for the same image produced very different pixel values. In addition, given that CCD camera bit depth 12, I expect the text image to have any pixels with a value greater than 4095 (2 ^ 12-1), but the highest pixel value in the text created from the TIFF image was in fact 36863; It seems, that is to say that the image is a 16-bit image.

    I don't know what I need to fix. Is it not possible to use MAX to record a CCD image grayscale values?

    Thank you

    Neil

    Hi Neil,

    Use the PNG if you want to process the images.  PNG is a lossless format.  I never liked TIFF for 16-bit images.  When we implemented this code, the standard TIFF caught only supported images 8-bit and different vendors added support of 16 bits of different and incompatible ways.

    -Jeff

  • The image is a vector image. Values based on the low-resolution proxy RGB eyedropper

    I've used Q2ID to convert a Quark InDesign file and when I use the eyedropper tool, I get the error message: "the Image is a vector image. Values of pipette based low resolution proxy RGB. Then he replaced the white text RGB and will not follow what I copy so basically I have to redo the entire formatting. I do a save as to a different name and restarted, but it has happened several times. I'm not placing an illustration of any operation, the text is not described, but I can't copy the format with the eyedropper tool. Any suggestions?

    Thank you for your time and your consideration.

    No.... do not see the message at all, but I think I found a problem with the top layer. Turn it off (it is already locked) then try again.

    Bob

  • The image reference

    Hi Expert Vision,

    I just started tinkering with the module Vision and think it's very nice.

    A rookie question I had, with a picture (for example from a grab IMAQdx) reference, I have to connect through all functions, or is permitted to use only the first copy.

    What I really mean is that with normal references the reference itself is constant, and should not be religiously it wire even though all States, etc.

    Please refer to the image that I hope that my request a little more clear. Thank you!

    Yes you are right, it is just a normal static reference. Nevertheless, I prefer always connect via all nodes and use registers with shift on the nodes. Just for cleanliness of code.

    And second thing, beware when wire you the Dst vision Image entry live treatment in this case, the reference to output image is equal to Image Dst. If Image Dst is left unwired, the output image is equal to the Src of the Image.

  • An imported image CMYK values do not match with CMYK in Illustrator

    Hello everyone. I made a simple poster using photoshop to make the background and Illustrator to make fonts and some other stuff.

    In CMYK mode, my black is only 100% K (in photoshop)

    When you place the image in illustrator the 100% K (black) turns black different with C M Y added. But then when I save it as a PDF preview shows black as a little gray (which is something normal - in the press, it will be only in black). So my question is, should I change enything out to see a 100% K in illustrator to match values CMYK in Photoshop? Or should I leave it this way? I guess if I get a 'grey' in the preview PDF's something good huh? because in photoshop, when I got to 100 %K in my screen it looks like gray and black total no.

    OK, so you have used the pipette to measure black. It was not clear in your initial post.

    You can take an accurate measurement with the eyedropper in related photos. It is simply not possible. sampling of colors with the SHIFT key will always taste the representation on the screen, i.e. through color management.

    If you want to check colors, create a PDF file and then use Adobe Acrobat.

    When the incorporation of your linked images, you must take care of the color management to prevent CMYK-to-CMYK-transformations. You need to check the color profiles and you must correctly configure the color management. Which of the courses apllies to save a PDF file as well.

    There is a great document on prdouction impression with Creative Suite, you can read: http://rufus.deuchler.net/2011/06/adobe-publishes-a-new-creative-suite-555-printing-guide. html

  • Displays the name of the image or value (table)

    I am loading a list of images of a php file in a table that the images show very well, but I can't name the image in run mode

    I want to set the image name in a lable and in to a text box when ive clicked don't use as3 a few months so I think he will be

    my lack of experience and be a simple fix

    Here's what my php echo file

    ReturnString = Movie1. PG | rating7 (|) Movie2 | 18: rating9 (|) movie3 | 16 | Rating (|)

    I have a file with my photos in movie1.jeg named etc etc.

    I'll fath

    Thanks in advance

    Stop();

    Import fl.transitions.Tween;

    Fl.transitions.easing import. *;

    import flash.events.MouseEvent;

    var filename_list = new Array();

    var filename_name = new Array();

    var i: Number;

    var tn:Number = 0;

    var no_of_column:Number = 5;

    var no_of_row:Number = 3;

    var no_of_extra_row:Number;

    var scale_factor:Number = 0.8;

    var tween_duration:Number = 0.6;

    var new_row:Number = 0;

    var total: Number;

    function requestList (): void {}

    var variables: URLVariables = new URLVariables();

    var varSend:URLRequest = new URLRequest ("moivetitles.txt");

    varSend.method = URLRequestMethod.POST;

    variable = varSend.data;

    var varLoader:URLLoader = new URLLoader;

    varLoader.dataFormat = pouvez;

    varLoader.addEventListener (Event.COMPLETE, completeHandler);

    variables.myRequest = "get_data_array";

    varLoader.load (varSend);

    function completeHandler(event:Event):void {}

    var returnStr = event.target.data.returnstring;

    splitByDelimiter (returnStr);

    }

    }

    requestList();

    var p:Number = 0;

    function splitByDelimiter(externalString:String) {}

    raw_string_txt. Text = "" + externalString; ".

    var myArray:Array = externalString.split ("(|)");

    var arrnum:Number = myArray.length

    trace (arrnum);

    for (var: string elements in myArray) {}

    p ++ ;

    var innerArray:Array is myArray [item].split("|");.

    innerArray = movieTitle:String var [0];

    innerArray = movieGenre:String var [1];

    innerArray = movieRating:String var [2];

    {

    no_of_extra_row = Math.floor(arrnum/ no_of_column)-no_of_row;

    for (i = 0; i < arrnum; i ++)

    {

    innerArray = filename_list [0] m:System.NET.SocketAddress.ToString ();

    }

    load_tn();

    }

    }

    var movieclip_mc:MovieClip = new MovieClip();

    stage.addChild (movieclip_mc);

    movieclip_mc.x = tn_group.x + 70;

    var default_y:Number = movieclip_mc.y = tn_group.y + 50;

    movieclip_mc. Mask = tn_group_mask;

    tn_group. Visible = false;

    fm_previous. Visible = false;

    fm_next. Visible = false;

    function load_tn (): void

    {

    var pic_request:URLRequest = new URLRequest ("icons /" + filename_list + ".jpg");

    var pic_loader:Loader = new Loader();

    pic_loader. Load (pic_request);

    pic_loader.contentLoaderInfo.addEventListener (Event.COMPLETE, on_loaded);

    }

    function on_loaded(e:Event):void

    {

    If (tn < total)

    {

    load_tn();

    }

    on the other

    {

    fm_previous. Visible = true;

    fm_next. Visible = true;

    fm_previous.addEventListener (MouseEvent.CLICK, to_previous);

    fm_next.addEventListener (MouseEvent.CLICK, to_next);

    stage.addEventListener (MouseEvent.MOUSE_WHEEL, on_wheel);

    }

    var image_bm:Bitmap = new bitmap;

    var bk_igm_mc:MovieClip = new MovieClip();

    var movieTitle_txt:TextField = new TextField();

    var format1:TextFormat = new TextFormat();

    Format1. Color = 0xFFF000;

    Format1.font = "Verdana";

    Format1. Size = 16;

    Format1. Bold = true;

    Format1. Kerning = false;

    movieTitle_txt.antiAliasType = AntiAliasType.ADVANCED;

    movieTitle_txt.defaultTextFormat = format1;

    movieTitle_txt.selectable = false;

    movieTitle_txt.mouseEnabled = false;

    movieTitle_txt.autoSize = TextFieldAutoSize.LEFT;

    movieTitle_txt.x = 30;

    movieTitle_txt.y = 30;

    image_bm = Bitmap (e.target.content);

    image_bm.x = - image_bm.width * 0.5;

    image_bm.y = - image_bm.height * 0.5;

    image_bm. Smoothing = true;

    var bg_width = image_bm.width + 2;

    var bg_height = image_bm.height + 2;

    bk_igm_mc. Name = movieTitle + movieclip_mc.numChildren;

    bk_igm_mc. AddChild (image_bm);

    movieTitle_txt.text = bk_igm_mc.name;

    -movieTitle_txt.text lists the family name in the table, but the number of at-------.

    bk_igm_mc.filters = [new DropShadowFilter (5, 45, x 0 000000, 1, 5, 5, 1, 1, false, false, false)];

    bk_igm_mc. Graphics.beginFill (0xC5BBE5);

    bk_igm_mc. Graphics.drawRect (-bg_width * 0.5,-bg_height * 0.5, bg_width, bg_height);

    bk_igm_mc. Graphics.endFill ();

    bk_igm_mc.buttonMode = true;

    bk_igm_mc.addEventListener (MouseEvent.MOUSE_OVER, tn_over);

    bk_igm_mc.addEventListener (MouseEvent.MOUSE_OUT, tn_out);

    bk_igm_mc.addEventListener (MouseEvent.CLICK, tn_click);

    bk_igm_mc. ScaleX = bk_igm_mc.scaleY = scale_factor;

    bk_igm_mc.x = movieclip_mc.numChildren % no_of_column

    * (bg_width + 10) * scale_factor.

    bk_igm_mc.y = Math.floor (movieclip_mc.numChildren / no_of_column)

    * (bg_height + 10) * scale_factor.

    movieclip_mc. AddChild (bk_igm_mc);

    bk_igm_mc. AddChild (movieTitle_txt);

    }

    function tn_over(e:MouseEvent):void

    {

    var mc:MovieClip = MovieClip (e.target);

    var s_no:Number = parseInt (mc.name.slice (8.10));

    movieclip_mc. AddChild (MC);

    new Tween (mc, "scaleX", Elastic.easeOut, mc.scaleX, 1, tween_duration, true);

    new Tween (mc, "scaleY", Elastic.easeOut, mc.scaleY, 1, tween_duration, true);

    tn_title. Text = title_list [s_no];

    }

    function tn_out(e:MouseEvent):void

    {

    var mc:MovieClip = MovieClip (e.target);

    new Tween (mc, "scaleX", Strong.easeOut, mc.scaleX, scale_factor, tween_duration, true);

    new Tween (mc, "scaleY", Strong.easeOut, mc.scaleY, scale_factor, tween_duration, true);

    tn_title. Text = "";

    tn_desc. Text = "";

    tn_url. Text = "";

    }

    function tn_click(e:MouseEvent):void

    {

    var mc:MovieClip = MovieClip (e.target);

    var s_no:Number = parseInt (mc.name.slice (8.10));

    movieclip_mc. AddChild (MC);

    trace (e.Target.parent);

    -Gets the name of the final table, but many at-------.

    new Tween (mc, "scaleX", Elastic.easeOut, mc.scaleX, 1, tween_duration, true);

    new Tween (mc, "scaleY", Elastic.easeOut, mc.scaleY, 1, tween_duration, true);

    }

    function to_previous(e:MouseEvent):void

    {

    If (new_row < 0)

    {

    new_row ++;

    new Tween (movieclip_mc, "y", Strong.easeOut, movieclip_mc.y, default_y + new_row * 100, tween_duration, true);

    }

    }

    function to_next(e:MouseEvent):void

    {

    If (Math.abs (new_row) < no_of_extra_row)

    {

    -new_row;

    new Tween (movieclip_mc, "y", Strong.easeOut, movieclip_mc.y, default_y + new_row * 100, tween_duration, true);

    }

    }

    function on_wheel(e:MouseEvent):void

    {

    If (e.delta > 0)

    new_row ++;

    on the other

    -new_row;

    If (new_row > = 0)

    new_row = 0;

    ElseIf (new_row <-no_of_extra_row)

    new_row = - no_of_extra_row;

    new Tween (movieclip_mc, "y", Strong.easeOut, movieclip_mc.y, default_y + new_row * 100, tween_duration, true);

    }

    }

    Stop();

    Import fl.transitions.Tween;

    Fl.transitions.easing import. *;

    var filename_list = new Array();

    var url_list = new Array();

    var url_target_list:Array = new Array();

    var title_list = new Array();

    var description_list = new Array();

    var i: Number;

    var tn:Number = 0;

    var no_of_column:Number = 5;

    var no_of_row:Number = 5;

    var no_of_extra_row:Number;

    var scale_factor:Number = 0.8;

    var tween_duration:Number = 0.6;

    var new_row:Number = 0;

    function requestList (): void {}

    var variables: URLVariables = new URLVariables();

    var varSend:URLRequest = new URLRequest ("movielists.txt");

    varSend.method = URLRequestMethod.POST;

    variable = varSend.data;

    var varLoader:URLLoader = new URLLoader;

    varLoader.dataFormat = pouvez;

    varLoader.addEventListener (Event.COMPLETE, completeHandler);

    variables.myRequest = "get_data_array";

    varLoader.load (varSend);

    function completeHandler(event:Event):void {}

    var returnStr = event.target.data.returnstring;

    splitByDelimiter (returnStr);

    }

    }

    requestList();

    var p:Number = 0;

    function splitByDelimiter(externalString:String) {}

    raw_string_txt. Text = "" + externalString; ".

    var myArray:Array = externalString.split ("(|)");

    for (var: string elements in myArray) {}

    p ++ ;

    var innerArray:Array is myArray [item].split("|");.

    var arrnum:Number = myArray.length;

    no_of_extra_row = Math.floor(arrnum / no_of_column)-no_of_row;

    trace (arrnum);

    innerArray = movieTitle:String var [0];

    innerArray = movieGenre:String var [1];

    innerArray = movieRating:String var [2];

    loadToStage (movieTitle, movieGenre, movieRating);

    }

    }

    var thumbnail_group:MovieClip = new MovieClip();

    stage.addChild (thumbnail_group);

    thumbnail_group.x = tn_group.x + 70;

    var default_y:Number = thumbnail_group.y = tn_group.y + 50;

    thumbnail_group. Mask = tn_group_mask;

    tn_group. Visible = false;

    function loadToStage (mtitle:String, mgenre:String, mrating:String) {}

    var imageLoader:Loader = new Loader();

    var movieclip_mc:MovieClip = new MovieClip();

    var format1:TextFormat = new TextFormat();

    Format1. Color = mgenre;

    Format1.font = "Verdana";

    Format1. Size = 16;

    Format1. Bold = true;

    Format1. Kerning = false;

    var movieTitle_txt:TextField = new TextField();

    movieTitle_txt.antiAliasType = AntiAliasType.ADVANCED;

    movieTitle_txt.defaultTextFormat = format1;

    movieTitle_txt.selectable = false;

    movieTitle_txt.mouseEnabled = false;

    movieTitle_txt.text = mtitle;

    movieTitle_txt.autoSize = TextFieldAutoSize.LEFT;

    movieTitle_txt.x = 1;

    movieTitle_txt.y = 80;

    var image: URLRequest = new URLRequest("icons/"+mtitle+".jpg");

    imageLoader.load (image);

    movieclip_mc. AddChild (imageloader);

    movieclip_mc. AddChild (movieTitle_txt);

    movieclip_mc.buttonMode = true;

    var pic_bm:Bitmap = new bitmap;

    pic_bm.x = - pic_bm.width * 0.5;

    pic_bm.y = - pic_bm.height * 0.5;

    pic_bm. Smoothing = true;

    var bg_width = pic_bm.width + 135;

    var bg_height = pic_bm.height + 100;

    movieclip_mc. ScaleX = movieclip_mc.scaleY = scale_factor;

    movieclip_mc.x = thumbnail_group.numChildren % no_of_column

    * (bg_width + 10) * scale_factor.

    movieclip_mc.y = Math.floor (thumbnail_group.numChildren / no_of_column)

    * (bg_height + 10) * scale_factor.

    thumbnail_group. AddChild (movieclip_mc);

    fm_next.addEventListener (MouseEvent.CLICK, to_next);

    fm_previous.addEventListener (MouseEvent.CLICK, to_previous);

    movieclip_mc.addEventListener (MouseEvent.CLICK, clipClick);

    function clipClick(e:Event):void {}

    status_txt. Text = movieTitle_txt.text;

    }

    function to_previous(e:MouseEvent):void

    {

    If (new_row< 0="">

    {

    new_row ++;

    new Tween (thumbnail_group, "y", Strong.easeOut, thumbnail_group.y, default_y + new_row * 100, tween_duration, true);

    }

    }

    function to_next(e:MouseEvent):void

    {

    If (Math.abs (new_row)< no_of_extra_row="">

    {

    -new_row;

    new Tween (thumbnail_group, "y", Strong.easeOut, thumbnail_group.y, default_y + new_row * 100, tween_duration, true);

    }

    }

    }

  • The reference value of contact details for correspondence to the model model

    In the wizard of vision, we have the possibility to manually set the system of coordinates (the origin and angle) when creating a model. I couldn't find a similar option in lab mode (Learn model vi doesn't have the ability to adjust the coordinate system). Any help will be appreciated.

    Thanks for the reply. I found the model of the Editor under utilities vision and that's exactly what I want. However, I wanted to do in labview itself (without having to leave). This is why I wasn't using vision assistant. However, I created manually the configuration option of the coordinated reference in labview system and the problem is now resolved.

  • Examples for the new reference value of data with LVOOP

    Hello

    I'm looking for examples on how to use the new function of data with the LV class reference to achieve access to the ByRef objects.

    I would be very grateful for some codes.

    Greetings

    Hello

    a reall call by reference is not possible in LabVIEW. A good method is to use a queue with the size of a single element - then you can always move the reference to the queue and to read and write the new items in there.

    Or you use a FGV to store your object, which would work as well.

    RMathews

  • The spectral measurement VI allow the reference value of 20 microPa dB

    I want to show a FFT of sound pressure level in DB(a), where the reference should be 20-06 PA.  All the Spectral measure of VI I can find using a 1.0 dB reference.  The spectral measurement VI allow a reference to 20th-06 Pa?  I have the Sound and Vibration Toolkit.  Thank you.

    Rick

    In the Sound and Vibration Toolkit, there is a VI called Set dB reference.  This VI will set the dB reference for your data for you or you can take a look at how that VI changes the attributes of the waveform and impliment the scaling on your own. Once your data dB reference is correctly adjusted the screw of the FFT should display the data with respect to this property.

  • How to access managed since model DAM object reference value

    I have a simple model of dam like that. I want that the variable 'id' in this class to return the identifier of object reference managed (as vm-101). Is there a special property name for ID?


    [Bindable]

    [Model(type="VirtualMachine")]

    SerializableAttribute public class VmDataItem extends to {DataObject

    public var id: String;

    [Model (property = "name")]

    public var name: String;

    [Model (property = "runtime.bootTime")]

    public var bootTime:Date;

    }

    You don't need to use a variable id, the object reference is already part of the DataObject class.

    sourceInfo_.provider is the IResourceReference of this object, then sourceInfo_.provider.uid contains the identifier you are looking for.

  • Reference value of XML node inside the MXML syntax

    Hello

    I got ToolTips, which the text is provided by the xml file. The xml structure goes like this:

    <myButton>this is text for the toolTip</myButton>
    <myHBox>this is another text for the toolTip</myHBox>
     etc. 
    

    And I assign the text to the ToolTip in actionscript, like this:

    myButton.toolTip = myXML[myButton.id]
    myHBox.toolTip = myXML[myHBox.id]
    
    

    I was wondering if there is a way to assign the ToolTip text inside the MXML syntax. Right now it does not work because of the [square brackets].

    When I do this:

    <Button id="myButton" toolTip="{myXML[myButton.id]}"

    I got error: data binding will not be able to detect changes when using square brackets operator.

    Use '. '. (dot)

    hope this helps

    Baker v

  • Node property/reference for the image and 'Create VI' inconsistent control?

    Hello

    I encountered this problem several times already and although I have worked around him, so far, I would really like to understand what is it:

    If I have an image display control on the Panel before (IMAQ Vision, not the image control type) and drag a property node or a reference to it on the block diagram, it seems impossible to create a Subvi diagram if the selected objects are equipped with a knot of property image or an image reference. Select 'Create Subvi' won't do anything, don period. No warning, no beep system, no nothing.

    A related issue is that if I have a view control reference on the diagram and try to create a control from it (for example to use as a control on one dimension of connector VI entry), same thing, "Create control" will not do anything.

    Why is this?

    Thanks for your comments.

    X.

    Xavier,

    This was reported to R & D (35835) for further investigations. A possible workaround is to make the Subvi LabVIEW 7.1 and open it in the new version of LabVIEW.

  • How to refresh the value of image source

    I have an element of the image in a page fragment. When the page opens the source of the image is set to the URI of a gif file

    What I want, is to update the URI into another image, the value of a bean property once managed Exchange.

    The image component is bound to a property of the managed bean, pageAnimationImage.

    I'm new to ADF and tried to set the trigger part when the value of the property is set and also the true clientComponent of the image
    AdfFacesContext.getCurrentInstance () .addPartialTarget (pageAnimationImage);

    I searched this forum and other blogs but could not find anything related.

    I would really appreciate if anyone has a suggestion or point me to a related case.

    TIA

    Use an EL to get the URI of the image as
    The bean code:

        public String getImageURI()
        {// change the uri depending on your logic
            String uri = "/images/image1.gif";
            if (other_property_is_true())
                 uri = "/images/image2.gif";
            return uri;
        }
    

    Page code

                  
    

    You must always send the ppr to the immage after your property changes.

    Timo

  • Overlap two images, ordinary java works, and not in BlackBerry JDE 5

    I have an application for swing of simple java that takes two images and overlaps the other. While trying to this port in JDE5, I got out there is no class BufferedImage in the api of BB, but a similar class of the Bitmap. It's brought to BB mixing function is unable to produce an image that overlap. It shows a blank white screen.

    Here's the plain java function

    public BufferedImage blend( BufferedImage bi1, BufferedImage bi2,            double weight )   {     if (bi1 == null)          throw new NullPointerException("bi1 is null");
    
          if (bi2 == null)          throw new NullPointerException("bi2 is null");
    
          int width = bi1.getWidth();       if (width != bi2.getWidth())          throw new IllegalArgumentException("widths not equal");
    
         int height = bi1.getHeight();     if (height != bi2.getHeight())
    
              throw new IllegalArgumentException("heights not equal");
    
            BufferedImage bi3 = new BufferedImage(width, height,              BufferedImage.TYPE_INT_RGB);      int[] rgbim1 = new int[width];        int[] rgbim2 = new int[width];        int[] rgbim3 = new int[width];
    
          for (int row = 0; row < height; row++)     {         bi1.getRGB(0, row, width, 1, rgbim1, 0, width);           bi2.getRGB(0, row, width, 1, rgbim2, 0, width);
    
             for (int col = 0; col < width; col++)          {             int rgb1 = rgbim1[col];               int r1 = (rgb1 >> 16) & 255;                int g1 = (rgb1 >> 8) & 255;             int b1 = rgb1 & 255;
    
                    int rgb2 = rgbim2[col];               int r2 = (rgb2 >> 16) & 255;                int g2 = (rgb2 >> 8) & 255;             int b2 = rgb2 & 255;
    
                    int r3 = (int) (r1 * weight + r2 * (1.0 - weight));               int g3 = (int) (g1 * weight + g2 * (1.0 - weight));               int b3 = (int) (b1 * weight + b2 * (1.0 - weight));               rgbim3[col] = (r3 << 16) | (g3 << 8) | b3;            }
    
               bi3.setRGB(0, row, width, 1, rgbim3, 0, width);       }
    
           return bi3;   } 
    

    Here's the java function of BB

      public Bitmap blend( Bitmap bi1, Bitmap  bi2,                      double weight )        {
    
                  if (bi1 == null)                       throw new NullPointerException("bi1 is null");
    
                    if (bi2 == null)                       throw new NullPointerException("bi2 is null");
    
                    int width = bi1.getWidth();            if (width != bi2.getWidth())                   throw new IllegalArgumentException("widths not equal");
    
                   int height = bi1.getHeight();          if (height != bi2.getHeight())
    
                            throw new IllegalArgumentException("heights not equal");
    
             Bitmap bi3 = new Bitmap(width, height);         int[] rgbim1 = new int[width];         int[] rgbim2 = new int[width];         int[] rgbim3 = new int[width];
    
                    for (int row = 0; row < height; row++)         {
    
                           bi1.getARGB(rgbim1,0,width,0,row, width,1);                       bi2.getARGB(rgbim2,0,width,0,row, width,1); 
    
                           for (int col = 0; col < width; col++)                  {                              int rgb1 = rgbim1[col];                                int r1 = (rgb1 >> 16) & 255;                           int g1 = (rgb1 >> 8) & 255;                            int b1 = rgb1 & 255;
    
                              int rgb2 = rgbim2[col];                                int r2 = (rgb2 >> 16) & 255;                           int g2 = (rgb2 >> 8) & 255;                            int b2 = rgb2 & 255;
    
                              int r3 = (int) (r1 * weight + r2 * (1.0 - weight));                            int g3 = (int) (g1 * weight + g2 * (1.0 - weight));                            int b3 = (int) (b1 * weight + b2 * (1.0 - weight));                            rgbim3[col] = (r3 << 16) | (g3 << 8) | b3;                     }
    
                         bi3.setARGB(rgbim3, 0, width, 0,  row,width, 1);
    
                    }
    
                 return bi3;    }
    

    The weight of the arg is a value from 1 to 100.

    For reference, the full plain java source

    /* * To change this template, choose Tools | Templates * and open the template in the editor. */
    
    package imagetest;
    
    /** * * @author COMPUTER */// Blender1.java
    
    import java.awt.*;import java.awt.image.*;
    
    import javax.swing.*;import javax.swing.event.*;
    
    /** * This class describes and contains the entry point to an application that * demonstrates the blending transition. */
    
    public class Blender1 extends JFrame{  /**    *     */   private static final long serialVersionUID = 1L;
    
        /**    * Construct Blender1 GUI.     */
    
     public Blender1() {     super("Blender #1");      setDefaultCloseOperation(EXIT_ON_CLOSE);
    
            // Load first image from JAR file and draw image into a buffered image.
    
         ImageIcon ii1 = new ImageIcon(getClass().getResource("x.png"));       final BufferedImage bi1;      bi1 = new BufferedImage(ii1.getIconWidth(), ii1.getIconHeight(),              BufferedImage.TYPE_INT_RGB);      Graphics2D g2d = bi1.createGraphics();        int h = ii1.getImage().getHeight(null);       System.out.println("Blender1.Blender1()--------> height :" + h);       g2d.drawImage(ii1.getImage(), 0, 0, null);        g2d.dispose();
    
          // Load second image from JAR file and draw image into a buffered image.
    
            ImageIcon ii2 = new ImageIcon(getClass().getResource("y.png"));       final BufferedImage bi2;      bi2 = new BufferedImage(ii2.getIconWidth(), ii2.getIconHeight(),              BufferedImage.TYPE_INT_RGB);      g2d = bi2.createGraphics();       int h2 = ii2.getImage().getHeight(null);      System.out.println("Blender1.Blender1()--------> height :" + h2);      g2d.drawImage(ii2.getImage(), 0, 0, null);        g2d.dispose();
    
          // Create an image panel capable of displaying entire image. The widths       // of both images and the heights of both images must be identical.
    
         final ImagePanel ip = new ImagePanel();       ip.setPreferredSize(new Dimension(ii1.getIconWidth(), ii1             .getIconHeight()));       getContentPane().add(ip, BorderLayout.NORTH);
    
           // Create a slider for selecting the blending percentage: 100% means      // show all of first image; 0% means show all of second image.
    
          final JSlider slider = new JSlider(JSlider.HORIZONTAL, 0, 100, 100);      slider.setMinorTickSpacing(5);        slider.setMajorTickSpacing(10);       slider.setPaintTicks(true);       slider.setPaintLabels(true);      slider.setLabelTable(slider.createStandardLabels(10));        slider.setInverted(true);     ChangeListener cl;        cl = new ChangeListener()     {         public void stateChanged( ChangeEvent e )         {             // Each time the user adjusts the slider, obtain the new              // blend percentage value and use it to blend the images.
    
                   int value = slider.getValue();                ip.setImage(blend(bi1, bi2, value / 100.0));          }     };        slider.addChangeListener(cl);     getContentPane().add(slider, BorderLayout.SOUTH);
    
           // Display the first image, which corresponds to a 100% blend     // percentage.
    
          ip.setImage(bi1);
    
           pack();       setVisible(true); }
    
       /**    * Blend the contents of two BufferedImages according to a specified weight.   *     * @param bi1  *            first BufferedImage  * @param bi2  *            second BufferedImage     * @param weight   *            the fractional percentage of the first image to keep     *     * @return new BufferedImage containing blended contents of BufferedImage  *         arguments   */
    
     public BufferedImage blend( BufferedImage bi1, BufferedImage bi2,         double weight )   {     if (bi1 == null)          throw new NullPointerException("bi1 is null");
    
          if (bi2 == null)          throw new NullPointerException("bi2 is null");
    
          int width = bi1.getWidth();       if (width != bi2.getWidth())          throw new IllegalArgumentException("widths not equal");
    
         int height = bi1.getHeight();     if (height != bi2.getHeight())
    
              throw new IllegalArgumentException("heights not equal");
    
            BufferedImage bi3 = new BufferedImage(width, height,              BufferedImage.TYPE_INT_RGB);      int[] rgbim1 = new int[width];        int[] rgbim2 = new int[width];        int[] rgbim3 = new int[width];
    
          for (int row = 0; row < height; row++)     {         bi1.getRGB(0, row, width, 1, rgbim1, 0, width);           bi2.getRGB(0, row, width, 1, rgbim2, 0, width);
    
             for (int col = 0; col < width; col++)          {             int rgb1 = rgbim1[col];               int r1 = (rgb1 >> 16) & 255;                int g1 = (rgb1 >> 8) & 255;             int b1 = rgb1 & 255;
    
                    int rgb2 = rgbim2[col];               int r2 = (rgb2 >> 16) & 255;                int g2 = (rgb2 >> 8) & 255;             int b2 = rgb2 & 255;
    
                    int r3 = (int) (r1 * weight + r2 * (1.0 - weight));               int g3 = (int) (g1 * weight + g2 * (1.0 - weight));               int b3 = (int) (b1 * weight + b2 * (1.0 - weight));               rgbim3[col] = (r3 << 16) | (g3 << 8) | b3;            }
    
               bi3.setRGB(0, row, width, 1, rgbim3, 0, width);       }
    
           return bi3;   }
    
       /**    * Application entry point.    *     * @param args     *            array of command-line arguments  */
    
     public static void main( String[] args )  {     Runnable r = new Runnable()       {         public void run()         {             // Create Blender1's GUI on the event-dispatching             // thread.
    
                  new Blender1();           }     };        EventQueue.invokeLater(r);    }}
    
    /** * This class describes a panel that displays a BufferedImage's contents. */
    
    class ImagePanel extends JPanel{ /**    *     */   private static final long serialVersionUID = 4977990666209629996L;    private BufferedImage bi;
    
       /**    * Specify and paint a new BufferedImage.  *     * @param bi   *            BufferedImage whose contents are to be painted   */
    
     void setImage( BufferedImage bi ) {     this.bi = bi;     repaint();    }
    
       /**    * Paint the image panel.  *     * @param g    *            graphics context used to paint the contents of the current   *            BufferedImage    */
    
     public void paintComponent( Graphics g )  {     if (bi != null)       {         Graphics2D g2d = (Graphics2D) g;          g2d.drawImage(bi, null, 0, 0);        } }}
    

    Full java BB source

    /* * ImageScreen.java * * © ,  * Confidential and proprietary. */
    
    package src;
    
    /** *  */
    
    import java.io.OutputStream;import javax.microedition.io.Connector;import javax.microedition.io.file.FileConnection;import net.rim.device.api.system.Bitmap;import net.rim.device.api.ui.Field;import net.rim.device.api.ui.FieldChangeListener;import net.rim.device.api.ui.UiApplication;import net.rim.device.api.ui.component.BitmapField;import net.rim.device.api.ui.component.ButtonField;import net.rim.device.api.ui.component.Dialog;import net.rim.device.api.ui.component.LabelField;import net.rim.device.api.ui.container.HorizontalFieldManager;import net.rim.device.api.ui.container.MainScreen;import net.rim.device.api.ui.component.GaugeField;/** * The main screen to display an image taken from the camera demo. */public final class ImageScreen extends MainScreen{    /** The down-scaling ratio applied to the snapshot Bitmap */    private static final int IMAGE_SCALING = 7;
    
        /** The base file name used to store pictures */    private static final String FILE_NAME = System.getProperty("fileconn.dir.photos") + "IMAGE";
    
        /** The extension of the pictures to be saved */    private static final String EXTENSION = ".bmp";
    
        /** A counter for the number of snapshots taken */    private static int _counter;    Bitmap image1,image2; BitmapField imageField;     /** A reference to the current screen for listeners */    private ImageScreen _imageScreen;
    
       /**    * Constructor    * @param raw A byte array representing an image    */    public ImageScreen( final byte[] raw1,final byte[] raw2 )    {        // A reference to this object, to be used in listeners        _imageScreen = this;
    
            setTitle("Blend and Save");
    
            // Convert the byte array to a Bitmap image        image1 = Bitmap.createBitmapFromBytes( raw1, 0, -1, 1 );        image2 = Bitmap.createBitmapFromBytes( raw2, 0, -1, 1 );        // Create two field managers to center the screen's contents        HorizontalFieldManager hfm1 = new HorizontalFieldManager( Field.FIELD_HCENTER );        HorizontalFieldManager hfm2 = new HorizontalFieldManager( Field.FIELD_HCENTER );        HorizontalFieldManager hfm3 = new HorizontalFieldManager( Field.FIELD_HCENTER );        // Create the field that contains the image//blend(image1, image2, 50/ 100.0)        imageField = new BitmapField(blend(image1, image2, 50/ 100.0) ){
    
               public int getPreferredWidth(){ return 250;}           public int getPreferredHeight(){ return 150;}
    
             };
    
            hfm1.add( imageField ); 
    
            GaugeField scroller = new GaugeField("Adjust (alt + < >)",0,100,50,Field.EDITABLE | Field.FOCUSABLE);        //scroller.setBackground( net.rim.device.api.ui.decor.BackgroundFactory.createSolidBackground(0x00000000));          scroller.setChangeListener( new GaugeFieldListener() );         hfm2.add(scroller);         // Create the SAVE button which returns the user to the main camera        // screen and saves the picture as a file.        ButtonField photoButton = new ButtonField( "Save" );        photoButton.setChangeListener( new SaveListener(raw1,raw2) );        hfm3.add(photoButton);
    
            // Create the CANCEL button which returns the user to the main camera        // screen without saving the picture.        ButtonField cancelButton = new ButtonField( "Cancel" );        cancelButton.setChangeListener( new CancelListener() );        hfm3.add(cancelButton);
    
            // Add the field managers to the screen        add( hfm1 );        add( hfm2 );        add( hfm3 );scroller.setFocus();//scroller.setValue(50);    }    public Bitmap blend( Bitmap bi1, Bitmap  bi2,                      double weight )        {
    
                  if (bi1 == null)                       throw new NullPointerException("bi1 is null");
    
                    if (bi2 == null)                       throw new NullPointerException("bi2 is null");
    
                    int width = bi1.getWidth();            if (width != bi2.getWidth())                   throw new IllegalArgumentException("widths not equal");
    
                   int height = bi1.getHeight();          if (height != bi2.getHeight())
    
                            throw new IllegalArgumentException("heights not equal");
    
             Bitmap bi3 = new Bitmap(width, height);         int[] rgbim1 = new int[width];         int[] rgbim2 = new int[width];         int[] rgbim3 = new int[width];
    
                    for (int row = 0; row < height; row++)         {            // bi -> int startX, int startY, int w, int h, int[] rgbArray, int offset, int scansize) 
    
                 // bit - > int[] argbData, int offset, int scanLength, int x, int y, int width, int height) 
    
                           bi1.getARGB(rgbim1,0,width,0,row, width,1);//  row, width, 1, , 0, width);                       bi2.getARGB(rgbim2,0,width,0,row, width,1); 
    
                           //bi1.getRGB(0, row, width, 1, rgbim1, 0, width);                       //bi2.getRGB(0, row, width, 1, rgbim2, 0, width);
    
                           for (int col = 0; col < width; col++)                  {                              int rgb1 = rgbim1[col];                                int r1 = (rgb1 >> 16) & 255;                           int g1 = (rgb1 >> 8) & 255;                            int b1 = rgb1 & 255;
    
                              int rgb2 = rgbim2[col];                                int r2 = (rgb2 >> 16) & 255;                           int g2 = (rgb2 >> 8) & 255;                            int b2 = rgb2 & 255;
    
                              int r3 = (int) (r1 * weight + r2 * (1.0 - weight));                            int g3 = (int) (g1 * weight + g2 * (1.0 - weight));                            int b3 = (int) (b1 * weight + b2 * (1.0 - weight));                            rgbim3[col] = (r3 << 16) | (g3 << 8) | b3;                     }                    //bi -> int startX, int startY, int w, int h, int[] rgbArray, int offset, int scansize)                     //bit -> (int[] data, int offset, int scanLength, int left, int top, int width, int height)                      bi3.setARGB(rgbim3, 0, width, 0,  row,width, 1);
    
                        // bi3.setRGB(0, row, width, 1, rgbim3, 0, width);                }
    
                 return bi3;    }
    
       /**    * Handles trackball click events    * @see net.rim.device.api.ui.Screen#invokeAction(int)    */       protected boolean invokeAction(int action)    {        boolean handled = super.invokeAction(action); 
    
            if(!handled)        {            switch(action)            {                case ACTION_INVOKE: // Trackball click.                {                                 return true;                }            }        }                return handled;              }
    
     /**    * A listener used for the "Save" button    */    private class GaugeFieldListener implements FieldChangeListener    {        public void fieldChanged(Field field, int context)        {          int value =  ((GaugeField)field).getValue(); if (value==0){return;}          imageField.setBitmap( blend(image1, image2, value/ 100.0) );          ((GaugeField)field).setLabel("Adjust (alt + < >)"+value);        }    }   /**    * A listener used for the "Save" button    */    private class SaveListener implements FieldChangeListener    {        /** A byte array representing an image */        private byte[] _raw1,_raw2;
    
           /**        * Constructor.        * @param raw A byte array representing an image        */        SaveListener(byte[] raw1,byte[] raw2)        {            _raw1 = raw1;            _raw2 = raw2;        }
    
           /**        * Saves the image as a file in the BlackBerry filesystem        */        public void fieldChanged(Field field, int context)        {            try            {                       // Create the connection to a file that may or                // may not exist.                FileConnection file = (FileConnection)Connector.open( FILE_NAME + _counter + EXTENSION );
    
                    // If the file exists, increment the counter until we find                // one that hasn't been created yet.                while( file.exists() )                {                    file.close();                    ++_counter;                    file = (FileConnection)Connector.open( FILE_NAME + _counter + EXTENSION );                }
    
                    // We know the file doesn't exist yet, so create it                file.create();
    
                    // Write the image to the file                OutputStream out = file.openOutputStream();                out.write(_raw1);
    
                    // Close the connections                out.close();                file.close();            }            catch(Exception e)            {                Dialog.alert( "ERROR " + e.getClass() + ":  " + e.getMessage() );            }
    
                // Inform the user where the file has been saved            Dialog.inform( "Saved to " + FILE_NAME + _counter + EXTENSION );
    
                // Increment the image counter            ++_counter;
    
                // Return to the main camera screen            UiApplication.getUiApplication().popScreen( _imageScreen );        }    }
    
       /**    * A listener used for the "Cancel" button    */    private class CancelListener implements FieldChangeListener    {       /**        * Return to the main camera screen        */        public void fieldChanged(Field field, int context)        {            UiApplication.getUiApplication().popScreen( _imageScreen );        }    }}
    

    Yes, your original code:

    for (int col = 0; col < width; col++){int rgb1 = rgbim1[col];int r1 = (rgb1 >> 16) & 255;int g1 = (rgb1 >> 8) & 255;int b1 = rgb1 & 255;
    
    int rgb2 = rgbim2[col];int r2 = (rgb2 >> 16) & 255;int g2 = (rgb2 >> 8) & 255;int b2 = rgb2 & 255;
    
    int r3 = (int) (r1 * weight + r2 * (1.0 - weight));int g3 = (int) (g1 * weight + g2 * (1.0 - weight));int b3 = (int) (b1 * weight + b2 * (1.0 - weight));rgbim3[col] = (r3 << 16) | (g3 << 8) | b3;}
    

    Labour Code:

    for (int col = 0; col < width; col++)
    {
    int rgb1 = rgbim1[col];
    int a1 = (rgb1 >> 24) & 255;
    int r1 = (rgb1 >> 16) & 255;
    int g1 = (rgb1 >> 8) & 255;
    int b1 = rgb1 & 255;
    
    int rgb2 = rgbim2[col];
    int a2 = (rgb2 >> 24) & 255;
    int r2 = (rgb2 >> 16) & 255;
    int g2 = (rgb2 >> 8) & 255;
    int b2 = rgb2 & 255;
    
    int a3 = (int) (a1 * weight + a2 * (1.0 - weight));
    int r3 = (int) (r1 * weight + r2 * (1.0 - weight));
    int g3 = (int) (g1 * weight + g2 * (1.0 - weight));
    int b3 = (int) (b1 * weight + b2 * (1.0 - weight));
    rgbim3[col] = (a3 << 24) | (r3 << 16) | (g3 << 8) | b3;
    }
    
  • Question on "Scale to the size of the image by default"

    Hello

    I put my sequence of 1080 p at 25 fps.

    However, my source material are a mixture of 4K video and also extracts of 720 p and also some pictures.

    I noticed that if I uncheck the "Default scale to the size of the image" box, each time, I put the clips imported into the timeline, it's too big and I have to go the effect controls panel to reduce the size. It is very time consuming especially if I have a lot of 4K video clips on the timeline.

    According to me, that if I check the box of 'Default scale to the size of the image', when I put the 4K video on the timeline, it fits very well. My question is when I enlarge him to say the Pan effect, of the resolution will be downgraded compared to when I do not check the "default scale to the size of the image" box?

    Thank you

    If you use the scale to the size of the image, either in manual application or by ticking the "default image size scale" in preferences, your clips will be scaled down (in the case of the 4 K sequence) or upwards (in the case of the sequence of 720 p). In both cases, the clips on the timeline for reference the original source material, so all of the pixel content present in the 4K source, for example, is always available for you to resize.

    You will notice, however, that if you open Motion and see the scale component - it will read 100% because - the clip on the timeline has indeed been reduced to sequence frame size - making it difficult to * how the clip was be reduced or enlarged as the balance indicates the same.

    A better way to edit the clips to the timeline the clip on the timeline, and then select and right click or control click and choose the size of the image, the value and now scale will reflect the percentage reduction or expansion, so you can see how much you can resize until you start to lose resolution.

    Unfortunately, the set to the size of the image is not yet available as a default, you will need to use it manually.

    MtD

Maybe you are looking for