CSJ2K.j2k.codestream.reader.HeaderDecoder.getTilingOrigin C# (CSharp) Метод

getTilingOrigin() публичный Метод

Returns the tiling origin, referred to as '(Px,Py)' in the 'ImgData' interface.
public getTilingOrigin ( Coord co ) : Coord
co Coord If not null this object is used to return the information. If /// null a new one is created and returned. /// ///
Результат Coord
        public Coord getTilingOrigin(Coord co)
        {
            if (co != null)
            {
                co.x = hi.sizValue.xt0siz;
                co.y = hi.sizValue.yt0siz;
                return co;
            }
            else
            {
                return new Coord(hi.sizValue.xt0siz, hi.sizValue.yt0siz);
            }
        }

Usage Example

Пример #1
0
		/// <summary> Initializes members of this class. This constructor takes a
		/// HeaderDecoder object. This object must be initialized by the
		/// constructor of the implementing class from the header of the bit
		/// stream.
		/// 
		/// </summary>
		/// <param name="hd">The decoded header of the bit stream from where to initialize
		/// the values.
		/// 
		/// </param>
		/// <param name="decSpec">The decoder specifications
		/// 
		/// </param>
		protected internal BitstreamReaderAgent(HeaderDecoder hd, DecoderSpecs decSpec)
		{
			Coord co;
			//int i, j, max;
			
			this.decSpec = decSpec;
			this.hd = hd;
			
			// Number of components
			nc = hd.NumComps;
			offX = new int[nc];
			offY = new int[nc];
			culx = new int[nc];
			culy = new int[nc];
			
			// Image size and origin
			imgW = hd.ImgWidth;
			imgH = hd.ImgHeight;
			ax = hd.ImgULX;
			ay = hd.ImgULY;
			
			// Tiles
			co = hd.getTilingOrigin(null);
			px = co.x;
			py = co.y;
			ntW = hd.NomTileWidth;
			ntH = hd.NomTileHeight;
			ntX = (ax + imgW - px + ntW - 1) / ntW;
			ntY = (ay + imgH - py + ntH - 1) / ntH;
			nt = ntX * ntY;
		}