コード例 #1
0
		internal SFImage ParseSFImageValue()
		{
			// int32 int32 int32 ...

			SFImage ret=null;

			try
			{
				ret=new SFImage();
				ret.Width=GetIntNumber(GetNextNumberToken());
				ret.Height=GetIntNumber(GetNextNumberToken());
				ret.NumberOfComponents=GetIntNumber(GetNextNumberToken());
			}
			catch(UserCancellationException) { throw; }
			catch(Exception ex)
			{
				ErrorParsingField(VRMLReaderError.SFImageInvalid, ex);
			}

			if(ret.Width<0||ret.Height<0||ret.NumberOfComponents<0||ret.NumberOfComponents>4)
				ErrorParsingField(VRMLReaderError.SFImageInvalid);

			if(ret.Width==0||ret.Height==0||ret.NumberOfComponents==0) return ret;

			try
			{
				for(int i=0; i<ret.Width*ret.Height; i++) ret.PixelValues.Add(GetIntNumber(GetNextNumberToken()));
			}
			catch(UserCancellationException) { throw; }
			catch(Exception ex)
			{
				ErrorParsingField(VRMLReaderError.SFImageInvalid, ex);
			}

			return ret;
		}
コード例 #2
0
		public x3dPixelTexture()
		{
			Image=new SFImage();
			RepeatS=true;
			RepeatT=true;
		}