@Override
protected boolean onTransact(int code,Parcel data,Parcel reply,int flags) throws remoteexception {
switch(code) {
case TRANSACT_methodWithNotNullSizeArrayParameter: {
data.enforceInterface(this.getInterfaceDescriptor());
final Sizef[] sizeArrayParamArray;
final int sizeArrayParamLength = data.readInt();
if (sizeArrayParamLength < 0) {
sizeArrayParamArray = null;
} else {
sizeArrayParamArray = new Sizef[sizeArrayParamLength];
for (int i = 0; i < sizeArrayParamArray.length; i++) {
sizeArrayParamArray[i] = data.readSizef();
}
}
delegate.methodWithNotNullSizeArrayParameter(sizeArrayParamArray);
reply.writeNoException();
return true;
}
}
return super.onTransact(code,data,reply,flags);
}
@Override
public void methodWithNotNullSizeArrayParameter(@NotNull Sizef[] sizeArrayParam) throws remoteexception {
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
try {
data.writeInterfacetoken(NotNullSizeArrayParameter$$AidlServerImpl.DESCRIPTOR);
if (sizeArrayParam == null) {
data.writeInt(-1);
} else {
data.writeInt(sizeArrayParam.length);
for (Sizef sizeArrayParamComponent : sizeArrayParam) {
data.writeSizef(sizeArrayParamComponent);
}
}
delegate.transact(NotNullSizeArrayParameter$$AidlServerImpl.TRANSACT_methodWithNotNullSizeArrayParameter,0);
reply.readException();
} finally {
data.recycle();
reply.recycle();
}
}
项目:TK_1701
文件:Camera2.java
public float[] getAngle() {
// 物理センサのサイズを取得(単位はミリメートル)
// Sizefクラス float型の幅widthと高さheightの情報を持つ
Sizef physicalSize = mCameracharacteristics.get( mCameracharacteristics.SENSOR_INFO_PHYSICAL_SIZE );
Log.d( "Cameracharacteristics","物理サイズ : " + physicalSize.getWidth() + "," + physicalSize.getHeight() );
// 焦点距離取得
float[] focalLength = mCameracharacteristics.get( mCameracharacteristics.LENS_INFO_AVAILABLE_FOCAL_LENGTHS );
// 画素配列の画素数取得
// Sizeクラス int型の幅widthと高さheightの情報を持つ
Size fullArraySize = mCameracharacteristics.get( mCameracharacteristics.SENSOR_INFO_PIXEL_ARRAY_SIZE );
Log.d( "Cameracharacteristics","画素配列幅 : " + fullArraySize.getWidth() + "," + fullArraySize.getHeight() );
// 有効な配列領域取得( = 切り取り領域[ 0,activeRect.width,activeRect.height ])
Rect activeRect = mCameracharacteristics.get( mCameracharacteristics.SENSOR_INFO_ACTIVE_ARRAY_SIZE );
Log.d( "Cameracharacteristics","有効配列幅 : " + activeRect.width() + "," + activeRect.height() );
// 出力ストリームのサイズ取得
Size outputStreamSize = new Size( mTextureView.getWidth(),mTextureView.getHeight() );
Log.d( "Cameracharacteristics","出力ストリーム : " + outputStreamSize.getWidth() + "," + outputStreamSize.getHeight() );
//
// 縦方向を切り取る場合(出力アスペクト比 > 切り取り領域のアスペクト比)
// 横方向を切り取る場合(出力アスペクト比 < 切り取り領域のアスペクト比)
/*
* 【FOVを求める式】 angle = 2 * arctan( d / (2 * f) )
* f = 焦点距離, d = 縦または横のセンサ物理サイズ
*/
// 実際に画面に表示している領域と取得したセンサ全体の物理サイズは異なる
// その辺の計算がよくわからないので全体で考えます
float[] angle = new float[2];
angle[0] = 2f * (float)Math.todegrees( Math.atan( physicalSize.getWidth() / ( 2 * focalLength[0] ) ) ); // 横
angle[1] = 2f * (float)Math.todegrees( Math.atan( physicalSize.getHeight() / ( 2 * focalLength[0] ) ) ); // 縦
Log.d("getAngle",angle[0] + "," + angle[1] + "," );
return angle;
}
项目:Lyra
文件:StateCoderUtilsTest.java
项目:Lyra
文件:StateCoderUtilsTest.java
项目:aidl2
文件:AbstractListTest$$AidlServerImpl.java
@Override
protected boolean onTransact(int code,int flags) throws remoteexception {
switch(code) {
case TRANSACT_methodWithCollectionReturn: {
data.enforceInterface(this.getInterfaceDescriptor());
final ArrayList<Sizef> abstrListCollection;
final int abstrListSize = data.readInt();
if (abstrListSize < 0) {
abstrListCollection = null;
} else {
abstrListCollection = new ArrayList<>(abstrListSize);
for (int j = 0; j < abstrListSize; j++) {
final Sizef abstrListTmp;
if (data.readByte() == -1) {
abstrListTmp = null;
} else {
abstrListTmp = data.readSizef();
}
abstrListCollection.add(abstrListTmp);
}
}
final Collection<AbstractListTest> returnValue = delegate.methodWithCollectionReturn(abstrListCollection);
reply.writeNoException();
if (returnValue == null) {
reply.writeInt(-1);
} else {
reply.writeInt(returnValue.size());
for (AbstractListTest returnValueElement : returnValue) {
reply.writeStrongBinder(returnValueElement == null ? null : returnValueElement.asBinder());
}
}
return true;
}
}
return super.onTransact(code,flags);
}
项目:typedbundle
文件:TypedBundleTest.java
项目:typedbundle
文件:TypedBundleTest.java
项目:TinyAndroidMVP
文件:MvpBundle.java
项目:TinyAndroidMVP
文件:MvpBundle.java
项目:baindo
文件:ValueSaverTest.java
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Test
public void shouldSaveSizefValueType() {
Bundle bundle = mock(Bundle.class);
Sizef value = new Sizef(42,42);
ValueSaver<Sizef> valueSaver = mValueSaverFactory.build(value);
valueSaver.save(bundle,SOME_KEY,value);
verify(bundle).putSizef(SOME_KEY,value);
}
项目:paperparcel
文件:TypeAdapterTest.java
@Override
public void write(Bundle bundle,Object to,StateField field) throws illegalaccessexception {
Field propertyField = field.getField();
propertyField.setAccessible(true);
bundle.putSizef(field.getBundleKey(),(Sizef) propertyField.get(to));
}
项目:OpenHub
文件:BundleHelper.java
项目:Rabbits
文件:AbstractNavigator.java
项目:aidl2
文件:SimpleMap$$AidlClientImpl.java
@Override
public Map<String,Integer> abstractMapMethod(Map<Parcelable,Sizef> responder) throws remoteexception {
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
try {
data.writeInterfacetoken(SimpleMap$$AidlServerImpl.DESCRIPTOR);
if (responder == null) {
data.writeInt(-1);
} else {
data.writeInt(responder.size());
for (Map.Entry<Parcelable,Sizef> responderEntry: responder.entrySet()) {
data.writeParcelable(responderEntry.getKey(),0);
if (responderEntry.getValue() == null) {
data.writeByte((byte) -1);
} else {
data.writeByte((byte) 0);
data.writeSizef(responderEntry.getValue());
}
}
}
delegate.transact(SimpleMap$$AidlServerImpl.TRANSACT_abstractMapMethod,0);
reply.readException();
final HashMap<String,Integer> returnValueMap;
final int returnValueSize = reply.readInt();
if (returnValueSize < 0) {
returnValueMap = null;
} else {
returnValueMap = new HashMap<>();
for (int k = 0; k < returnValueSize; k++) {
final Integer returnValueTmp;
if (reply.readByte() == -1) {
returnValueTmp = null;
} else {
returnValueTmp = reply.readInt();
}
returnValueMap.put(reply.readString(),returnValueTmp);
}
}
return returnValueMap;
} finally {
data.recycle();
reply.recycle();
}
}
项目:aidl2
文件:SimpleMap$$AidlClientImpl.java
@Override
public LinkedHashMap<String,Integer> concreteMapMethod(HashMap<Parcelable,0);
if (responderEntry.getValue() == null) {
data.writeByte((byte) -1);
} else {
data.writeByte((byte) 0);
data.writeSizef(responderEntry.getValue());
}
}
}
delegate.transact(SimpleMap$$AidlServerImpl.TRANSACT_concreteMapMethod,0);
reply.readException();
final LinkedHashMap<String,Integer> returnValueMap;
final int returnValueSize = reply.readInt();
if (returnValueSize < 0) {
returnValueMap = null;
} else {
returnValueMap = new LinkedHashMap<>(returnValueSize,1f);
for (int k = 0; k < returnValueSize; k++) {
final Integer returnValueTmp;
if (reply.readByte() == -1) {
returnValueTmp = null;
} else {
returnValueTmp = reply.readInt();
}
returnValueMap.put(reply.readString(),returnValueTmp);
}
}
return returnValueMap;
} finally {
data.recycle();
reply.recycle();
}
}
@Override
protected boolean onTransact(int code,int flags) throws remoteexception {
switch(code) {
case TRANSACT_methodWithAbstractListReturn: {
data.enforceInterface(this.getInterfaceDescriptor());
final ArrayList<Sizef[][]> sizesCollection;
final int sizesSize = data.readInt();
if (sizesSize < 0) {
sizesCollection = null;
} else {
sizesCollection = new ArrayList<>(sizesSize);
for (int j = 0; j < sizesSize; j++) {
final Sizef[][] sizesArray;
final int sizesLength = data.readInt();
if (sizesLength < 0) {
sizesArray = null;
} else {
sizesArray = new Sizef[sizesLength][];
for (int i = 0; i < sizesArray.length; i++) {
final Sizef[] sizesArray_;
final int sizesLength_ = data.readInt();
if (sizesLength_ < 0) {
sizesArray_ = null;
} else {
sizesArray_ = new Sizef[sizesLength_];
for (int i_ = 0; i_ < sizesArray_.length; i_++) {
final Sizef sizesTmp;
if (data.readByte() == -1) {
sizesTmp = null;
} else {
sizesTmp = data.readSizef();
}
sizesArray_[i_] = sizesTmp;
}
}
sizesArray[i] = sizesArray_;
}
}
sizesCollection.add(sizesArray);
}
}
final Collection<? extends Collection<? extends Serializable>> returnValue = delegate.methodWithAbstractListReturn(sizesCollection);
reply.writeNoException();
if (returnValue == null) {
reply.writeInt(-1);
} else {
reply.writeInt(returnValue.size());
for (Collection<? extends Serializable> returnValueElement : returnValue) {
if (returnValueElement == null) {
reply.writeInt(-1);
} else {
reply.writeInt(returnValueElement.size());
for (Serializable returnValueElement_ : returnValueElement) {
AidlUtil.writetoObjectStream(reply,returnValueElement_);
}
}
}
}
return true;
}
}
return super.onTransact(code,flags);
}
@Override
public AbstractList<List<Date>> methodWithAbstractListReturn(List<Sizef[][]> sizes) throws remoteexception {
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
try {
data.writeInterfacetoken(AbstractListSimplenested$$AidlServerImpl.DESCRIPTOR);
if (sizes == null) {
data.writeInt(-1);
} else {
data.writeInt(sizes.size());
for (Sizef[][] sizesElement : sizes) {
if (sizesElement == null) {
data.writeInt(-1);
} else {
data.writeInt(sizesElement.length);
for (Sizef[] sizesElementComponent : sizesElement) {
if (sizesElementComponent == null) {
data.writeInt(-1);
} else {
data.writeInt(sizesElementComponent.length);
for (Sizef sizesElementComponent_ : sizesElementComponent) {
if (sizesElementComponent_ == null) {
data.writeByte((byte) -1);
} else {
data.writeByte((byte) 0);
data.writeSizef(sizesElementComponent_);
}
}
}
}
}
}
}
delegate.transact(AbstractListSimplenested$$AidlServerImpl.TRANSACT_methodWithAbstractListReturn,0);
reply.readException();
final ArrayList<List<Date>> returnValueCollection;
final int returnValueSize = reply.readInt();
if (returnValueSize < 0) {
returnValueCollection = null;
} else {
returnValueCollection = new ArrayList<>(returnValueSize);
for (int j = 0; j < returnValueSize; j++) {
final ArrayList<Date> returnValueCollection_;
final int returnValueSize_ = reply.readInt();
if (returnValueSize_ < 0) {
returnValueCollection_ = null;
} else {
returnValueCollection_ = new ArrayList<>(returnValueSize_);
for (int j_ = 0; j_ < returnValueSize_; j_++) {
returnValueCollection_.add(AidlUtil.readFromObjectStream(reply));
}
}
returnValueCollection.add(returnValueCollection_);
}
}
return returnValueCollection;
} finally {
data.recycle();
reply.recycle();
}
}
项目:aidl2
文件:AbstractListTest$$AidlClientImpl.java
@Override
public Collection<AbstractListTest> methodWithCollectionReturn(AbstractList<Sizef> abstrList) throws remoteexception {
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
try {
data.writeInterfacetoken(AbstractListTest$$AidlServerImpl.DESCRIPTOR);
if (abstrList == null) {
data.writeInt(-1);
} else {
data.writeInt(abstrList.size());
for (Sizef abstrListElement : abstrList) {
if (abstrListElement == null) {
data.writeByte((byte) -1);
} else {
data.writeByte((byte) 0);
data.writeSizef(abstrListElement);
}
}
}
delegate.transact(AbstractListTest$$AidlServerImpl.TRANSACT_methodWithCollectionReturn,0);
reply.readException();
final ArrayList<AbstractListTest> returnValueCollection;
final int returnValueSize = reply.readInt();
if (returnValueSize < 0) {
returnValueCollection = null;
} else {
returnValueCollection = new ArrayList<>(returnValueSize);
for (int j = 0; j < returnValueSize; j++) {
final IBinder returnValueBinder = reply.readStrongBinder();
final AbstractListTest iReturnValue = returnValueBinder == null ? null : InterfaceLoader.asInterface(returnValueBinder,AbstractListTest.class);
returnValueCollection.add(iReturnValue);
}
}
return returnValueCollection;
} finally {
data.recycle();
reply.recycle();
}
}
项目:Akatsuki
文件:Bundle.java
项目:Akatsuki
文件:Bundle.java
项目:paperparcel
文件:StaticAdapters.java
项目:paperparcel
文件:StaticAdapters.java
项目:lr_dialer
文件:Bundler.java
/**
* Inserts a Sizef value into the mapping of this Bundle,replacing
* any existing value for the given key. Either key or value may be null.
*
* @param key a String,or null
* @param value a Sizef object,or null
*/
@TargetApi(21)
public Bundler putSizef(String key,Sizef value)
{
bundle.putSizef(key,value);
return this;
}
项目:GitHub
文件:Bundler.java
项目:KUtils
文件:Bundler.java
/**
* Inserts a Sizef value into the mapping of this Bundle,value);
return this;
}
/**
* Write a field's value into the saved state {@link Bundle}.
*
* @param state {@link Bundle} used to save the state
* @param key key retrieved from {@code fieldDeclaringClass#fieldName}
* @param fieldValue value of field
*/
@Override
public void serialize(@NonNull Bundle state,@NonNull String key,@NonNull Sizef fieldValue) {
state.putSizef(key,fieldValue);
}
项目:KUtils-master
文件:Bundler.java
/**
* Inserts a Sizef value into the mapping of this Bundle,value);
return this;
}
/**
* Returns the value associated with the given key,or null if
* no mapping of the desired type exists for the given key or a null
* value is explicitly associated with the key.
*
* @param key a String,or null
* @return a Size value,or null
*/
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Nullable
public Sizef getSizef(@Nullable String key) {
return mBundle.getSizef(key);
}
项目:typedbundle
文件:TypedBundle.java
/**
* Inserts a value into the mapping of this {@code TypedBundle},replacing any existing value
* for the given key.
*
* @param key the key
* @param value the value
* @return the {@code TypedBundle} for chaining
*/
@TargetApi(21)
public TypedBundle put(@NonNull Key<Sizef> key,Sizef value) {
bundle.putSizef(key.name,value);
return this;
}
项目:SmartTabLayout
文件:Bundler.java
/**
* Inserts a Sizef value into the mapping of this Bundle,value);
return this;
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。