public IEnumerable <DataBufferUint> GetUintEnumerator() { // This iterator works from the bottom of the stack // upwards, just like Symbian OS/ARM stack allocation // // // Count = 12 // // [0123][4567][89AB] // int count = iData.Count; // for (int i = count - 4; i >= 0; i -= 4) { DataBufferByte e0 = iData[i + 0]; DataBufferByte e1 = iData[i + 1]; DataBufferByte e2 = iData[i + 2]; DataBufferByte e3 = iData[i + 3]; // uint value = Combine(e0, e1, e2, e3); DataBufferUint ret = new DataBufferUint(value, e0.Address); yield return(ret); } }
public IEnumerable <DataBufferByte> GetByteEnumerator() { int count = iData.Count; for (int i = count - 1; i >= 0; i--) { DataBufferByte entry = iData[i]; yield return(entry); } }
public void Add(byte aByte) { uint address = 0; // if (Count > 0) { address = (Last.Address - AddressOffset) + 1; } // DataBufferByte entry = new DataBufferByte(aByte, address); Add(entry); }
public override string ToString() { string ret = string.Empty; // List <byte> rawBytes = GetRawBytes(); if (rawBytes.Count > 0) { DataBufferByte firstByte = First; uint startingAddress = firstByte.Address; // ret = SymbianUtils.Utilities.RawByteUtility.ConvertDataToText(rawBytes, true, ref startingAddress); } // return(ret); }
public void Prime(IEnumerable <byte> aBytes, uint aAddressOfFirstByte) { iDataBuffer.Clear(); // Set the starting address iDataBuffer.AddressOffset = aAddressOfFirstByte; // Read bytes uint offset = 0; foreach (byte b in aBytes) { DataBufferByte entry = new DataBufferByte(b, offset++); iDataBuffer.Add(entry); } Primed = true; }
/// <summary> /// Creates a <code>DataBuffer</code> that corresponds to this /// <code>MultiPixelPackedSampleModel</code>. The /// <code>DataBuffer</code> object's data type and size /// is consistent with this <code>MultiPixelPackedSampleModel</code>. /// The <code>DataBuffer</code> has a single bank. </summary> /// <returns> a <code>DataBuffer</code> with the same data type and /// size as this <code>MultiPixelPackedSampleModel</code>. </returns> public override DataBuffer CreateDataBuffer() { DataBuffer dataBuffer = null; int size = (int)ScanlineStride_Renamed * Height_Renamed; switch (DataType_Renamed) { case DataBuffer.TYPE_BYTE: dataBuffer = new DataBufferByte(size + (DataBitOffset_Renamed + 7) / 8); break; case DataBuffer.TYPE_USHORT: dataBuffer = new DataBufferUShort(size + (DataBitOffset_Renamed + 15) / 16); break; case DataBuffer.TYPE_INT: dataBuffer = new DataBufferInt(size + (DataBitOffset_Renamed + 31) / 32); break; } return(dataBuffer); }
/// <summary> /// Creates a DataBuffer that corresponds to this /// SinglePixelPackedSampleModel. The DataBuffer's data type and size /// will be consistent with this SinglePixelPackedSampleModel. The /// DataBuffer will have a single bank. /// </summary> public override DataBuffer CreateDataBuffer() { DataBuffer dataBuffer = null; int size = (int)BufferSize; switch (DataType_Renamed) { case DataBuffer.TYPE_BYTE: dataBuffer = new DataBufferByte(size); break; case DataBuffer.TYPE_USHORT: dataBuffer = new DataBufferUShort(size); break; case DataBuffer.TYPE_INT: dataBuffer = new DataBufferInt(size); break; } return(dataBuffer); }
/// <summary> /// Creates a DataBuffer that corresponds to this BandedSampleModel, /// The DataBuffer's data type, number of banks, and size /// will be consistent with this BandedSampleModel. </summary> /// <exception cref="IllegalArgumentException"> if <code>dataType</code> is not /// one of the supported types. </exception> public override DataBuffer CreateDataBuffer() { DataBuffer dataBuffer = null; int size = ScanlineStride_Renamed * Height_Renamed; switch (DataType_Renamed) { case DataBuffer.TYPE_BYTE: dataBuffer = new DataBufferByte(size, NumBanks); break; case DataBuffer.TYPE_USHORT: dataBuffer = new DataBufferUShort(size, NumBanks); break; case DataBuffer.TYPE_SHORT: dataBuffer = new DataBufferShort(size, NumBanks); break; case DataBuffer.TYPE_INT: dataBuffer = new DataBufferInt(size, NumBanks); break; case DataBuffer.TYPE_FLOAT: dataBuffer = new DataBufferFloat(size, NumBanks); break; case DataBuffer.TYPE_DOUBLE: dataBuffer = new DataBufferDouble(size, NumBanks); break; default: throw new IllegalArgumentException("dataType is not one " + "of the supported types."); } return(dataBuffer); }
private uint ExtractDataSourceEntryFromMatch(Match aMatch) { System.Diagnostics.Debug.Assert(aMatch.Success); uint address = 0; uint nextExpectedAddress = 0; if (iDataBuffer.Count > 0) { nextExpectedAddress = iDataBuffer.Last.Address + 1; } // GroupCollection groups = aMatch.Groups; CaptureCollection data = groups["Data"].Captures; if (data.Count > 0) { address = System.Convert.ToUInt32(groups["Address"].Value, 16); // Validate the address if (nextExpectedAddress != 0 && address != nextExpectedAddress) { throw new Exception(string.Format("Data is corrupt - expected: 0x{0:x8}, actual: 0x{1:x8}", nextExpectedAddress, address)); } else { foreach (Capture capture in data) { string val = capture.Value.Trim(); byte b = System.Convert.ToByte(val, 16); DataBufferByte entry = new DataBufferByte(b, (uint)iDataBuffer.Count); iDataBuffer.Add(entry); } } } return(address); }
public virtual sbyte[] GetData(DataBufferByte dbb, int bank) { return(dbb.Bankdata[bank]); }
/// <summary> /// Filters the information provided in the <code>imageComplete</code> /// method of the <code>ImageConsumer</code> interface. /// <para> /// Note: This method is intended to be called by the /// <code>ImageProducer</code> of the <code>Image</code> whose pixels /// are being filtered. Developers using /// this class to retrieve pixels from an image should avoid calling /// this method directly since that operation could result in problems /// with retrieving the requested pixels. /// </para> /// </summary> /// <param name="status"> the status of image loading </param> /// <exception cref="ImagingOpException"> if there was a problem calling the filter /// method of the <code>BufferedImageOp</code> associated with this /// instance. </exception> /// <seealso cref= ImageConsumer#imageComplete </seealso> public override void ImageComplete(int status) { WritableRaster wr; switch (status) { case ImageConsumer_Fields.IMAGEERROR: case ImageConsumer_Fields.IMAGEABORTED: // reinitialize the params Model = null; Width = -1; Height = -1; IntPixels = null; BytePixels = null; break; case ImageConsumer_Fields.SINGLEFRAMEDONE: case ImageConsumer_Fields.STATICIMAGEDONE: if (Width <= 0 || Height <= 0) { break; } if (Model is DirectColorModel) { if (IntPixels == null) { break; } wr = CreateDCMraster(); } else if (Model is IndexColorModel) { int[] bandOffsets = new int[] { 0 }; if (BytePixels == null) { break; } DataBufferByte db = new DataBufferByte(BytePixels, Width * Height); wr = Raster.CreateInterleavedRaster(db, Width, Height, Width, 1, bandOffsets, null); } else { ConvertToRGB(); if (IntPixels == null) { break; } wr = CreateDCMraster(); } BufferedImage bi = new BufferedImage(Model, wr, Model.AlphaPremultiplied, null); bi = BufferedImageOp_Renamed.Filter(bi, null); WritableRaster r = bi.Raster; ColorModel cm = bi.ColorModel; int w = r.Width; int h = r.Height; Consumer.SetDimensions(w, h); Consumer.ColorModel = cm; if (cm is DirectColorModel) { DataBufferInt db = (DataBufferInt)r.DataBuffer; Consumer.SetPixels(0, 0, w, h, cm, db.Data, 0, w); } else if (cm is IndexColorModel) { DataBufferByte db = (DataBufferByte)r.DataBuffer; Consumer.SetPixels(0, 0, w, h, cm, db.Data, 0, w); } else { throw new InternalError("Unknown color model " + cm); } break; } Consumer.ImageComplete(status); }
internal bool IsWithinCurrentStackDomain(DataBufferByte aEntry) { bool ret = StackPointerRange.Contains(aEntry.Address); return(ret); }
public void Add(DataBufferByte aEntry) { aEntry.Buffer = this; iData.Add(aEntry); }