Package kdu_jni

Examples of kdu_jni.Kdu_dims


      else
        channels.Configure(codestream);
      int ref_component = channels.Get_source_component(0);
      int minLevels = codestream.Get_min_dwt_levels();
      int minLayers= codestream.Get_max_tile_layers();
      Kdu_dims image_dims = new Kdu_dims();
      codestream.Get_dims(ref_component, image_dims);
      Kdu_coords imageSize = image_dims.Access_size();
     
      r.setWidth(imageSize.Get_x());
      r.setHeight(imageSize.Get_y());
      r.setDWTLevels(minLevels);
View Full Code Here


      if (raw_src != null)
                compositor.Create(raw_src);
      else
                compositor.Create(wrapped_src);

            Kdu_dims imageDimensions = new Kdu_dims();
            compositor.Get_total_composition_dims(imageDimensions);
            Kdu_coords imageSize = imageDimensions.Access_size();
            Kdu_coords imagePosition = imageDimensions.Access_pos();

      if (useleftDouble)
                left = imagePosition.Get_x() + (int) Math.round(leftDouble * imageSize.Get_x());
      if (usetopDouble)
                top = imagePosition.Get_y() + (int) Math.round(topDouble * imageSize.Get_y());
      if (useheightDouble)
                height = (int) Math.round(heightDouble * imageSize.Get_y());
      if (usewidthDouble)
                width = (int) Math.round(widthDouble * imageSize.Get_x());

            if (useRegion) {
                imageSize.Set_x(width);
                imageSize.Set_y(height);
                imagePosition.Set_x(left);
                imagePosition.Set_y(top);
            }

            int reduce = 1 << params.getLevelReductionFactor();
            imageSize.Set_x(imageSize.Get_x());
            imageSize.Set_y(imageSize.Get_y());
            imagePosition.Set_x(imagePosition.Get_x() / reduce - (1 / reduce - 1) / 2);
            imagePosition.Set_y(imagePosition.Get_y() / reduce - (1 / reduce - 1) / 2);

            Kdu_dims viewDims = new Kdu_dims();
            viewDims.Assign(imageDimensions);
            viewDims.Access_size().Set_x(imageSize.Get_x());
            viewDims.Access_size().Set_y(imageSize.Get_y());
            compositor.Add_compositing_layer(0, viewDims, viewDims);

      if (params.getRotationDegree() == 90)
                compositor.Set_scale(true, false, true, 1.0F);
      else if (params.getRotationDegree() == 180)
                compositor.Set_scale(false, true, true, 1.0F);
      else if (params.getRotationDegree() == 270)
                compositor.Set_scale(true, true, false, 1.0F);
      else
                compositor.Set_scale(false, false, false, 1.0F);

            compositor.Get_total_composition_dims(viewDims);
            Kdu_coords viewSize = viewDims.Access_size();
            compositor.Set_buffer_surface(viewDims);

            int[] imgBuffer = new int[viewSize.Get_x() * viewSize.Get_y()];
            Kdu_compositor_buf compositorBuffer = compositor.Get_composition_buffer(viewDims);
            int regionBufferSize = 0;
            int[] kduBuffer = null;
            Kdu_dims newRegion = new Kdu_dims();
            while (compositor.Process(100000, newRegion)) {
                Kdu_coords newOffset = newRegion.Access_pos();
                Kdu_coords newSize = newRegion.Access_size();
                newOffset.Subtract(viewDims.Access_pos());

                int newPixels = newSize.Get_x() * newSize.Get_y();
        if (newPixels == 0)
                    continue;
View Full Code Here

                channels.Configure(inputSource, false);
      else
                channels.Configure(codestream);
            int ref_component = channels.Get_source_component(0);
            Kdu_coords ref_expansion = getReferenceExpansion(ref_component, channels, codestream);
            Kdu_dims image_dims = new Kdu_dims();
            codestream.Get_dims(ref_component, image_dims);
            Kdu_coords imageSize = image_dims.Access_size();
            Kdu_coords imagePosition = image_dims.Access_pos();

      if (useleftDouble)
                left = imagePosition.Get_x() + (int) Math.round(leftDouble * imageSize.Get_x());
      if (usetopDouble)
                top = imagePosition.Get_y() + (int) Math.round(topDouble * imageSize.Get_y());
      if (useheightDouble)
                height = (int) Math.round(heightDouble * imageSize.Get_y());
      if (usewidthDouble)
                width = (int) Math.round(widthDouble * imageSize.Get_x());

            if (useRegion) {
                imageSize.Set_x(width);
                imageSize.Set_y(height);
                imagePosition.Set_x(left);
                imagePosition.Set_y(top);
            }

            int reduce = 1 << params.getLevelReductionFactor();
            imageSize.Set_x(imageSize.Get_x() * ref_expansion.Get_x());
            imageSize.Set_y(imageSize.Get_y() * ref_expansion.Get_y());
            imagePosition.Set_x(imagePosition.Get_x() * ref_expansion.Get_x() / reduce - ((ref_expansion.Get_x() / reduce - 1) / 2));
            imagePosition.Set_y(imagePosition.Get_y() * ref_expansion.Get_y() / reduce - ((ref_expansion.Get_y() / reduce - 1) / 2));

            Kdu_dims view_dims = new Kdu_dims();
            view_dims.Assign(image_dims);
            view_dims.Access_size().Set_x(imageSize.Get_x());
            view_dims.Access_size().Set_y(imageSize.Get_y());

            int region_buf_size = imageSize.Get_x() * imageSize.Get_y();
            int[] region_buf = new int[region_buf_size];
            Kdu_region_decompressor decompressor = new Kdu_region_decompressor();
            decompressor.Start(codestream, channels, -1, params.getLevelReductionFactor(), 16384, image_dims,
                    ref_expansion, new Kdu_coords(1, 1), false, Kdu_global.KDU_WANT_OUTPUT_COMPONENTS);

            Kdu_dims new_region = new Kdu_dims();
            Kdu_dims incomplete_region = new Kdu_dims();
            Kdu_coords viewSize = view_dims.Access_size();
            incomplete_region.Assign(image_dims);

            int[] imgBuffer = new int[viewSize.Get_x() * viewSize.Get_y()];
            int[] kduBuffer = null;
            while (decompressor.Process(region_buf, image_dims.Access_pos(), 0, 0, region_buf_size, incomplete_region, new_region)) {
                Kdu_coords newOffset = new_region.Access_pos();
View Full Code Here

            int minLevels = codestream.Get_min_dwt_levels();
            int depth = codestream.Get_bit_depth(ref_component);
            int colors = codestream.Get_num_components();
            int[] frames = new int[1];
            inputSource.Count_compositing_layers(frames);
            Kdu_dims image_dims = new Kdu_dims();
            codestream.Get_dims(ref_component, image_dims);
            Kdu_coords imageSize = image_dims.Access_size();

            r.setWidth(imageSize.Get_x());
            r.setHeight(imageSize.Get_y());
            r.setDWTLevels(minLevels);
            int djatokaLevels = ImageProcessingUtils.getLevelCount(r.getWidth(), r.getHeight());
View Full Code Here

                channels.Configure(codestream);
            }
            int ref_component = channels.Get_source_component(0);
            int minLevels = codestream.Get_min_dwt_levels();
            int minLayers = codestream.Get_max_tile_layers();
            Kdu_dims image_dims = new Kdu_dims();
            codestream.Get_dims(ref_component, image_dims);
            Kdu_coords imageSize = image_dims.Access_size();

            r.setWidth(imageSize.Get_x());
            r.setHeight(imageSize.Get_y());
            r.setDWTLevels(minLevels);
View Full Code Here

            int minLevels = codestream.Get_min_dwt_levels();
            int depth = codestream.Get_bit_depth(ref_component);
            int colors = codestream.Get_num_components();
            int[] frames = new int[1];
            inputSource.Count_compositing_layers(frames);
            Kdu_dims image_dims = new Kdu_dims();
            codestream.Get_dims(ref_component, image_dims);
            Kdu_coords imageSize = image_dims.Access_size();

            r.setWidth(imageSize.Get_x());
            r.setHeight(imageSize.Get_y());
            r.setDWTLevels(minLevels);
View Full Code Here

                compositor.Create(raw_src);
            } else {
                compositor.Create(wrapped_src);
            }

            Kdu_dims imageDimensions = new Kdu_dims();
            compositor.Get_total_composition_dims(imageDimensions);
            Kdu_coords imageSize = imageDimensions.Access_size();
            Kdu_coords imagePosition = imageDimensions.Access_pos();

            if (useleftDouble) {
                left = imagePosition.Get_x() + (int) Math.round(leftDouble * imageSize.Get_x());
            }
            if (usetopDouble) {
                top = imagePosition.Get_y() + (int) Math.round(topDouble * imageSize.Get_y());
            }
            if (useheightDouble) {
                height = (int) Math.round(heightDouble * imageSize.Get_y());
            }
            if (usewidthDouble) {
                width = (int) Math.round(widthDouble * imageSize.Get_x());
            }

            if (useRegion) {
                imageSize.Set_x(width);
                imageSize.Set_y(height);
                imagePosition.Set_x(left);
                imagePosition.Set_y(top);
            }

            int reduce = 1 << params.getLevelReductionFactor();
            imageSize.Set_x(imageSize.Get_x());
            imageSize.Set_y(imageSize.Get_y());
            imagePosition.Set_x(imagePosition.Get_x() / reduce - (1 / reduce - 1) / 2);
            imagePosition.Set_y(imagePosition.Get_y() / reduce - (1 / reduce - 1) / 2);

            Kdu_dims viewDims = new Kdu_dims();
            viewDims.Assign(imageDimensions);
            viewDims.Access_size().Set_x(imageSize.Get_x());
            viewDims.Access_size().Set_y(imageSize.Get_y());
            compositor.Add_compositing_layer(0, viewDims, viewDims);

            if (params.getRotationDegree() == 90) {
                compositor.Set_scale(true, false, true, 1.0F);
            } else if (params.getRotationDegree() == 180) {
                compositor.Set_scale(false, true, true, 1.0F);
            } else if (params.getRotationDegree() == 270) {
                compositor.Set_scale(true, true, false, 1.0F);
            } else {
                compositor.Set_scale(false, false, false, 1.0F);
            }

            compositor.Get_total_composition_dims(viewDims);
            Kdu_coords viewSize = viewDims.Access_size();
            compositor.Set_buffer_surface(viewDims);

            int[] imgBuffer = new int[viewSize.Get_x() * viewSize.Get_y()];
            Kdu_compositor_buf compositorBuffer = compositor.Get_composition_buffer(viewDims);
            int regionBufferSize = 0;
            int[] kduBuffer = null;
            Kdu_dims newRegion = new Kdu_dims();
            while (compositor.Process(100000, newRegion)) {
                Kdu_coords newOffset = newRegion.Access_pos();
                Kdu_coords newSize = newRegion.Access_size();
                newOffset.Subtract(viewDims.Access_pos());

                int newPixels = newSize.Get_x() * newSize.Get_y();
                if (newPixels == 0) {
                    continue;
View Full Code Here

            } else {
                channels.Configure(codestream);
            }
            int ref_component = channels.Get_source_component(0);
            Kdu_coords ref_expansion = getReferenceExpansion(ref_component, channels, codestream);
            Kdu_dims image_dims = new Kdu_dims();
            codestream.Get_dims(ref_component, image_dims);
            Kdu_coords imageSize = image_dims.Access_size();
            Kdu_coords imagePosition = image_dims.Access_pos();

            if (useleftDouble) {
                left = imagePosition.Get_x() + (int) Math.round(leftDouble * imageSize.Get_x());
            }
            if (usetopDouble) {
                top = imagePosition.Get_y() + (int) Math.round(topDouble * imageSize.Get_y());
            }
            if (useheightDouble) {
                height = (int) Math.round(heightDouble * imageSize.Get_y());
            }
            if (usewidthDouble) {
                width = (int) Math.round(widthDouble * imageSize.Get_x());
            }

            if (useRegion) {
                imageSize.Set_x(width);
                imageSize.Set_y(height);
                imagePosition.Set_x(left);
                imagePosition.Set_y(top);
            }

            int reduce = 1 << params.getLevelReductionFactor();
            imageSize.Set_x(imageSize.Get_x() * ref_expansion.Get_x());
            imageSize.Set_y(imageSize.Get_y() * ref_expansion.Get_y());
            imagePosition.Set_x(imagePosition.Get_x() * ref_expansion.Get_x() / reduce -
                    ((ref_expansion.Get_x() / reduce - 1) / 2));
            imagePosition.Set_y(imagePosition.Get_y() * ref_expansion.Get_y() / reduce -
                    ((ref_expansion.Get_y() / reduce - 1) / 2));

            Kdu_dims view_dims = new Kdu_dims();
            view_dims.Assign(image_dims);
            view_dims.Access_size().Set_x(imageSize.Get_x());
            view_dims.Access_size().Set_y(imageSize.Get_y());

            int region_buf_size = imageSize.Get_x() * imageSize.Get_y();
            int[] region_buf = new int[region_buf_size];
            Kdu_region_decompressor decompressor = new Kdu_region_decompressor();
            decompressor.Start(codestream, channels, -1, params.getLevelReductionFactor(), 16384, image_dims,
                    ref_expansion, new Kdu_coords(1, 1), false, Kdu_global.KDU_WANT_OUTPUT_COMPONENTS);

            Kdu_dims new_region = new Kdu_dims();
            Kdu_dims incomplete_region = new Kdu_dims();
            Kdu_coords viewSize = view_dims.Access_size();
            incomplete_region.Assign(image_dims);

            int[] imgBuffer = new int[viewSize.Get_x() * viewSize.Get_y()];
            int[] kduBuffer = null;
            while (decompressor.Process(region_buf, image_dims.Access_pos(), 0, 0, region_buf_size,
                    incomplete_region, new_region)) {
View Full Code Here

TOP

Related Classes of kdu_jni.Kdu_dims

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.